Java Code Examples for android.view.GestureDetector#OnGestureListener
The following examples show how to use
android.view.GestureDetector#OnGestureListener .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CameraAppUI.java From Camera2 with Apache License 2.0 | 6 votes |
/** * When the PreviewStatusListener changes, listeners need to be * set on the following app ui elements: * {@link com.android.camera.ui.PreviewOverlay}, * {@link com.android.camera.ui.BottomBar}, * {@link com.android.camera.ui.IndicatorIconController}. */ private void onPreviewListenerChanged() { // Set a listener for recognizing preview gestures. GestureDetector.OnGestureListener gestureListener = mPreviewStatusListener.getGestureListener(); if (gestureListener != null) { mPreviewOverlay.setGestureListener(gestureListener); } View.OnTouchListener touchListener = mPreviewStatusListener.getTouchListener(); if (touchListener != null) { mPreviewOverlay.setTouchListener(touchListener); } mTextureViewHelper.setAutoAdjustTransform( mPreviewStatusListener.shouldAutoAdjustTransformMatrixOnLayout()); }
Example 2
Source File: TouchImageView.java From touch-image-view with MIT License | 6 votes |
@Override protected GestureDetector.OnGestureListener getGestureListener() { return new ImageViewTouch.GestureListener() { @Override public boolean onDoubleTap(MotionEvent e) { mUserScaled = true; float scale = getScale(); float targetScale = onDoubleTapPost(scale, getMaxScale(), getMinScale()); targetScale = Math.min(getMaxScale(), Math.max(targetScale, getMinScale())); zoomTo(targetScale, e.getX(), e.getY(), (long) mDefaultAnimationDuration); if (null != mDoubleTapListener) { mDoubleTapListener.onDoubleTap(); } return false; } }; }
Example 3
Source File: PreviewOverlay.java From Camera2 with Apache License 2.0 | 5 votes |
/** * Each module can pass in their own gesture listener through App UI. When a gesture * is detected, the {@link GestureDetector.OnGestureListener} will be notified of * the gesture. * * @param gestureListener a listener from a module that defines how to handle gestures */ public void setGestureListener(GestureDetector.OnGestureListener gestureListener) { if (gestureListener != null) { mGestureDetector = new GestureDetector(getContext(), gestureListener); } }
Example 4
Source File: CaptureIntentModule.java From Camera2 with Apache License 2.0 | 5 votes |
@Override public GestureDetector.OnGestureListener getGestureListener() { return new GestureDetector.SimpleOnGestureListener() { @Override public boolean onSingleTapUp(MotionEvent ev) { final Point tapPoint = new Point((int) ev.getX(), (int) ev.getY()); mStateMachine.processEvent(new EventTapOnPreview(tapPoint)); return true; } }; }
Example 5
Source File: ZGestrueDetector.java From zone-sdk with MIT License | 5 votes |
@TargetApi(Build.VERSION_CODES.KITKAT) private ZGestrueDetector(Context context, OnRotationGestureListener rotationListener, OnScaleGestureListener scaleListener, GestureDetector.OnGestureListener moveListener) { this.context = context; this.rotationListener = rotationListener; this.scaleListener = scaleListener; this.moveListener = moveListener; if (moveListener!=null) moveGesture =new GestureDetectorCompat(context,zMoveListener); if (moveListener!=null) scaleGesture =new ScaleGestureDetector(context,zScaleListener); if (rotationListener!=null) ratotionGesture =new RotationGestureDetector(zRotationListener); }
Example 6
Source File: PhotoUI.java From Camera2 with Apache License 2.0 | 4 votes |
@Override public GestureDetector.OnGestureListener getGestureListener() { return mPreviewGestureListener; }
Example 7
Source File: VideoUI.java From Camera2 with Apache License 2.0 | 4 votes |
@Override public GestureDetector.OnGestureListener getGestureListener() { return mPreviewGestureListener; }
Example 8
Source File: DefaultMediaController.java From GiraffePlayer2 with Apache License 2.0 | 4 votes |
protected GestureDetector.OnGestureListener createGestureListener() { return new PlayerGestureListener(); }
Example 9
Source File: FlickableImageView.java From FlickableView with Apache License 2.0 | 4 votes |
protected GestureDetector.OnGestureListener getGestureListener() { return new GestureListener(); }
Example 10
Source File: PreviewStatusListener.java From Camera2 with Apache License 2.0 | 2 votes |
/** * The preview status listener needs to provide an * {@link android.view.GestureDetector.OnGestureListener} in order to listen * to the touch events that happen on preview. * * @return a listener that listens to touch events */ public GestureDetector.OnGestureListener getGestureListener();
Example 11
Source File: EmulatorView.java From Ansole with GNU General Public License v2.0 | 2 votes |
/** * Set a {@link android.view.GestureDetector.OnGestureListener * GestureDetector.OnGestureListener} to receive gestures performed on this * view. Can be used to implement additional * functionality via touch gestures or override built-in gestures. * * @param listener The {@link * android.view.GestureDetector.OnGestureListener * GestureDetector.OnGestureListener} which will receive * gestures. */ public void setExtGestureListener(GestureDetector.OnGestureListener listener) { mExtGestureListener = listener; }