force enabled if only 1 plugin exists

This commit is contained in:
Milos Kozak 2016-12-11 13:36:32 +01:00
parent be1ec7f3e3
commit 0d6787a744

View file

@ -208,10 +208,12 @@ public class ConfigBuilderFragment extends Fragment implements FragmentBase {
holder.checkboxVisible.setEnabled(false);
}
// Force enabled if there is only one plugin
// Hide enabled control and force enabled plugin if there is only one plugin available
if (type == PluginBase.PUMP || type == PluginBase.TREATMENT || type == PluginBase.TEMPBASAL || type == PluginBase.PROFILE)
if (pluginList.size() < 2)
if (pluginList.size() < 2) {
holder.checkboxEnabled.setEnabled(false);
plugin.setFragmentEnabled(type, true);
}
// Constraints cannot be disabled
if (type == PluginBase.CONSTRAINTS)