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 1f8ab2e12..37fd0df9a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -183,7 +183,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { mIsGettingDirs = true val dirs = getCachedDirectories() if (dirs.isNotEmpty() && !mLoadedInitialPhotos) { - gotDirectories(dirs) + gotDirectories(dirs, true) } if (!mLoadedInitialPhotos) { @@ -205,6 +205,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { private fun showFilterMediaDialog() { FilterMediaDialog(this) { + directories_refresh_layout.isRefreshing = true getDirectories() } } @@ -389,7 +390,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { } } - private fun gotDirectories(dirs: ArrayList) { + private fun gotDirectories(dirs: ArrayList, isFromCache: Boolean = false) { mLastMediaModified = getLastMediaModified() directories_refresh_layout.isRefreshing = false mIsGettingDirs = false 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 6ef580071..0d4ca59fd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -237,6 +237,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { private fun showFilterMediaDialog() { FilterMediaDialog(this) { + media_refresh_layout.isRefreshing = true getMedia() } } @@ -304,7 +305,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { val token = object : TypeToken>() {}.type val media = Gson().fromJson>(config.loadFolderMedia(mPath), token) ?: ArrayList(1) if (media.isNotEmpty() && !mLoadedInitialPhotos) { - gotMedia(media) + gotMedia(media, true) } else { media_refresh_layout.isRefreshing = true } @@ -453,7 +454,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { } } - private fun gotMedia(media: ArrayList) { + private fun gotMedia(media: ArrayList, isFromCache: Boolean = false) { mLastMediaModified = getLastMediaModified() mIsGettingMedia = false media_refresh_layout.isRefreshing = false