do not allow closing the fullscreen videoplayer with slow down gestures

This commit is contained in:
tibbi 2019-01-14 19:32:14 +01:00
parent 34fade06a0
commit f6696c4552
2 changed files with 3 additions and 2 deletions

View file

@ -523,7 +523,8 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen
val diffX = mTouchDownX - event.x
val diffY = mTouchDownY - event.y
if (config.allowDownGesture && !mIgnoreCloseDown && Math.abs(diffY) > Math.abs(diffX) && diffY < -mCloseDownThreshold) {
val downGestureDuration = System.currentTimeMillis() - mTouchDownTime
if (config.allowDownGesture && !mIgnoreCloseDown && Math.abs(diffY) > Math.abs(diffX) && diffY < -mCloseDownThreshold && downGestureDuration < MAX_CLOSE_DOWN_GESTURE_DURATION) {
supportFinishAfterTransition()
}

View file

@ -103,7 +103,7 @@ const val GO_TO_PREV_ITEM = "go_to_prev_item"
const val MAX_COLUMN_COUNT = 20
const val SHOW_TEMP_HIDDEN_DURATION = 300000L
const val CLICK_MAX_DURATION = 150
const val MAX_CLOSE_DOWN_GESTURE_DURATION = 500
const val MAX_CLOSE_DOWN_GESTURE_DURATION = 400
const val DRAG_THRESHOLD = 8
const val MONTH_MILLISECONDS = MONTH_SECONDS * 1000L
const val MIN_SKIP_LENGTH = 2000