From 4ee87d1cca24da7657aaac406b00626ec1f0f756 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Thu, 10 Nov 2016 21:00:50 +0100 Subject: [PATCH 1/2] basal profile on overview --- .../plugins/Overview/OverviewFragment.java | 13 ++++++++++--- app/src/main/res/layout/overview_fragment.xml | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java index ea97cd8b67..bbc16d841d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java @@ -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 diff --git a/app/src/main/res/layout/overview_fragment.xml b/app/src/main/res/layout/overview_fragment.xml index bac64384b7..1a51056709 100644 --- a/app/src/main/res/layout/overview_fragment.xml +++ b/app/src/main/res/layout/overview_fragment.xml @@ -78,6 +78,25 @@ android:layout_marginLeft="10dp" android:textAppearance="?android:attr/textAppearanceSmall" /> + + + + + From 7b4b4f7cfcf25267898f80bd57df7fe00ddc69c3 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Thu, 10 Nov 2016 23:17:28 +0100 Subject: [PATCH 2/2] Overview profile redesign --- .../plugins/Overview/OverviewFragment.java | 3 +++ app/src/main/res/drawable/pillborder.xml | 6 ++++++ app/src/main/res/layout/overview_fragment.xml | 12 +++++++++--- 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 app/src/main/res/drawable/pillborder.xml diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java index bbc16d841d..f76743bc4f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java @@ -411,6 +411,7 @@ public class OverviewFragment extends Fragment { if (Config.APS) { apsModeView.setVisibility(View.VISIBLE); apsModeView.setBackgroundResource(R.drawable.loopmodeborder); + apsModeView.setTextColor(Color.BLACK); final LoopPlugin activeloop = MainApp.getConfigBuilder().getActiveLoop(); if(activeloop != null && activeloop.isEnabled(activeloop.getType())) { if (MainApp.getConfigBuilder().isClosedModeEnabled()) { @@ -421,6 +422,8 @@ public class OverviewFragment extends Fragment { } else { apsModeView.setBackgroundResource(R.drawable.loopmodedisabledborder); apsModeView.setText(MainApp.sResources.getString(R.string.disabledloop)); + apsModeView.setTextColor(Color.WHITE); + } diff --git a/app/src/main/res/drawable/pillborder.xml b/app/src/main/res/drawable/pillborder.xml new file mode 100644 index 0000000000..63e4eb57eb --- /dev/null +++ b/app/src/main/res/drawable/pillborder.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/overview_fragment.xml b/app/src/main/res/layout/overview_fragment.xml index 1a51056709..55b2132d2c 100644 --- a/app/src/main/res/layout/overview_fragment.xml +++ b/app/src/main/res/layout/overview_fragment.xml @@ -79,11 +79,12 @@ android:textAppearance="?android:attr/textAppearanceSmall" /> + android:gravity="center_vertical|center_horizontal" + android:background="@drawable/pillborder" + android:textAppearance="?android:attr/textAppearanceMedium" />