Search in sources :

Example 1 with ActiveProfileBlock

use of sugar.free.sightparser.applayer.descriptors.configuration_blocks.ActiveProfileBlock in project SightRemote by TebbeUbben.

the class ChangeActiveBRProfileActivity method onProfileChange.

@Override
public void onProfileChange(int profile) {
    ActiveProfileBlock block = new ActiveProfileBlock();
    block.setActiveProfile(ActiveProfileBlock.ActiveProfile.values()[profile]);
    ArrayList<ConfigurationBlock> blocks = new ArrayList<>();
    blocks.add(block);
    WriteConfigurationTaskRunner taskRunner = new WriteConfigurationTaskRunner(getServiceConnector(), blocks);
    (confirmationDialog = new ConfirmationDialog(this, HTMLUtil.getHTML(R.string.change_br_profile_confirmation), () -> {
        taskRunner.fetch(this);
        adapter.setActiveProfile(profile);
        adapter.notifyDataSetChanged();
    }, () -> adapter.notifyDataSetChanged())).show();
}
Also used : ConfigurationBlock(sugar.free.sightparser.applayer.descriptors.configuration_blocks.ConfigurationBlock) ArrayList(java.util.ArrayList) WriteConfigurationTaskRunner(sugar.free.sightparser.handling.taskrunners.WriteConfigurationTaskRunner) ActiveProfileBlock(sugar.free.sightparser.applayer.descriptors.configuration_blocks.ActiveProfileBlock) ConfirmationDialog(sugar.free.sightremote.dialogs.ConfirmationDialog)

Aggregations

ArrayList (java.util.ArrayList)1 ActiveProfileBlock (sugar.free.sightparser.applayer.descriptors.configuration_blocks.ActiveProfileBlock)1 ConfigurationBlock (sugar.free.sightparser.applayer.descriptors.configuration_blocks.ConfigurationBlock)1 WriteConfigurationTaskRunner (sugar.free.sightparser.handling.taskrunners.WriteConfigurationTaskRunner)1 ConfirmationDialog (sugar.free.sightremote.dialogs.ConfirmationDialog)1