From 1e19f19cd2dc9b369bdcb858150e94f20229c5d5 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Sun, 3 Dec 2017 21:01:14 +0100 Subject: [PATCH] Hide buttons on Combo tab until plugin is initialized. --- .../androidaps/plugins/PumpCombo/ComboFragment.java | 5 +++++ app/src/main/res/layout/combopump_fragment.xml | 2 ++ 2 files changed, 7 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboFragment.java index 365a4db845..4eac04d8e2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboFragment.java @@ -8,6 +8,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; +import android.widget.LinearLayout; import android.widget.TextView; import com.squareup.otto.Subscribe; @@ -27,6 +28,7 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis private TextView lastConnectionView; private TextView lastBolusView; private TextView tempBasalText; + private LinearLayout buttonsLayout; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, @@ -40,6 +42,7 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis lastConnectionView = (TextView) view.findViewById(R.id.combo_lastconnection); lastBolusView = (TextView) view.findViewById(R.id.combo_last_bolus); tempBasalText = (TextView) view.findViewById(R.id.combo_temp_basal); + buttonsLayout = (LinearLayout) view.findViewById(R.id.combo_buttons_layout); Button refresh = (Button) view.findViewById(R.id.combo_refresh); refresh.setOnClickListener(this); @@ -111,6 +114,8 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis activityView.setText(activity != null ? activity : ""); if (plugin.isInitialized()) { + buttonsLayout.setVisibility(View.VISIBLE); + // battery batteryView.setTextSize(20); if (ps.batteryState == PumpState.EMPTY) { diff --git a/app/src/main/res/layout/combopump_fragment.xml b/app/src/main/res/layout/combopump_fragment.xml index 2e10ea1dcf..f6921691ea 100644 --- a/app/src/main/res/layout/combopump_fragment.xml +++ b/app/src/main/res/layout/combopump_fragment.xml @@ -347,8 +347,10 @@ android:orientation="vertical">