mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 20:48:00 +01:00
make sure we call getLatestMediaId from a background thread
This commit is contained in:
parent
67be9efbe3
commit
1c433b1ebf
2 changed files with 8 additions and 3 deletions
|
@ -526,9 +526,11 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
|||
}
|
||||
|
||||
private fun gotDirectories(newDirs: ArrayList<Directory>, isFromCache: Boolean) {
|
||||
val dirs = getSortedDirectories(newDirs)
|
||||
Thread {
|
||||
mLatestMediaId = getLatestMediaId()
|
||||
}.start()
|
||||
|
||||
mLatestMediaId = getLatestMediaId()
|
||||
val dirs = getSortedDirectories(newDirs)
|
||||
directories_refresh_layout.isRefreshing = false
|
||||
mIsGettingDirs = false
|
||||
|
||||
|
|
|
@ -537,7 +537,10 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
|||
}
|
||||
|
||||
private fun gotMedia(media: ArrayList<Medium>, isFromCache: Boolean = false) {
|
||||
mLatestMediaId = getLatestMediaId()
|
||||
Thread {
|
||||
mLatestMediaId = getLatestMediaId()
|
||||
}.start()
|
||||
|
||||
mIsGettingMedia = false
|
||||
media_refresh_layout.isRefreshing = false
|
||||
|
||||
|
|
Loading…
Reference in a new issue