Gesture getLength - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Gesture getLength method.

This code example shows how to use the following methods:getBoundingBox, getLength
        } 
 
        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:getLength
        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) {
        } 
    } 
} 
6
CodeRank
This code example shows how to use the following methods:getLength
        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>();
        shortcutNames.add(getString(R.string.group_applications));
4
CodeRank
This code example shows how to use the following methods:getLength
This code example shows how to use the following methods:getLength
        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>();
        shortcutNames.add(getString(R.string.group_applications));
4
CodeRank
This code example shows how to use the following methods:getLength
        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
getLength Method Overview
Calculates the total length of the gesture.
See Code Examples for other Android Gesture Methods: