Hide buttons on Combo tab until plugin is initialized.
This commit is contained in:
parent
7a2df05f5d
commit
1e19f19cd2
2 changed files with 7 additions and 0 deletions
|
@ -8,6 +8,7 @@ import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.squareup.otto.Subscribe;
|
import com.squareup.otto.Subscribe;
|
||||||
|
@ -27,6 +28,7 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
|
||||||
private TextView lastConnectionView;
|
private TextView lastConnectionView;
|
||||||
private TextView lastBolusView;
|
private TextView lastBolusView;
|
||||||
private TextView tempBasalText;
|
private TextView tempBasalText;
|
||||||
|
private LinearLayout buttonsLayout;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
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);
|
lastConnectionView = (TextView) view.findViewById(R.id.combo_lastconnection);
|
||||||
lastBolusView = (TextView) view.findViewById(R.id.combo_last_bolus);
|
lastBolusView = (TextView) view.findViewById(R.id.combo_last_bolus);
|
||||||
tempBasalText = (TextView) view.findViewById(R.id.combo_temp_basal);
|
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);
|
Button refresh = (Button) view.findViewById(R.id.combo_refresh);
|
||||||
refresh.setOnClickListener(this);
|
refresh.setOnClickListener(this);
|
||||||
|
@ -111,6 +114,8 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis
|
||||||
activityView.setText(activity != null ? activity : "");
|
activityView.setText(activity != null ? activity : "");
|
||||||
|
|
||||||
if (plugin.isInitialized()) {
|
if (plugin.isInitialized()) {
|
||||||
|
buttonsLayout.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
// battery
|
// battery
|
||||||
batteryView.setTextSize(20);
|
batteryView.setTextSize(20);
|
||||||
if (ps.batteryState == PumpState.EMPTY) {
|
if (ps.batteryState == PumpState.EMPTY) {
|
||||||
|
|
|
@ -347,8 +347,10 @@
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/combo_buttons_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
|
|
Loading…
Reference in a new issue