diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java index a4772d0f10..62fe0042e3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java @@ -44,14 +44,17 @@ public class ConfigBuilderFragment extends Fragment implements FragmentBase { ListView bgsourceListView; ListView pumpListView; + TextView pumpLabel; ListView loopListView; TextView loopLabel; ListView treatmentsListView; ListView tempsListView; + TextView tempsLabel; ListView profileListView; ListView apsListView; TextView apsLabel; ListView constraintsListView; + TextView constraintsLabel; ListView generalListView; TextView nsclientVerView; TextView nightscoutVerView; @@ -77,14 +80,17 @@ public class ConfigBuilderFragment extends Fragment implements FragmentBase { View view = inflater.inflate(R.layout.configbuilder_fragment, container, false); bgsourceListView = (ListView) view.findViewById(R.id.configbuilder_bgsourcelistview); pumpListView = (ListView) view.findViewById(R.id.configbuilder_pumplistview); + pumpLabel = (TextView) view.findViewById(R.id.configbuilder_pumplabel); loopListView = (ListView) view.findViewById(R.id.configbuilder_looplistview); loopLabel = (TextView) view.findViewById(R.id.configbuilder_looplabel); treatmentsListView = (ListView) view.findViewById(R.id.configbuilder_treatmentslistview); tempsListView = (ListView) view.findViewById(R.id.configbuilder_tempslistview); + tempsLabel = (TextView) view.findViewById(R.id.configbuilder_tempslabel); profileListView = (ListView) view.findViewById(R.id.configbuilder_profilelistview); apsListView = (ListView) view.findViewById(R.id.configbuilder_apslistview); apsLabel = (TextView) view.findViewById(R.id.configbuilder_apslabel); constraintsListView = (ListView) view.findViewById(R.id.configbuilder_constraintslistview); + constraintsLabel = (TextView) view.findViewById(R.id.configbuilder_constraintslabel); generalListView = (ListView) view.findViewById(R.id.configbuilder_generallistview); nsclientVerView = (TextView) view.findViewById(R.id.configbuilder_nsclientversion); nightscoutVerView = (TextView) view.findViewById(R.id.configbuilder_nightscoutversion); @@ -125,6 +131,8 @@ public class ConfigBuilderFragment extends Fragment implements FragmentBase { setListViewHeightBasedOnChildren(bgsourceListView); pumpDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsList(PluginBase.PUMP), PluginBase.PUMP); pumpListView.setAdapter(pumpDataAdapter); + if (MainApp.getSpecificPluginsList(PluginBase.PUMP).size() == 0) + pumpLabel.setVisibility(View.GONE); setListViewHeightBasedOnChildren(pumpListView); loopDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsList(PluginBase.LOOP), PluginBase.LOOP); loopListView.setAdapter(loopDataAdapter); @@ -137,6 +145,8 @@ public class ConfigBuilderFragment extends Fragment implements FragmentBase { tempsDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsList(PluginBase.TEMPBASAL), PluginBase.TEMPBASAL); tempsListView.setAdapter(tempsDataAdapter); setListViewHeightBasedOnChildren(tempsListView); + if (MainApp.getSpecificPluginsList(PluginBase.TEMPBASAL).size() == 0) + tempsLabel.setVisibility(View.GONE); profileDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsListByInterface(ProfileInterface.class), PluginBase.PROFILE); profileListView.setAdapter(profileDataAdapter); setListViewHeightBasedOnChildren(profileListView); @@ -148,6 +158,8 @@ public class ConfigBuilderFragment extends Fragment implements FragmentBase { constraintsDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsListByInterface(ConstraintsInterface.class), PluginBase.CONSTRAINTS); constraintsListView.setAdapter(constraintsDataAdapter); setListViewHeightBasedOnChildren(constraintsListView); + if (MainApp.getSpecificPluginsList(PluginBase.CONSTRAINTS).size() == 0) + constraintsLabel.setVisibility(View.GONE); generalDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsList(PluginBase.GENERAL), PluginBase.GENERAL); generalListView.setAdapter(generalDataAdapter); setListViewHeightBasedOnChildren(generalListView); diff --git a/app/src/main/res/layout/configbuilder_fragment.xml b/app/src/main/res/layout/configbuilder_fragment.xml index 587724e775..5be24ddefb 100644 --- a/app/src/main/res/layout/configbuilder_fragment.xml +++ b/app/src/main/res/layout/configbuilder_fragment.xml @@ -43,6 +43,7 @@