mirror of
				https://github.com/SimpleMobileTools/Simple-Gallery.git
				synced 2025-06-05 21:59:19 +02:00 
			
		
		
		
	disable Down gesture if the video or gif are zoomed in
This commit is contained in:
		| @@ -61,7 +61,7 @@ android { | ||||
| } | ||||
|  | ||||
| dependencies { | ||||
|     implementation 'com.simplemobiletools:commons:5.7.3' | ||||
|     implementation 'com.simplemobiletools:commons:5.7.5' | ||||
|     implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' | ||||
|     implementation 'androidx.multidex:multidex:2.0.1' | ||||
|     implementation 'it.sephiroth.android.exif:library:1.0.1' | ||||
| @@ -74,7 +74,7 @@ dependencies { | ||||
|     implementation 'info.androidhive:imagefilters:1.0.7' | ||||
|     implementation 'com.squareup.picasso:picasso:2.71828' | ||||
|     implementation 'com.caverock:androidsvg-aar:1.3' | ||||
|     implementation 'com.github.tibbi:gestureviews:241d14fb68' | ||||
|     implementation 'com.github.tibbi:gestureviews:985ba285fb' | ||||
|     implementation 'com.github.tibbi:subsampling-scale-image-view:3ccd2f9c2b' | ||||
|     kapt 'com.github.bumptech.glide:compiler:4.8.0' // keep it here too, not just in Commons, else loading SVGs wont work | ||||
|  | ||||
|   | ||||
| @@ -519,7 +519,9 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen | ||||
|                 val diffY = mTouchDownY - event.y | ||||
|  | ||||
|                 val downGestureDuration = System.currentTimeMillis() - mTouchDownTime | ||||
|                 if (config.allowDownGesture && !mIgnoreCloseDown && Math.abs(diffY) > Math.abs(diffX) && diffY < -mCloseDownThreshold && downGestureDuration < MAX_CLOSE_DOWN_GESTURE_DURATION) { | ||||
|                 if (config.allowDownGesture && !mIgnoreCloseDown && Math.abs(diffY) > Math.abs(diffX) && diffY < -mCloseDownThreshold && | ||||
|                         downGestureDuration < MAX_CLOSE_DOWN_GESTURE_DURATION && | ||||
|                         video_surface_frame.controller.state.zoom == 1f) { | ||||
|                     supportFinishAfterTransition() | ||||
|                 } | ||||
|  | ||||
|   | ||||
| @@ -110,7 +110,9 @@ class PhotoFragment : ViewPagerFragment() { | ||||
|  | ||||
|             if (context.config.allowDownGesture) { | ||||
|                 gif_view.setOnTouchListener { v, event -> | ||||
|                     handleEvent(event) | ||||
|                     if (gif_view_frame.controller.state.zoom == 1f) { | ||||
|                         handleEvent(event) | ||||
|                     } | ||||
|                     false | ||||
|                 } | ||||
|  | ||||
|   | ||||
| @@ -116,7 +116,9 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S | ||||
|                 } | ||||
|  | ||||
|                 video_surface_frame.setOnTouchListener { view, event -> | ||||
|                     handleEvent(event) | ||||
|                     if (video_surface_frame.controller.state.zoom == 1f) { | ||||
|                         handleEvent(event) | ||||
|                     } | ||||
|                     false | ||||
|                 } | ||||
|             } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user