cob on overview
This commit is contained in:
parent
33de4e8f2a
commit
7f92f42923
4 changed files with 107 additions and 16 deletions
|
@ -1126,17 +1126,24 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
||||||
IobTotal bolusIob = MainApp.getConfigBuilder().getLastCalculationTreatments().round();
|
IobTotal bolusIob = MainApp.getConfigBuilder().getLastCalculationTreatments().round();
|
||||||
IobTotal basalIob = MainApp.getConfigBuilder().getLastCalculationTempBasals().round();
|
IobTotal basalIob = MainApp.getConfigBuilder().getLastCalculationTempBasals().round();
|
||||||
|
|
||||||
String iobtext = getString(R.string.treatments_iob_label_string) + " " + DecimalFormatter.to2Decimal(bolusIob.iob + basalIob.basaliob) + "U ("
|
if (MainApp.sResources.getBoolean(R.bool.isTablet)) {
|
||||||
+ getString(R.string.bolus) + ": " + DecimalFormatter.to2Decimal(bolusIob.iob) + "U "
|
String iobtext = DecimalFormatter.to2Decimal(bolusIob.iob + basalIob.basaliob) + "U ("
|
||||||
+ getString(R.string.basal) + ": " + DecimalFormatter.to2Decimal(basalIob.basaliob) + "U)";
|
+ getString(R.string.bolus) + ": " + DecimalFormatter.to2Decimal(bolusIob.iob) + "U "
|
||||||
iobView.setText(iobtext);
|
+ getString(R.string.basal) + ": " + DecimalFormatter.to2Decimal(basalIob.basaliob) + "U)";
|
||||||
|
iobView.setText(iobtext);
|
||||||
|
} else {
|
||||||
|
String iobtext = DecimalFormatter.to2Decimal(bolusIob.iob + basalIob.basaliob) + "U ("
|
||||||
|
+ DecimalFormatter.to2Decimal(bolusIob.iob) + "/"
|
||||||
|
+ DecimalFormatter.to2Decimal(basalIob.basaliob) + ")";
|
||||||
|
iobView.setText(iobtext);
|
||||||
|
}
|
||||||
|
|
||||||
// cob
|
// cob
|
||||||
if (cobView != null) { // view must not exists
|
if (cobView != null) { // view must not exists
|
||||||
String cobText = "";
|
String cobText = "";
|
||||||
AutosensData autosensData = IobCobCalculatorPlugin.getAutosensData(System.currentTimeMillis());
|
AutosensData autosensData = IobCobCalculatorPlugin.getAutosensData(System.currentTimeMillis());
|
||||||
if (autosensData != null)
|
if (autosensData != null)
|
||||||
cobText = (int) autosensData.cob + " g " + String.format(MainApp.sResources.getString(R.string.minago), autosensData.minOld());
|
cobText = (int) autosensData.cob + " g";
|
||||||
cobView.setText(cobText);
|
cobView.setText(cobText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -188,12 +188,54 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/overview_iob"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
android:orientation="horizontal"
|
||||||
|
android:paddingTop="5dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/iob"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:text=":"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/overview_iob"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingLeft="5dp"
|
||||||
|
android:text=""
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:text="@string/cob" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:text=":" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/overview_cob"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingLeft="5dp"
|
||||||
|
android:text="23 g" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -182,12 +182,54 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/overview_iob"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
android:orientation="horizontal"
|
||||||
|
android:paddingTop="5dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/iob"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:text=":"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/overview_iob"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingLeft="5dp"
|
||||||
|
android:text=""
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:text="@string/cob" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:text=":" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/overview_cob"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingLeft="5dp"
|
||||||
|
android:text="23 g" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -320,7 +320,7 @@
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="5dp"
|
android:paddingLeft="5dp"
|
||||||
android:text="0.50U/h @17:35 1/30min - 0.40U/h"
|
android:text=""
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue