Search in sources :

Example 1 with BRProfileBlockAdapter

use of sugar.free.sightremote.adapters.BRProfileBlockAdapter in project SightRemote by TebbeUbben.

the class EditBRProfileActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContent(R.layout.activity_edit_br_profile);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    if (savedInstanceState == null) {
        nameBlock = (NameBlock) SerializationUtils.deserialize(getIntent().getByteArrayExtra("nameBlock"));
        profileBlock = (BRProfileBlock) SerializationUtils.deserialize(getIntent().getByteArrayExtra("profileBlock"));
    } else {
        nameBlock = (NameBlock) SerializationUtils.deserialize(savedInstanceState.getByteArray("nameBlock"));
        profileBlock = (BRProfileBlock) SerializationUtils.deserialize(savedInstanceState.getByteArray("profileBlock"));
        minBRAmount = savedInstanceState.getDouble("minBRAmount");
        maxBRAmount = savedInstanceState.getDouble("maxBRAmount");
    }
    adjustTitle();
    profileBlocks = FixedSizeProfileBlock.convertToFixed(profileBlock.getProfileBlocks());
    blockList = findViewById(R.id.block_list);
    blockList.setLayoutManager(new LinearLayoutManager(this));
    blockList.setAdapter(adapter = new BRProfileBlockAdapter());
    adapter.setProfileBlocks(profileBlocks);
    adapter.setOnClickListener(this);
    adapter.notifyDataSetChanged();
    if (maxBRAmount == -1)
        showManualOverlay();
}
Also used : BRProfileBlockAdapter(sugar.free.sightremote.adapters.BRProfileBlockAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 BRProfileBlockAdapter (sugar.free.sightremote.adapters.BRProfileBlockAdapter)1