diff --git a/app/src/main/java/info/nightscout/androidaps/Services/DataService.java b/app/src/main/java/info/nightscout/androidaps/Services/DataService.java index 9f3873cb93..ca7d760cc4 100644 --- a/app/src/main/java/info/nightscout/androidaps/Services/DataService.java +++ b/app/src/main/java/info/nightscout/androidaps/Services/DataService.java @@ -289,7 +289,7 @@ public class DataService extends IntentService { bgReading.direction = json.getString("direction"); bgReading.date = json.getLong("date"); bgReading.raw = json.getDouble("raw"); - if (JsonHelper.safeGetString(json, "utils", Constants.MGDL).equals("mmol/L")) + if (JsonHelper.safeGetString(json, "units", Constants.MGDL).equals("mmol/L")) bgReading.value = bgReading.value * Constants.MMOLL_TO_MGDL; boolean isNew = MainApp.getDbHelper().createIfNotExists(bgReading, "Poctech"); if (isNew && SP.getBoolean(R.string.key_dexcomg5_nsupload, false)) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsObjectives/objectives/Objective4.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsObjectives/objectives/Objective4.java index 7700c94cb6..36a98babc1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsObjectives/objectives/Objective4.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsObjectives/objectives/Objective4.java @@ -9,7 +9,7 @@ import info.nightscout.androidaps.plugins.ConstraintsSafety.SafetyPlugin; public class Objective4 extends Objective { public Objective4() { - super(3, R.string.objectives_3_objective, R.string.objectives_4_gate); + super(3, R.string.objectives_3_objective, R.string.objectives_3_gate); } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsObjectives/objectives/Objective8.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsObjectives/objectives/Objective8.java index 70d75fd900..376d5fb7a2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsObjectives/objectives/Objective8.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsObjectives/objectives/Objective8.java @@ -7,7 +7,7 @@ import info.nightscout.androidaps.R; public class Objective8 extends Objective { public Objective8() { - super(7, R.string.objectives_7_objective, 0); + super(7, R.string.objectives_7_objective, R.string.objectives_7_gate); } @Override 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 c8e087c525..422b2ec5ec 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 @@ -119,6 +119,7 @@ import info.nightscout.utils.OKDialog; import info.nightscout.utils.Profiler; import info.nightscout.utils.SP; import info.nightscout.utils.SingleClickButton; +import info.nightscout.utils.T; import info.nightscout.utils.ToastUtils; import static info.nightscout.utils.DateUtil.now; @@ -839,7 +840,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, if (wizard.superBolus) { final LoopPlugin loopPlugin = LoopPlugin.getPlugin(); if (loopPlugin.isEnabled(PluginType.LOOP)) { - loopPlugin.superBolusTo(System.currentTimeMillis() + 2 * 60L * 60 * 1000); + loopPlugin.superBolusTo(System.currentTimeMillis() + T.hours(2).msecs()); MainApp.bus().post(new EventRefreshOverview("WizardDialog")); } ConfigBuilderPlugin.getCommandQueue().tempBasalPercent(0, 120, true, profile, new Callback() { @@ -1426,12 +1427,12 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, predHours = Math.max(0, predHours); hoursToFetch = rangeToDisplay - predHours; toTime = calendar.getTimeInMillis() + 100000; // little bit more to avoid wrong rounding - Graphview specific - fromTime = toTime - hoursToFetch * 60 * 60 * 1000L; - endTime = toTime + predHours * 60 * 60 * 1000L; + fromTime = toTime - T.hours(hoursToFetch).msecs(); + endTime = toTime + T.hours(predHours).msecs(); } else { hoursToFetch = rangeToDisplay; toTime = calendar.getTimeInMillis() + 100000; // little bit more to avoid wrong rounding - Graphview specific - fromTime = toTime - hoursToFetch * 60 * 60 * 1000L; + fromTime = toTime - T.hours(hoursToFetch).msecs(); endTime = toTime; } diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.java b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.java index a8402dc1a5..c1669b73d0 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.java +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.java @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.List; import info.nightscout.androidaps.BuildConfig; +import info.nightscout.androidaps.Config; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.PreferencesActivity; import info.nightscout.androidaps.R; @@ -87,7 +88,7 @@ public class SWDefinition { } SWDefinition() { - if (BuildConfig.FLAVOR.equals("full")) + if (BuildConfig.FLAVOR.equals("full") || BuildConfig.FLAVOR.equals("pumpcontrol")) SWDefinitionFull(); else if (BuildConfig.FLAVOR.equals("nsclient")) SWDefinitionNSClient(); @@ -368,6 +369,7 @@ public class SWDefinition { }) .visibility(() -> MainApp.getConfigBuilder().getActiveAPS() != null && ((PluginBase) MainApp.getConfigBuilder().getActiveAPS()).getPreferencesId() > 0)) .validator(() -> MainApp.getConfigBuilder().getActiveAPS() != null) + .visibility(() -> Config.APS) ) .add(new SWScreen(R.string.configbuilder_loop) .skippable(false) @@ -386,7 +388,7 @@ public class SWDefinition { }) .visibility(() -> !LoopPlugin.getPlugin().isEnabled(PluginType.LOOP))) .validator(() -> LoopPlugin.getPlugin().isEnabled(PluginType.LOOP)) - .visibility(() -> !LoopPlugin.getPlugin().isEnabled(PluginType.LOOP)) + .visibility(() -> !LoopPlugin.getPlugin().isEnabled(PluginType.LOOP) && Config.APS) ) .add(new SWScreen(R.string.configbuilder_sensitivity) .skippable(false) @@ -428,18 +430,18 @@ public class SWDefinition { }) .visibility(() -> !ObjectivesPlugin.getPlugin().isFragmentVisible())) .validator(() -> ObjectivesPlugin.getPlugin().isEnabled(PluginType.CONSTRAINTS)) - .visibility(() -> !ObjectivesPlugin.getPlugin().isFragmentVisible()) + .visibility(() -> !ObjectivesPlugin.getPlugin().isFragmentVisible() && Config.APS) ) .add(new SWScreen(R.string.objectives) - .skippable(false) - .add(new SWInfotext() - .label(R.string.startobjective)) - .add(new SWBreak()) - .add(new SWFragment(this) - .add(new ObjectivesFragment())) - .validator(() -> ObjectivesPlugin.getPlugin().objectives.get(0).isStarted()) - .visibility(() -> !ObjectivesPlugin.getPlugin().objectives.get(0).isStarted()) - ) + .skippable(false) + .add(new SWInfotext() + .label(R.string.startobjective)) + .add(new SWBreak()) + .add(new SWFragment(this) + .add(new ObjectivesFragment())) + .validator(() -> ObjectivesPlugin.getPlugin().objectives.get(0).isStarted()) + .visibility(() -> !ObjectivesPlugin.getPlugin().objectives.get(0).isStarted() && Config.APS) + ) ; } diff --git a/app/src/main/java/info/nightscout/utils/DateUtil.java b/app/src/main/java/info/nightscout/utils/DateUtil.java index 7d7db3f5a7..c2164fd40e 100644 --- a/app/src/main/java/info/nightscout/utils/DateUtil.java +++ b/app/src/main/java/info/nightscout/utils/DateUtil.java @@ -179,5 +179,4 @@ public class DateUtil { public static long roundDateToSec(long date) { return date - date % 1000; } - } diff --git a/app/src/main/res/layout/activity_setupwizard.xml b/app/src/main/res/layout/activity_setupwizard.xml index 79dd6ed6f7..8510abd33f 100644 --- a/app/src/main/res/layout/activity_setupwizard.xml +++ b/app/src/main/res/layout/activity_setupwizard.xml @@ -74,7 +74,7 @@ android:layout_height="wrap_content" android:background="@android:color/transparent" android:onClick="showPreviousPage" - android:text="@string/setupwizard_previous" + android:text="@string/previous_button" android:textColor="#FFFFFF" />