File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
cameraview/src/main/java/com/otaliastudios/cameraview Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -658,9 +658,12 @@ public boolean onTouchEvent(MotionEvent event) {
658658 // Pass to our own GestureLayouts
659659 CameraOptions options = mCameraEngine .getCameraOptions (); // Non null
660660 if (options == null ) throw new IllegalStateException ("Options should not be null here." );
661+
662+ boolean ongoingPinchEvent = false ;
661663 if (mPinchGestureFinder .onTouchEvent (event )) {
662664 LOG .i ("onTouchEvent" , "pinch!" );
663665 onGesture (mPinchGestureFinder , options );
666+ ongoingPinchEvent = true ;
664667 } else if (mScrollGestureFinder .onTouchEvent (event )) {
665668 LOG .i ("onTouchEvent" , "scroll!" );
666669 onGesture (mScrollGestureFinder , options );
@@ -669,8 +672,8 @@ public boolean onTouchEvent(MotionEvent event) {
669672 onGesture (mTapGestureFinder , options );
670673 }
671674
672- // Only detect swipes for single-finger gestures
673- if (event .getPointerCount () == 1 ) {
675+ // Only detect swipes for single-finger gestures that haven't been handled by pinch gesture finder
676+ if (! ongoingPinchEvent && event .getPointerCount () == 1 ) {
674677 if (event .getAction () == MotionEvent .ACTION_DOWN ) x1 = event .getX ();
675678 if (event .getAction () == MotionEvent .ACTION_UP ) {
676679 x2 = event .getX ();
You can’t perform that action at this time.
0 commit comments