do not refresh the thumbnails at Random sorting that often

This commit is contained in:
tibbi 2019-02-22 11:28:05 +01:00
parent c856f8a9e3
commit fc04a9c697
2 changed files with 7 additions and 3 deletions

View file

@ -61,7 +61,7 @@ android {
}
dependencies {
implementation 'com.simplemobiletools:commons:5.9.2'
implementation 'com.simplemobiletools:commons:5.9.3'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'it.sephiroth.android.exif:library:1.0.1'

View file

@ -25,6 +25,7 @@ import com.simplemobiletools.commons.dialogs.ConfirmationDialog
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
import com.simplemobiletools.commons.helpers.REQUEST_EDIT_IMAGE
import com.simplemobiletools.commons.helpers.SORT_BY_RANDOM
import com.simplemobiletools.commons.models.FileDirItem
import com.simplemobiletools.commons.views.MyGridLayoutManager
import com.simplemobiletools.commons.views.MyRecyclerView
@ -152,10 +153,13 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
media_horizontal_fastscroller.allowBubbleDisplay = config.showInfoBubble
media_vertical_fastscroller.allowBubbleDisplay = config.showInfoBubble
media_refresh_layout.isEnabled = config.enablePullToRefresh
tryLoadGallery()
invalidateOptionsMenu()
media_empty_text_label.setTextColor(config.textColor)
media_empty_text.setTextColor(getAdjustedPrimaryColor())
if (mMedia.isEmpty() || config.getFileSorting(mPath) and SORT_BY_RANDOM == 0) {
tryLoadGallery()
}
}
override fun onPause() {
@ -413,7 +417,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
}
private fun checkLastMediaChanged() {
if (isDestroyed) {
if (isDestroyed || config.getFileSorting(mPath) and SORT_BY_RANDOM != 0) {
return
}