basal profile on overview

This commit is contained in:
AdrianLxM 2016-11-10 21:00:50 +01:00
parent 80e875b821
commit 4ee87d1cca
2 changed files with 29 additions and 3 deletions

View file

@ -84,6 +84,8 @@ public class OverviewFragment extends Fragment {
TextView timeAgoView;
TextView deltaView;
TextView runningTempView;
TextView baseBasalView;
TextView activeProfileView;
TextView iobView;
TextView apsModeView;
GraphView bgGraph;
@ -120,6 +122,9 @@ public class OverviewFragment extends Fragment {
timeAgoView = (TextView) view.findViewById(R.id.overview_timeago);
deltaView = (TextView) view.findViewById(R.id.overview_delta);
runningTempView = (TextView) view.findViewById(R.id.overview_runningtemp);
baseBasalView = (TextView) view.findViewById(R.id.overview_basebasal);
activeProfileView = (TextView) view.findViewById(R.id.overview_activeprofile);
iobView = (TextView) view.findViewById(R.id.overview_iob);
apsModeView = (TextView) view.findViewById(R.id.overview_apsmode);
bgGraph = (GraphView) view.findViewById(R.id.overview_bggraph);
@ -464,12 +469,14 @@ public class OverviewFragment extends Fragment {
TempBasal activeTemp = pump.getTempBasal();
cancelTempLayout.setVisibility(View.VISIBLE);
cancelTempButton.setText(MainApp.instance().getString(R.string.cancel) + ": " + activeTemp.toString());
runningTempView.setText(activeTemp.toString() + "\n(" + DecimalFormatter.to2Decimal(pump.getBaseBasalRate()) + " U/h" + ")");
runningTempView.setVisibility(View.VISIBLE);
runningTempView.setText(activeTemp.toString());
} else {
cancelTempLayout.setVisibility(View.GONE);
Double currentBasal = pump.getBaseBasalRate();
runningTempView.setText(DecimalFormatter.to2Decimal(currentBasal) + " U/h");
runningTempView.setVisibility(View.GONE);
}
baseBasalView.setText(DecimalFormatter.to2Decimal(pump.getBaseBasalRate()) + " U/h");
activeProfileView.setText(profile.getActiveProfile());
if (profile == null) {
// disable all treatment buttons because we are not able to check constraints without profile

View file

@ -78,6 +78,25 @@
android:layout_marginLeft="10dp"
android:textAppearance="?android:attr/textAppearanceSmall" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/overview_basebasal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="@+id/overview_activeprofile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:textColor="@color/colorProfileSwitchButton"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</LinearLayout>
</LinearLayout>