From 25a46f18f4b43541ac8197185ef6578245ac91fa Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 23 Mar 2017 20:56:18 +0100 Subject: [PATCH] refresh the thumbnails if Crop Thumbnails has changed --- .../simplemobiletools/gallery/activities/MainActivity.kt | 7 +++++++ .../simplemobiletools/gallery/activities/MediaActivity.kt | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index f8eff8659..e3462309e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -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() 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() { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index c50017626..cbc1d5090 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -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() {