fix video gestures when Gesture Down To Close is disabled
This commit is contained in:
parent
226374599d
commit
ada0661d89
2 changed files with 10 additions and 13 deletions
|
@ -140,7 +140,6 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
if (mConfig.allowDownGesture) {
|
|
||||||
video_preview.setOnTouchListener { view, event ->
|
video_preview.setOnTouchListener { view, event ->
|
||||||
handleEvent(event)
|
handleEvent(event)
|
||||||
false
|
false
|
||||||
|
@ -154,8 +153,6 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S
|
||||||
gestureDetector.onTouchEvent(event)
|
gestureDetector.onTouchEvent(event)
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!arguments!!.getBoolean(SHOULD_INIT_FRAGMENT, true)) {
|
if (!arguments!!.getBoolean(SHOULD_INIT_FRAGMENT, true)) {
|
||||||
|
|
|
@ -140,7 +140,7 @@ abstract class ViewPagerFragment : Fragment() {
|
||||||
val diffY = mTouchDownY - event.y
|
val diffY = mTouchDownY - event.y
|
||||||
|
|
||||||
val downGestureDuration = System.currentTimeMillis() - mTouchDownTime
|
val downGestureDuration = System.currentTimeMillis() - mTouchDownTime
|
||||||
if (!mIgnoreCloseDown && Math.abs(diffY) > Math.abs(diffX) && diffY < -mCloseDownThreshold && downGestureDuration < MAX_CLOSE_DOWN_GESTURE_DURATION) {
|
if (!mIgnoreCloseDown && Math.abs(diffY) > Math.abs(diffX) && diffY < -mCloseDownThreshold && downGestureDuration < MAX_CLOSE_DOWN_GESTURE_DURATION && context?.config?.allowDownGesture == true) {
|
||||||
activity?.supportFinishAfterTransition()
|
activity?.supportFinishAfterTransition()
|
||||||
}
|
}
|
||||||
mIgnoreCloseDown = false
|
mIgnoreCloseDown = false
|
||||||
|
|
Loading…
Reference in a new issue