From b9c649bd68d8aad812a5cae57062aeec7cbef4f9 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Sun, 6 May 2018 11:46:09 +0200 Subject: [PATCH 1/3] Uso blue/orange for carbs/insulin in confirmation dialogs. Aligns with the graph's use of using blueish colors insulin and orange for carbs stuff. --- .../plugins/Overview/Dialogs/NewCarbsDialog.java | 4 ++-- .../plugins/Overview/Dialogs/NewInsulinDialog.java | 6 +++--- .../plugins/Overview/Dialogs/WizardDialog.java | 9 ++++----- app/src/main/res/values/colors.xml | 4 +++- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java index 2ebab6caab..4360e2ed34 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java @@ -330,10 +330,10 @@ public class NewCarbsDialog extends DialogFragment implements OnClickListener, C actions.add(MainApp.gs(R.string.duration) + ": " + duration + MainApp.gs(R.string.shorthour)); } if (carbs > 0) { - actions.add(MainApp.gs(R.string.carbs) + ": " + "" + carbsAfterConstraints + "g" + ""); + actions.add(MainApp.gs(R.string.carbs) + ": " + "" + carbsAfterConstraints + "g" + ""); } if (!carbsAfterConstraints.equals(carbs)) { - actions.add("" + MainApp.gs(R.string.carbsconstraintapplied) + ""); + actions.add("" + MainApp.gs(R.string.carbsconstraintapplied) + ""); } final String notes = notesEdit.getText().toString(); if (!notes.isEmpty()) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewInsulinDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewInsulinDialog.java index 3539bee093..0ac2fe06ef 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewInsulinDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewInsulinDialog.java @@ -201,14 +201,14 @@ public class NewInsulinDialog extends DialogFragment implements OnClickListener List actions = new LinkedList<>(); if (insulin > 0) { - actions.add(MainApp.gs(R.string.bolus) + ": " + "" + insulinAfterConstraints + "U" + ""); + actions.add(MainApp.gs(R.string.bolus) + ": " + "" + insulinAfterConstraints + "U" + ""); if (recordOnlyCheckbox.isChecked()) { - actions.add("" + MainApp.gs(R.string.bolusrecordedonly) + ""); + actions.add("" + MainApp.gs(R.string.bolusrecordedonly) + ""); } } if (!insulinAfterConstraints.equals(insulin)) - actions.add("" + MainApp.gs(R.string.bolusconstraintapplied) + ""); + actions.add("" + MainApp.gs(R.string.bolusconstraintapplied) + ""); int eatingSoonTTDuration = SP.getInt(R.string.key_eatingsoon_duration, Constants.defaultEatingSoonTTDuration); eatingSoonTTDuration = eatingSoonTTDuration > 0 ? eatingSoonTTDuration : Constants.defaultEatingSoonTTDuration; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/WizardDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/WizardDialog.java index 718b1c6bfa..c38f41b825 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/WizardDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/WizardDialog.java @@ -304,16 +304,15 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com final Profile profile = MainApp.getConfigBuilder().getProfile(); if (profile != null && (calculatedTotalInsulin > 0d || calculatedCarbs > 0d)) { - DecimalFormat formatNumber2decimalplaces = new DecimalFormat("0.00"); - String confirmMessage = MainApp.gs(R.string.entertreatmentquestion); Double insulinAfterConstraints = MainApp.getConstraintChecker().applyBolusConstraints(new Constraint<>(calculatedTotalInsulin)).value(); Integer carbsAfterConstraints = MainApp.getConstraintChecker().applyCarbsConstraints(new Constraint<>(calculatedCarbs)).value(); - confirmMessage += "
" + MainApp.gs(R.string.bolus) + ": " + "" + formatNumber2decimalplaces.format(insulinAfterConstraints) + "U" + ""; - confirmMessage += "
" + MainApp.gs(R.string.carbs) + ": " + carbsAfterConstraints + "g"; - + if (insulinAfterConstraints > 0) + confirmMessage += "
" + MainApp.gs(R.string.bolus) + ": " + "" + DecimalFormatter.toPumpSupportedBolus(insulinAfterConstraints) + "U" + ""; + if (carbsAfterConstraints > 0) + confirmMessage += "
" + MainApp.gs(R.string.carbs) + ": " + "" + carbsAfterConstraints + "g" + ""; if (insulinAfterConstraints - calculatedTotalInsulin != 0 || !carbsAfterConstraints.equals(calculatedCarbs)) { AlertDialog.Builder builder = new AlertDialog.Builder(context); diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 954184de6a..0e0fdb6c02 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -3,8 +3,9 @@ #ff00ff #00ffff #1e88e5 - #FFFFCC03 + #1ea3e5 #FFFB8C00 + #FFFB8C00 #ffea00 #00ffff #FFFFFF @@ -22,6 +23,7 @@ #C803A9F4 #757575 #d8d8d8 + #ff1a1a #424242 From ef70c1f24464b110a40e84b375c6ba49d5221405 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Sun, 6 May 2018 11:47:15 +0200 Subject: [PATCH 2/3] MainApp.sResources.getColor -> MainApp.gc. --- .../androidaps/HistoryBrowseActivity.java | 4 +-- .../nightscout/androidaps/db/BgReading.java | 16 +++++----- .../androidaps/db/CareportalEvent.java | 2 +- .../plugins/Actions/dialogs/FillDialog.java | 6 ++-- .../Careportal/CareportalFragment.java | 4 +-- .../ConfigBuilder/ConfigBuilderFragment.java | 2 +- .../Overview/Dialogs/NewInsulinDialog.java | 2 +- .../plugins/Overview/OverviewFragment.java | 30 +++++++++---------- .../plugins/PumpDanaR/DanaRFragment.java | 2 +- .../plugins/Treatments/Treatment.java | 2 +- .../Treatments/TreatmentsFragment.java | 14 ++++----- .../androidaps/tabs/SlidingTabStrip.java | 2 +- 12 files changed, 43 insertions(+), 43 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/HistoryBrowseActivity.java b/app/src/main/java/info/nightscout/androidaps/HistoryBrowseActivity.java index cf3d1fc34c..c308cd2efe 100644 --- a/app/src/main/java/info/nightscout/androidaps/HistoryBrowseActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/HistoryBrowseActivity.java @@ -80,9 +80,9 @@ public class HistoryBrowseActivity extends AppCompatActivity { ButterKnife.bind(this); - bgGraph.getGridLabelRenderer().setGridColor(MainApp.sResources.getColor(R.color.graphgrid)); + bgGraph.getGridLabelRenderer().setGridColor(MainApp.gc(R.color.graphgrid)); bgGraph.getGridLabelRenderer().reloadStyles(); - iobGraph.getGridLabelRenderer().setGridColor(MainApp.sResources.getColor(R.color.graphgrid)); + iobGraph.getGridLabelRenderer().setGridColor(MainApp.gc(R.color.graphgrid)); iobGraph.getGridLabelRenderer().reloadStyles(); iobGraph.getGridLabelRenderer().setHorizontalLabelsVisible(false); bgGraph.getGridLabelRenderer().setLabelVerticalWidth(50); diff --git a/app/src/main/java/info/nightscout/androidaps/db/BgReading.java b/app/src/main/java/info/nightscout/androidaps/db/BgReading.java index ef0277d170..5ddb7a80b2 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/BgReading.java +++ b/app/src/main/java/info/nightscout/androidaps/db/BgReading.java @@ -211,27 +211,27 @@ public class BgReading implements DataPointWithLabelInterface { if (highLine < 1) { highLine = Profile.fromMgdlToUnits(OverviewPlugin.bgTargetHigh, units); } - int color = MainApp.sResources.getColor(R.color.inrange); + int color = MainApp.gc(R.color.inrange); if (isPrediction()) return getPredectionColor(); else if (valueToUnits(units) < lowLine) - color = MainApp.sResources.getColor(R.color.low); + color = MainApp.gc(R.color.low); else if (valueToUnits(units) > highLine) - color = MainApp.sResources.getColor(R.color.high); + color = MainApp.gc(R.color.high); return color; } public int getPredectionColor() { if (isIOBPrediction) - return MainApp.sResources.getColor(R.color.iob); + return MainApp.gc(R.color.iob); if (isCOBPrediction) - return MainApp.sResources.getColor(R.color.cob); + return MainApp.gc(R.color.cob); if (isaCOBPrediction) - return 0x80FFFFFF & MainApp.sResources.getColor(R.color.cob); + return 0x80FFFFFF & MainApp.gc(R.color.cob); if (isUAMPrediction) - return MainApp.sResources.getColor(R.color.uam); + return MainApp.gc(R.color.uam); if (isZTPrediction) - return MainApp.sResources.getColor(R.color.zt); + return MainApp.gc(R.color.zt); return R.color.mdtp_white; } diff --git a/app/src/main/java/info/nightscout/androidaps/db/CareportalEvent.java b/app/src/main/java/info/nightscout/androidaps/db/CareportalEvent.java index 755005cdae..d5a1c90100 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/CareportalEvent.java +++ b/app/src/main/java/info/nightscout/androidaps/db/CareportalEvent.java @@ -251,7 +251,7 @@ public class CareportalEvent implements DataPointWithLabelInterface { @Override public int getColor() { if (eventType.equals(ANNOUNCEMENT)) - return MainApp.sResources.getColor(R.color.notificationAnnouncement); + return MainApp.gc(R.color.notificationAnnouncement); if (eventType.equals(MBG)) return Color.RED; if (eventType.equals(BGCHECK)) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Actions/dialogs/FillDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Actions/dialogs/FillDialog.java index 828c7dbcc9..dda2e61006 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Actions/dialogs/FillDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Actions/dialogs/FillDialog.java @@ -175,14 +175,14 @@ public class FillDialog extends DialogFragment implements OnClickListener { confirmMessage.add(""); confirmMessage.add(MainApp.gs(R.string.bolus) + ": " + "" + insulinAfterConstraints + "U" + ""); if (!insulinAfterConstraints.equals(insulin)) - confirmMessage.add("" + MainApp.gs(R.string.bolusconstraintapplied) + ""); + confirmMessage.add("" + MainApp.gs(R.string.bolusconstraintapplied) + ""); } if (pumpSiteChangeCheckbox.isChecked()) - confirmMessage.add("" + "" + MainApp.gs(R.string.record_pump_site_change) + ""); + confirmMessage.add("" + "" + MainApp.gs(R.string.record_pump_site_change) + ""); if (insulinCartridgeChangeCheckbox.isChecked()) - confirmMessage.add("" + "" + MainApp.gs(R.string.record_insulin_cartridge_change) + ""); + confirmMessage.add("" + "" + MainApp.gs(R.string.record_insulin_cartridge_change) + ""); final String notes = notesEdit.getText().toString(); if (!notes.isEmpty()) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/CareportalFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/CareportalFragment.java index ac018e3101..4a4210f29e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/CareportalFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/CareportalFragment.java @@ -269,9 +269,9 @@ public class CareportalFragment extends SubscriberFragment implements View.OnCli public static int determineTextColor(CareportalEvent careportalEvent, double warnThreshold, double urgentThreshold) { if (careportalEvent.isOlderThan(urgentThreshold)) { - return MainApp.sResources.getColor(R.color.low); + return MainApp.gc(R.color.low); } else if (careportalEvent.isOlderThan(warnThreshold)) { - return MainApp.sResources.getColor(R.color.high); + return MainApp.gc(R.color.high); } else { return Color.WHITE; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java index 829a0fa4ad..70b5eb466b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java @@ -330,7 +330,7 @@ public class ConfigBuilderFragment extends SubscriberFragment { } if (plugin.isEnabled(type)) { - view.setBackgroundColor(MainApp.sResources.getColor(R.color.configBuilderSelectedBackground)); + view.setBackgroundColor(MainApp.gc(R.color.configBuilderSelectedBackground)); } return view; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewInsulinDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewInsulinDialog.java index 0ac2fe06ef..875d207352 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewInsulinDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewInsulinDialog.java @@ -208,7 +208,7 @@ public class NewInsulinDialog extends DialogFragment implements OnClickListener } if (!insulinAfterConstraints.equals(insulin)) - actions.add("" + MainApp.gs(R.string.bolusconstraintapplied) + ""); + actions.add("" + MainApp.gs(R.string.bolusconstraintapplied) + ""); int eatingSoonTTDuration = SP.getInt(R.string.key_eatingsoon_duration, Constants.defaultEatingSoonTTDuration); eatingSoonTTDuration = eatingSoonTTDuration > 0 ? eatingSoonTTDuration : Constants.defaultEatingSoonTTDuration; 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 3d0970f8f4..f43a78d64f 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 @@ -240,7 +240,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, loopStatusLayout = (LinearLayout) view.findViewById(R.id.overview_looplayout); pumpStatusLayout = (LinearLayout) view.findViewById(R.id.overview_pumpstatuslayout); - pumpStatusView.setBackgroundColor(MainApp.sResources.getColor(R.color.colorInitializingBorder)); + pumpStatusView.setBackgroundColor(MainApp.gc(R.color.colorInitializingBorder)); iobView = (TextView) view.findViewById(R.id.overview_iob); cobView = (TextView) view.findViewById(R.id.overview_cob); @@ -300,9 +300,9 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, else axisWidth = 80; - bgGraph.getGridLabelRenderer().setGridColor(MainApp.sResources.getColor(R.color.graphgrid)); + bgGraph.getGridLabelRenderer().setGridColor(MainApp.gc(R.color.graphgrid)); bgGraph.getGridLabelRenderer().reloadStyles(); - iobGraph.getGridLabelRenderer().setGridColor(MainApp.sResources.getColor(R.color.graphgrid)); + iobGraph.getGridLabelRenderer().setGridColor(MainApp.gc(R.color.graphgrid)); iobGraph.getGridLabelRenderer().reloadStyles(); iobGraph.getGridLabelRenderer().setHorizontalLabelsVisible(false); bgGraph.getGridLabelRenderer().setLabelVerticalWidth(axisWidth); @@ -1006,11 +1006,11 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, //Start with updating the BG as it is unaffected by loop. // **** BG value **** if (lastBG != null) { - int color = MainApp.sResources.getColor(R.color.inrange); + int color = MainApp.gc(R.color.inrange); if (lastBG.valueToUnits(units) < lowLine) - color = MainApp.sResources.getColor(R.color.low); + color = MainApp.gc(R.color.low); else if (lastBG.valueToUnits(units) > highLine) - color = MainApp.sResources.getColor(R.color.high); + color = MainApp.gc(R.color.high); bgView.setText(lastBG.valueToUnitsToString(units)); arrowView.setText(lastBG.directionToSymbol()); bgView.setTextColor(color); @@ -1034,23 +1034,23 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, final LoopPlugin.LastRun finalLastRun = LoopPlugin.lastRun; if (Config.APS && pump.getPumpDescription().isTempBasalCapable) { apsModeView.setVisibility(View.VISIBLE); - apsModeView.setBackgroundColor(MainApp.sResources.getColor(R.color.loopenabled)); + apsModeView.setBackgroundColor(MainApp.gc(R.color.loopenabled)); apsModeView.setTextColor(Color.BLACK); final LoopPlugin loopPlugin = LoopPlugin.getPlugin(); if (loopPlugin.isEnabled(PluginType.LOOP) && loopPlugin.isSuperBolus()) { - apsModeView.setBackgroundColor(MainApp.sResources.getColor(R.color.looppumpsuspended)); + apsModeView.setBackgroundColor(MainApp.gc(R.color.looppumpsuspended)); apsModeView.setText(String.format(MainApp.gs(R.string.loopsuperbolusfor), loopPlugin.minutesToEndOfSuspend())); apsModeView.setTextColor(Color.WHITE); } else if (loopPlugin.isEnabled(PluginType.LOOP) && loopPlugin.isDisconnected()) { - apsModeView.setBackgroundColor(MainApp.sResources.getColor(R.color.looppumpsuspended)); + apsModeView.setBackgroundColor(MainApp.gc(R.color.looppumpsuspended)); apsModeView.setText(String.format(MainApp.gs(R.string.loopdisconnectedfor), loopPlugin.minutesToEndOfSuspend())); apsModeView.setTextColor(Color.WHITE); } else if (loopPlugin.isEnabled(PluginType.LOOP) && loopPlugin.isSuspended()) { - apsModeView.setBackgroundColor(MainApp.sResources.getColor(R.color.looppumpsuspended)); + apsModeView.setBackgroundColor(MainApp.gc(R.color.looppumpsuspended)); apsModeView.setText(String.format(MainApp.gs(R.string.loopsuspendedfor), loopPlugin.minutesToEndOfSuspend())); apsModeView.setTextColor(Color.WHITE); } else if (pump.isSuspended()) { - apsModeView.setBackgroundColor(MainApp.sResources.getColor(R.color.looppumpsuspended)); + apsModeView.setBackgroundColor(MainApp.gc(R.color.looppumpsuspended)); apsModeView.setText(MainApp.gs(R.string.pumpsuspended)); apsModeView.setTextColor(Color.WHITE); } else if (loopPlugin.isEnabled(PluginType.LOOP)) { @@ -1060,7 +1060,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, apsModeView.setText(MainApp.gs(R.string.openloop)); } } else { - apsModeView.setBackgroundColor(MainApp.sResources.getColor(R.color.loopdisabled)); + apsModeView.setBackgroundColor(MainApp.gc(R.color.loopdisabled)); apsModeView.setText(MainApp.gs(R.string.disabledloop)); apsModeView.setTextColor(Color.WHITE); } @@ -1072,12 +1072,12 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, TempTarget tempTarget = TreatmentsPlugin.getPlugin().getTempTargetFromHistory(); if (tempTarget != null) { tempTargetView.setTextColor(Color.BLACK); - tempTargetView.setBackgroundColor(MainApp.sResources.getColor(R.color.tempTargetBackground)); + tempTargetView.setBackgroundColor(MainApp.gc(R.color.tempTargetBackground)); tempTargetView.setVisibility(View.VISIBLE); tempTargetView.setText(Profile.toTargetRangeString(tempTarget.low, tempTarget.high, Constants.MGDL, units) + " " + DateUtil.untilString(tempTarget.end())); } else { tempTargetView.setTextColor(Color.WHITE); - tempTargetView.setBackgroundColor(MainApp.sResources.getColor(R.color.tempTargetDisabledBackground)); + tempTargetView.setBackgroundColor(MainApp.gc(R.color.tempTargetDisabledBackground)); tempTargetView.setText(Profile.toTargetRangeString(profile.getTargetLow(), profile.getTargetHigh(), units, units)); tempTargetView.setVisibility(View.VISIBLE); } @@ -1148,7 +1148,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, } } if (activeTemp != null) { - baseBasalView.setTextColor(MainApp.sResources.getColor(R.color.basal)); + baseBasalView.setTextColor(MainApp.gc(R.color.basal)); } else { baseBasalView.setTextColor(Color.WHITE); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRFragment.java index b8afdaf15a..b11cd87278 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRFragment.java @@ -111,7 +111,7 @@ public class DanaRFragment extends SubscriberFragment { View view = inflater.inflate(R.layout.danar_fragment, container, false); unbinder = ButterKnife.bind(this, view); - pumpStatusView.setBackgroundColor(MainApp.sResources.getColor(R.color.colorInitializingBorder)); + pumpStatusView.setBackgroundColor(MainApp.gc(R.color.colorInitializingBorder)); return view; } catch (Exception e) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/Treatment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/Treatment.java index 1983c38242..997a55b5a4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/Treatment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/Treatment.java @@ -186,7 +186,7 @@ public class Treatment implements DataPointWithLabelInterface { @Override public int getColor() { if (isSMB) - return MainApp.sResources.getColor(R.color.tempbasal); + return MainApp.gc(R.color.tempbasal); else if (isValid) return Color.CYAN; else diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsFragment.java index fe79f8555b..ea75dfad6a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsFragment.java @@ -107,13 +107,13 @@ public class TreatmentsFragment extends SubscriberFragment implements View.OnCli } private void setBackgroundColorOnSelected(TextView selected) { - treatmentsTab.setBackgroundColor(MainApp.sResources.getColor(R.color.defaultbackground)); - extendedBolusesTab.setBackgroundColor(MainApp.sResources.getColor(R.color.defaultbackground)); - tempBasalsTab.setBackgroundColor(MainApp.sResources.getColor(R.color.defaultbackground)); - tempTargetTab.setBackgroundColor(MainApp.sResources.getColor(R.color.defaultbackground)); - profileSwitchTab.setBackgroundColor(MainApp.sResources.getColor(R.color.defaultbackground)); - careportalTab.setBackgroundColor(MainApp.sResources.getColor(R.color.defaultbackground)); - selected.setBackgroundColor(MainApp.sResources.getColor(R.color.tabBgColorSelected)); + treatmentsTab.setBackgroundColor(MainApp.gc(R.color.defaultbackground)); + extendedBolusesTab.setBackgroundColor(MainApp.gc(R.color.defaultbackground)); + tempBasalsTab.setBackgroundColor(MainApp.gc(R.color.defaultbackground)); + tempTargetTab.setBackgroundColor(MainApp.gc(R.color.defaultbackground)); + profileSwitchTab.setBackgroundColor(MainApp.gc(R.color.defaultbackground)); + careportalTab.setBackgroundColor(MainApp.gc(R.color.defaultbackground)); + selected.setBackgroundColor(MainApp.gc(R.color.tabBgColorSelected)); } @Subscribe diff --git a/app/src/main/java/info/nightscout/androidaps/tabs/SlidingTabStrip.java b/app/src/main/java/info/nightscout/androidaps/tabs/SlidingTabStrip.java index 587850f678..6c8e034477 100644 --- a/app/src/main/java/info/nightscout/androidaps/tabs/SlidingTabStrip.java +++ b/app/src/main/java/info/nightscout/androidaps/tabs/SlidingTabStrip.java @@ -62,7 +62,7 @@ class SlidingTabStrip extends LinearLayout { DEFAULT_BOTTOM_BORDER_COLOR_ALPHA); mDefaultTabColorizer = new SimpleTabColorizer(); - mDefaultTabColorizer.setIndicatorColors(MainApp.sResources.getColor(R.color.tabBgColorSelected)); + mDefaultTabColorizer.setIndicatorColors(MainApp.gc(R.color.tabBgColorSelected)); mBottomBorderThickness = (int) (DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS * density); mBottomBorderPaint = new Paint(); From 56cbac3b4d93924a1d54530af38d4f7dab150ece Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Sun, 6 May 2018 11:49:16 +0200 Subject: [PATCH 3/3] Leftover MainApp.gs rewrite. --- .../nightscout/androidaps/plugins/Insulin/InsulinFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinFragment.java index a171d646e9..a524a5b318 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinFragment.java @@ -52,7 +52,7 @@ public class InsulinFragment extends Fragment { private void updateGUI() { insulinName.setText(ConfigBuilderPlugin.getActiveInsulin().getFriendlyName()); insulinComment.setText(ConfigBuilderPlugin.getActiveInsulin().getComment()); - insulinDia.setText(MainApp.sResources.getText(R.string.dia) + " " + Double.toString(ConfigBuilderPlugin.getActiveInsulin().getDia()) + "h"); + insulinDia.setText(MainApp.gs(R.string.dia) + " " + Double.toString(ConfigBuilderPlugin.getActiveInsulin().getDia()) + "h"); insulinGraph.show(ConfigBuilderPlugin.getActiveInsulin()); }