do not refresh media at viewpager with random sorting

This commit is contained in:
tibbi 2018-10-25 10:53:24 +02:00
parent 0a6c553cc7
commit f773ab9c1c

View file

@ -982,10 +982,12 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
} }
private fun refreshViewPager() { private fun refreshViewPager() {
if (config.getFileSorting(mDirectory) and SORT_BY_RANDOM == 0) {
GetMediaAsynctask(applicationContext, mDirectory, false, false, mShowAll) { GetMediaAsynctask(applicationContext, mDirectory, false, false, mShowAll) {
gotMedia(it) gotMedia(it)
}.execute() }.execute()
} }
}
private fun gotMedia(thumbnailItems: ArrayList<ThumbnailItem>) { private fun gotMedia(thumbnailItems: ArrayList<ThumbnailItem>) {
val media = thumbnailItems.filter { it is Medium }.map { it as Medium } as ArrayList<Medium> val media = thumbnailItems.filter { it is Medium }.map { it as Medium } as ArrayList<Medium>