From 02e7752c3ec8a78d3dcf2a59a8b43285d58ce428 Mon Sep 17 00:00:00 2001 From: Andrew Warrington Date: Fri, 5 Jan 2018 11:58:57 +0100 Subject: [PATCH] Cockpit watch face: Double-tap opens MainMenuActivity --- .../androidaps/watchfaces/Cockpit.java | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Cockpit.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Cockpit.java index a275752cf9..b949e3832a 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Cockpit.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Cockpit.java @@ -27,21 +27,13 @@ public class Cockpit extends BaseWatchFace { @Override protected void onTapCommand(int tapType, int x, int y, long eventTime) { - if (mSgv != null) { - - int extra = (mSgv.getRight() - mSgv.getLeft()) / 2; - if (tapType == TAP_TYPE_TAP && - x + extra >= mSgv.getLeft() && - x - extra <= mSgv.getRight() && - y >= mSgv.getTop() && - y <= mSgv.getBottom()) { - if (eventTime - sgvTapTime < 800) { - Intent intent = new Intent(this, MainMenuActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - startActivity(intent); - } - sgvTapTime = eventTime; + if (tapType == TAP_TYPE_TAP ) { + if (eventTime - sgvTapTime < 800) { + Intent intent = new Intent(this, MainMenuActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(intent); } + sgvTapTime = eventTime; } }