From 360c3529ea74c7243ef9f6bb1b6e389f8da48961 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 1 Mar 2022 12:08:15 +0100 Subject: [PATCH] refetch viewpager item position if it is -1 too --- .../gallery/pro/activities/ViewPagerActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 9861ecf46..d9c47db15 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 @@ -1192,7 +1192,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View mPrevHashcode = media.hashCode() mMediaFiles = media - if (refetchViewPagerPosition) { + if (refetchViewPagerPosition || mPos == -1) { mPos = getPositionInList(media) if (mPos == -1) { Math.min(mPos, mMediaFiles.size - 1)