From f773ab9c1c52586fdde019080c67d1238c69b424 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 25 Oct 2018 10:53:24 +0200 Subject: [PATCH] do not refresh media at viewpager with random sorting --- .../gallery/activities/ViewPagerActivity.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 444097363..56cec98fb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -982,9 +982,11 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } private fun refreshViewPager() { - GetMediaAsynctask(applicationContext, mDirectory, false, false, mShowAll) { - gotMedia(it) - }.execute() + if (config.getFileSorting(mDirectory) and SORT_BY_RANDOM == 0) { + GetMediaAsynctask(applicationContext, mDirectory, false, false, mShowAll) { + gotMedia(it) + }.execute() + } } private fun gotMedia(thumbnailItems: ArrayList) {