diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index a551e96ff..79de936e8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -860,11 +860,14 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View if (view_pager.offscreenPageLimit == 1) { view_pager.offscreenPageLimit = 2 } - mPos = position - updateActionbarTitle() - mRotationDegrees = 0f - supportInvalidateOptionsMenu() - scheduleSwipe() + + if (mPos != position) { + mPos = position + updateActionbarTitle() + mRotationDegrees = 0f + supportInvalidateOptionsMenu() + scheduleSwipe() + } } override fun onPageScrollStateChanged(state: Int) {