Combo: show pump id in UI.

This commit is contained in:
Johannes Mockenhaupt 2021-04-24 23:48:09 +02:00
parent 97bf95a6fa
commit 76568cac38
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
3 changed files with 49 additions and 0 deletions

View file

@ -54,6 +54,7 @@ public class ComboFragment extends DaggerFragment {
private Button refreshButton; private Button refreshButton;
private TextView bolusCount; private TextView bolusCount;
private TextView tbrCount; private TextView tbrCount;
private TextView serialNumber;
@Override @Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
@ -70,6 +71,7 @@ public class ComboFragment extends DaggerFragment {
tempBasalText = view.findViewById(R.id.combo_temp_basal); tempBasalText = view.findViewById(R.id.combo_temp_basal);
bolusCount = view.findViewById(R.id.combo_bolus_count); bolusCount = view.findViewById(R.id.combo_bolus_count);
tbrCount = view.findViewById(R.id.combo_tbr_count); tbrCount = view.findViewById(R.id.combo_tbr_count);
serialNumber= view.findViewById(R.id.combo_serial_number);
refreshButton = view.findViewById(R.id.combo_refresh_button); refreshButton = view.findViewById(R.id.combo_refresh_button);
refreshButton.setOnClickListener(v -> { refreshButton.setOnClickListener(v -> {
@ -242,6 +244,7 @@ public class ComboFragment extends DaggerFragment {
// stats // stats
bolusCount.setText(String.valueOf(sp.getLong(ComboPlugin.COMBO_BOLUSES_DELIVERED, 0L))); bolusCount.setText(String.valueOf(sp.getLong(ComboPlugin.COMBO_BOLUSES_DELIVERED, 0L)));
tbrCount.setText(String.valueOf(sp.getLong(ComboPlugin.COMBO_TBRS_SET, 0L))); tbrCount.setText(String.valueOf(sp.getLong(ComboPlugin.COMBO_TBRS_SET, 0L)));
serialNumber.setText(comboPlugin.serialNumber());
} }
} }
} }

View file

@ -462,6 +462,51 @@
</LinearLayout> </LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="5dp"
android:background="@color/list_delimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingRight="5dp"
android:text="@string/combo_serial_number"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingEnd="2dp"
android:paddingStart="2dp"
android:text=":"
android:textSize="14sp" />
<TextView
android:id="@+id/combo_serial_number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View <View
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="2dip" android:layout_height="2dip"

View file

@ -54,4 +54,5 @@
<string name="combo_tbr_count">TBR count</string> <string name="combo_tbr_count">TBR count</string>
<string name="bolusstopped">Bolus stopped</string> <string name="bolusstopped">Bolus stopped</string>
<string name="bolusstopping">Stopping bolus</string> <string name="bolusstopping">Stopping bolus</string>
<string name="combo_serial_number">Pump identifier</string>
</resources> </resources>