From f187a36ebb8e5d0d34364c235c3b097b6ff48e15 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 20 Feb 2020 12:11:38 +0100 Subject: [PATCH] shortening some code --- .../gallery/pro/activities/VideoPlayerActivity.kt | 10 ++++------ .../gallery/pro/fragments/VideoFragment.kt | 4 ++-- 2 files changed, 6 insertions(+), 8 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 eb13b4cf0..a432ca076 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 @@ -194,13 +194,13 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen if (config.allowVideoGestures) { video_brightness_controller.initialize(this, slide_info, true, video_player_holder, singleTap = { x, y -> toggleFullscreen() - }, doubleTap = {x, y -> + }, doubleTap = { x, y -> doSkip(false) }) video_volume_controller.initialize(this, slide_info, false, video_player_holder, singleTap = { x, y -> toggleFullscreen() - }, doubleTap = {x, y -> + }, doubleTap = { x, y -> doSkip(true) }) } else { @@ -497,11 +497,9 @@ open class VideoPlayerActivity : SimpleActivity(), SeekBar.OnSeekBarChangeListen } private fun skip(forward: Boolean) { - if (mExoPlayer == null) { - return + if (mExoPlayer != null) { + doSkip(forward) } - - doSkip(forward) } private fun doSkip(forward: Boolean) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt index ab8f93529..3944ceabb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/VideoFragment.kt @@ -206,7 +206,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } else { toggleFullscreen() } - }, doubleTap = {x, y -> + }, doubleTap = { x, y -> doSkip(false) }) @@ -216,7 +216,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S } else { toggleFullscreen() } - }, doubleTap = {x, y -> + }, doubleTap = { x, y -> doSkip(true) })