Cockpit watch face: Double-tap opens MainMenuActivity

This commit is contained in:
Andrew Warrington 2018-01-05 11:58:57 +01:00
parent aff0e6f5a8
commit 02e7752c3e

View file

@ -27,14 +27,7 @@ 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 (tapType == TAP_TYPE_TAP ) {
if (eventTime - sgvTapTime < 800) {
Intent intent = new Intent(this, MainMenuActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
@ -43,7 +36,6 @@ public class Cockpit extends BaseWatchFace {
sgvTapTime = eventTime;
}
}
}
@Override
protected WatchFaceStyle getWatchFaceStyle() {