From 8716f579783c5bc0e585cbe3a274151de33ddeaf Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Thu, 2 Aug 2018 21:40:44 +0200 Subject: [PATCH] timeshift can be negative on watch --- .../androidaps/interaction/actions/CPPActivity.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/CPPActivity.java b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/CPPActivity.java index f3ffb06bc0..fa5ee6f70a 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/CPPActivity.java +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/CPPActivity.java @@ -29,7 +29,7 @@ public class CPPActivity extends ViewSelectorActivity { PlusMinusEditText editTimeshift; int percentage = -1; - int timeshift = -1; + int timeshift = -25; @Override protected void onCreate(Bundle savedInstanceState) { @@ -39,10 +39,12 @@ public class CPPActivity extends ViewSelectorActivity { percentage = extras.getInt("percentage", -1); timeshift = extras.getInt("timeshift", -1); - if (percentage ==-1 || timeshift ==-1){ + if (percentage ==-1 || timeshift ==-25){ finish(); return; } + if(timeshift < 0) timeshift += 24; + setContentView(R.layout.grid_layout); final Resources res = getResources(); final GridViewPager pager = (GridViewPager) findViewById(R.id.pager); @@ -130,4 +132,4 @@ public class CPPActivity extends ViewSelectorActivity { } -} \ No newline at end of file +}