Google Glass: Select Undo or OK in the dialog box.

How can I switch from the parameters of the system dialog , for example, using Google Glass XE16?

enter image description here

With XE12, I managed to switch from options by scrolling forward and backward. but after upgrading to XE16 it no longer works.

I can only select the first option that is focused (in this case, Cancel).

UPDATE: XE17 - same question

+4
source share
1 answer

, , GDK , - Android, , , .. -GDK UI:

  • GestureDetector mGestureDetector;
  • mGestureDetector = createGestureDetector(this); onCreate;
  • :

private GestureDetector createGestureDetector(Context context) {
    GestureDetector gestureDetector = new GestureDetector(context);

    gestureDetector.setBaseListener( new GestureDetector.BaseListener() {
        @Override
        public boolean onGesture(Gesture gesture) {
            if (gesture == Gesture.TAP) { 
                process(mListView.getSelectedItem());
                return true;
            } else if (gesture == Gesture.SWIPE_RIGHT) {
                mListView.setSelection(mListView.getSelectedItemPosition()+1);
                return true;
            } else if (gesture == Gesture.SWIPE_LEFT) {
                mListView.setSelection(mListView.getSelectedItemPosition()-1);
                return true;
            }
            return false;
        }
    });

    return gestureDetector;
}

// this method is required for tap on touchpad to work!
public boolean onGenericMotionEvent(MotionEvent event) {
    if (mGestureDetector != null) {
        return mGestureDetector.onMotionEvent(event);
    }
    return false;
}           

https://github.com/xjefftang/launchy/commit/66f17bd5bf920800ce277df5eeb6ea912b877692

+2

Source: https://habr.com/ru/post/1538034/


All Articles