mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 04:57:59 +01:00
show the swipeRefreshLayout spinner at loading images after filtering change
This commit is contained in:
parent
141953338e
commit
ab35c970b9
2 changed files with 6 additions and 4 deletions
|
@ -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<Directory>) {
|
||||
private fun gotDirectories(dirs: ArrayList<Directory>, isFromCache: Boolean = false) {
|
||||
mLastMediaModified = getLastMediaModified()
|
||||
directories_refresh_layout.isRefreshing = false
|
||||
mIsGettingDirs = false
|
||||
|
|
|
@ -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<List<Medium>>() {}.type
|
||||
val media = Gson().fromJson<ArrayList<Medium>>(config.loadFolderMedia(mPath), token) ?: ArrayList<Medium>(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<Medium>) {
|
||||
private fun gotMedia(media: ArrayList<Medium>, isFromCache: Boolean = false) {
|
||||
mLastMediaModified = getLastMediaModified()
|
||||
mIsGettingMedia = false
|
||||
media_refresh_layout.isRefreshing = false
|
||||
|
|
Loading…
Reference in a new issue