disable Down gesture if the video or gif are zoomed in

This commit is contained in:
tibbi
2019-01-29 20:29:29 +01:00
parent 4db56dce44
commit 8ae759ac89
4 changed files with 11 additions and 5 deletions

View File

@ -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()
}

View File

@ -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
}

View File

@ -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
}
}