refresh the thumbnails if Crop Thumbnails has changed

This commit is contained in:
tibbi 2017-03-23 20:56:18 +01:00
parent e9115530ea
commit 25a46f18f4
2 changed files with 14 additions and 0 deletions

View File

@ -47,6 +47,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
private var mIsThirdPartyIntent = false
private var mIsGettingDirs = false
private var mStoredAnimateGifs = true
private var mStoredCropThumbnails = true
private var mCurrAsyncTask: GetDirectoriesAsynctask? = null
@ -66,6 +67,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
directories_refresh_layout.setOnRefreshListener({ getDirectories() })
mDirs = ArrayList<Directory>()
mStoredAnimateGifs = config.animateGifs
mStoredCropThumbnails = config.cropThumbnails
storeStoragePaths()
checkWhatsNewDialog()
}
@ -101,6 +103,10 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
if (mStoredAnimateGifs != config.animateGifs) {
mDirs.clear()
}
if (mStoredCropThumbnails != config.cropThumbnails) {
mDirs.clear()
}
tryloadGallery()
}
@ -111,6 +117,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
directories_refresh_layout.isRefreshing = false
mIsGettingDirs = false
mStoredAnimateGifs = config.animateGifs
mStoredCropThumbnails = config.cropThumbnails
}
override fun onStop() {

View File

@ -45,6 +45,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
private var mShowAll = false
private var mLoadedInitialPhotos = false
private var mStoredAnimateGifs = true
private var mStoredCropThumbnails = true
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@ -58,6 +59,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
media_refresh_layout.setOnRefreshListener({ getMedia() })
mPath = intent.getStringExtra(DIRECTORY)
mStoredAnimateGifs = config.animateGifs
mStoredCropThumbnails = config.cropThumbnails
mShowAll = config.showAll
if (mShowAll)
supportActionBar?.setDisplayHomeAsUpEnabled(false)
@ -68,6 +70,10 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
if (mShowAll && mStoredAnimateGifs != config.animateGifs) {
mMedia.clear()
}
if (mStoredCropThumbnails != config.cropThumbnails) {
mMedia.clear()
}
tryloadGallery()
}
@ -77,6 +83,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
mIsGettingMedia = false
media_refresh_layout.isRefreshing = false
mStoredAnimateGifs = config.animateGifs
mStoredCropThumbnails = config.cropThumbnails
}
private fun tryloadGallery() {