Android GestureOverlayView - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android GestureOverlayView class.

This code example shows how to use the following methods:clear, getGesture
 
        public void onGesture(GestureOverlayView overlay, MotionEvent event) {
        } 
 
        public void onGestureEnded(GestureOverlayView overlay, MotionEvent event) {
            mGesture = overlay.getGesture();
            if (mGesture.getLength() < LENGTH_THRESHOLD) {
                overlay.clear(false);
            } 
            mDoneButton.setEnabled(true);
        } 
 
        public void onGestureCancelled(GestureOverlayView overlay, MotionEvent event) {
        } 
    } 
} 
7
CodeRank
This code example shows how to use the following methods:clear, getGesture
 
        public void onGesture(GestureOverlayView overlay, MotionEvent event) {
        } 
 
        public void onGestureEnded(GestureOverlayView overlay, MotionEvent event) {
            mGesture = overlay.getGesture();
            //Ignore short strokes and horizontal swipes (for compatibility with playback controls) 
            if (mGesture.getLength() < THRESHOLD ||
                    mGesture.getBoundingBox().height() < THRESHOLD) {
                overlay.clear(false);
            } else { 
                mDoneButton.setEnabled(true);
            } 
        } 
 
        public void onGestureCancelled(GestureOverlayView overlay, MotionEvent event) {
        } 
    } 
} 
6
CodeRank
This code example shows how to use the following methods:addOnGesturePerformedListener, setGestureStrokeAngleThreshold, setGestureStrokeSquarenessTreshold, setGestureStrokeType
    super.onCreate(savedInstanceState);
 
    note = new Note();
    MoonRunes.notes.add(note);
 
    GestureOverlayView it = new GestureOverlayView(this);
    it.addOnGesturePerformedListener(this);
 
    // be really lenient in what strokes to accept 
    it.setGestureStrokeType(GestureOverlayView.GESTURE_STROKE_TYPE_MULTIPLE);
    it.setGestureStrokeAngleThreshold(1);
    it.setGestureStrokeSquarenessTreshold(0);
    this.setContentView(it);
  } 
 
  // every stroke is normalized to this 
  private final RectF normalized = new RectF(0, 0, 1, 1);
 
  @Override 
  public void onGesturePerformed(GestureOverlayView view, Gesture gesture) {
6
CodeRank
This code example shows how to use the following methods:post
    private void paintGesture(final GestureOverlayView overlay, final Gesture gesture) {
 
        if (gesture == null)
            return; 
 
        overlay.post(new Runnable() {
            public void run() { 
                overlay.setGesture(gesture);
            } 
        }); 
    } 
 
    private void processActivityIntent(Bundle bundle) {
        if (bundle != null) {
            final int displayType = bundle.getInt(KEY_DISPLAY_TYPE, DISPLAY_TYPE_NEW_TEMPLATE);
 
            if (displayType == DISPLAY_TYPE_EDIT_TEMPLATE) {
                editingMode = true;
 
                mCurrentTemplateEditingId = bundle.getLong(KEY_TEMPLATE_ID, Long.MIN_VALUE);
6
CodeRank
This code example shows how to use the following methods:setEnabled
                    } 
                } 
            } 
        } 
        // ジェスチャー受け付けを無効にする 
        overlay.setEnabled(false);
    } 
} 
5
CodeRank
This code example shows how to use the following methods:clear, getGesture
 
        public void onGesture(GestureOverlayView overlay, MotionEvent event) {
        } 
 
        public void onGestureEnded(GestureOverlayView overlay, MotionEvent event) {
            mGesture = overlay.getGesture();
            if (mGesture.getLength() < LENGTH_THRESHOLD) {
                overlay.clear(false);
            } 
            mDoneButton.setEnabled(true);
        } 
 
        public void onGestureCancelled(GestureOverlayView overlay, MotionEvent event) {
        } 
    } 
 
    public void pickShortcut(View v) {
        Bundle bundle = new Bundle();
 
        ArrayList<String> shortcutNames = new ArrayList<String>();
5
CodeRank
This code example shows how to use the following methods:clear, getGesture
This code example shows how to use the following methods:clear, getGesture
 
        public void onGesture(GestureOverlayView overlay, MotionEvent event) {
        } 
 
        public void onGestureEnded(GestureOverlayView overlay, MotionEvent event) {
            mGesture = overlay.getGesture();
            if (mGesture.getLength() < LENGTH_THRESHOLD) {
                overlay.clear(false);
            } 
            mDoneButton.setEnabled(true);
        } 
 
        public void onGestureCancelled(GestureOverlayView overlay, MotionEvent event) {
        } 
    } 
 
    public void pickShortcut(View v) {
        Bundle bundle = new Bundle();
 
        ArrayList<String> shortcutNames = new ArrayList<String>();
4
CodeRank
This code example shows how to use the following methods:clear, getGesture
 
        public void onGesture(GestureOverlayView overlay, MotionEvent event) {
        } 
 
        public void onGestureEnded(GestureOverlayView overlay, MotionEvent event) {
            mGesture = overlay.getGesture();
            if (mGesture.getLength() < LENGTH_THRESHOLD) {
                overlay.clear(false);
            } 
            mDoneButton.setEnabled(true);
        } 
 
        public void onGestureCancelled(GestureOverlayView overlay, MotionEvent event) {
        } 
    } 
} 
4
CodeRank
This code example shows how to use the following methods:clear, getGesture
 
        public void onGesture(GestureOverlayView overlay, MotionEvent event) {
        } 
 
        public void onGestureEnded(GestureOverlayView overlay, MotionEvent event) {
            mGesture = overlay.getGesture();
            //Ignore short strokes and horizontal swipes (for compatibility with playback controls) 
            if (mGesture.getLength() < THRESHOLD ||
                    mGesture.getBoundingBox().height() < THRESHOLD) {
                overlay.clear(false);
            } else { 
                mDoneButton.setEnabled(true);
            } 
        } 
 
        public void onGestureCancelled(GestureOverlayView overlay, MotionEvent event) {
        } 
    } 
} 
4
CodeRank

Related Android GestureOverlayView Questions & Answers:

Other Android GestureOverlayView Examples

20:	  public void onCreate(Bundle savedInstanceState) {
21:	    super.onCreate(savedInstanceState);
22:	    GestureOverlayView gestureOverlayView = new GestureOverlayView(this);
23:	    View inflate = getLayoutInflater().inflate(R.layout.main, null);
24:	    gestureOverlayView.addView(inflate);
-
20:	  public void onCreate(Bundle savedInstanceState) {
21:	    super.onCreate(savedInstanceState);
22:	    GestureOverlayView gestureOverlayView = new GestureOverlayView(this);
23:	    View inflate = getLayoutInflater().inflate(R.layout.main, null);
24:	    gestureOverlayView.addView(inflate);
-
32:	
33:	  @Override
34:	  public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
35:	    ArrayList<Prediction> predictions = gestureLib.recognize(gesture);
36:	    for (Prediction prediction : predictions) {

Read More