Minor code improvement

This commit is contained in:
Naveen 2022-07-06 15:44:43 +05:30
parent e4aff60852
commit caf6b7c553

View file

@ -1229,8 +1229,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
}
private fun refreshViewPager(refetchPosition: Boolean = false) {
val isNotRandomSorting = config.getFolderSorting(mDirectory) and SORT_BY_RANDOM == 0
if (isNotRandomSorting || isExternalIntent()) {
val isRandomSorting = config.getFolderSorting(mDirectory) and SORT_BY_RANDOM != 0
if (!isRandomSorting || isExternalIntent()) {
GetMediaAsynctask(applicationContext, mDirectory, isPickImage = false, isPickVideo = false, showAll = mShowAll) {
gotMedia(it, refetchViewPagerPosition = refetchPosition)
}.execute()