In Google Glass XE16 GestureDetector can detect several gestures like LONG_PRESS, SWIPE_DOWN, THREE_LONG_PRESS, TWO_SWIPE_DOWN , TWO_TAP & SOME OTHER GESTURES.
In glass TWO_SWIPE_DOWN is like shortcut option to cancel everything and go to black screen. After that black screen it comes "ok glass".
But I need to override the TWO_SWIPE_DOWN TAP so that user can not go outside the application in this way. I want to show the user specific message in the time of tapping TWO_SWIPE_DOWN.
I have code following GDK Touch Gestures like below :
gestureDetector.setBaseListener(new GestureDetector.BaseListener() {
@Override
public boolean onGesture(Gesture gesture) {
if (gesture == Gesture.TAP) {
return true;
} else if (gesture == Gesture.TWO_TAP) {
return true;
} else if (gesture == Gesture.SWIPE_RIGHT) {
return true;
} else if (gesture == Gesture.SWIPE_LEFT) {
return true;
} else if (gesture == Gesture.TWO_SWIPE_DOWN) {
Log.i("Checking the TAPPING of TWO_SWIPE_DOWN", "Its working fine.");
return true;
}
return true;
}
});
Above code able to catch every other tap without the TWO_SWIPE_DOWN TAP!
So how I will be able to catch the TWO_SWIPE_DOWN TAP?