From f6696c4552cdef3e58d1295e7d3b59345ab0a51b Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 14 Jan 2019 19:32:14 +0100 Subject: [PATCH] do not allow closing the fullscreen videoplayer with slow down gestures --- .../gallery/pro/activities/VideoPlayerActivity.kt | 3 ++- .../com/simplemobiletools/gallery/pro/helpers/Constants.kt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt index d47601c06..b09da8cd0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/VideoPlayerActivity.kt @@ -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() } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt index 177997fe6..bb2b876ab 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/Constants.kt @@ -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