From 387eccbaddff1040af20e9b38aad158f1647288c Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 1 Mar 2020 23:05:04 +0100 Subject: [PATCH] do not refresh media at playing fullscreen videos, should fix some reseting --- .../gallery/pro/activities/ViewPagerActivity.kt | 2 +- .../simplemobiletools/gallery/pro/fragments/VideoFragment.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt index cea66cd8e..77dffb031 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt @@ -1104,7 +1104,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun gotMedia(thumbnailItems: ArrayList) { val media = thumbnailItems.asSequence().filter { it is Medium && !mIgnoredPaths.contains(it.path) }.map { it as Medium }.toMutableList() as ArrayList - if (isDirEmpty(media) || media.hashCode() == mPrevHashcode) { + if (isDirEmpty(media) || media.hashCode() == mPrevHashcode || (getCurrentFragment() as? VideoFragment)?.mIsPlaying == true) { return } 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 4debc2c65..76da0d990 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 @@ -44,7 +44,6 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S private var mWasFragmentInit = false private var mIsPanorama = false private var mIsFragmentVisible = false - private var mIsPlaying = false private var mIsDragged = false private var mWasVideoStarted = false private var mWasPlayerInited = false @@ -55,6 +54,7 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S private var mDuration = 0 private var mPositionWhenInit = 0 private var mPositionAtPause = 0L + var mIsPlaying = false private var mExoPlayer: SimpleExoPlayer? = null private var mVideoSize = Point(1, 1)