combo: show generated serial in fragment

This commit is contained in:
Milos Kozak 2022-04-14 10:16:00 +02:00
parent 80e10389ab
commit 2ac4cbd1db
2 changed files with 48 additions and 0 deletions

View file

@ -61,6 +61,7 @@ public class ComboFragment extends DaggerFragment {
private TextView errorCountLabel; private TextView errorCountLabel;
private TextView errorCountDots; private TextView errorCountDots;
private TextView errorCountValue; private TextView errorCountValue;
private TextView serialNumber;
@Override @Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
@ -77,6 +78,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.serial_number);
errorCountDelimiter = view.findViewById(R.id.combo_connection_error_delimiter); errorCountDelimiter = view.findViewById(R.id.combo_connection_error_delimiter);
errorCountLayout = view.findViewById(R.id.combo_connection_error_layout); errorCountLayout = view.findViewById(R.id.combo_connection_error_layout);
@ -255,6 +257,7 @@ public class ComboFragment extends DaggerFragment {
// stats // stats
bolusCount.setText(String.valueOf(comboPlugin.getBolusesDelivered())); bolusCount.setText(String.valueOf(comboPlugin.getBolusesDelivered()));
tbrCount.setText(String.valueOf(comboPlugin.getTbrsSet())); tbrCount.setText(String.valueOf(comboPlugin.getTbrsSet()));
serialNumber.setText(comboPlugin.serialNumber());
updateErrorDisplay(false); updateErrorDisplay(false);
} else { } else {

View file

@ -510,6 +510,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="?android:attr/dividerHorizontal" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:focusable="true">
<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/serialnumber"
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/serial_number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingLeft="5dp"
android:textSize="14sp" />
</LinearLayout>
<View <View
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="2dip" android:layout_height="2dip"