mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2024-12-27 16:55:03 +01:00
show the refreshing icon at opening the gallery
This commit is contained in:
parent
dab8442119
commit
8849db924e
@ -160,13 +160,14 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
||||
mIsGettingDirs = true
|
||||
val token = object : TypeToken<List<Directory>>() {}.type
|
||||
val dirs = Gson().fromJson<ArrayList<Directory>>(config.directories, token) ?: ArrayList<Directory>(1)
|
||||
if (dirs.size == 0) {
|
||||
directories_refresh_layout.isRefreshing = true
|
||||
} else if (!mLoadedInitialPhotos) {
|
||||
mLoadedInitialPhotos = true
|
||||
if (dirs.size != 0 && !mLoadedInitialPhotos) {
|
||||
gotDirectories(dirs)
|
||||
}
|
||||
|
||||
if (!mLoadedInitialPhotos) {
|
||||
directories_refresh_layout.isRefreshing = true
|
||||
}
|
||||
|
||||
mLoadedInitialPhotos = true
|
||||
mCurrAsyncTask = GetDirectoriesAsynctask(applicationContext, mIsPickVideoIntent || mIsGetVideoContentIntent, mIsPickImageIntent || mIsGetImageContentIntent) {
|
||||
gotDirectories(it)
|
||||
|
@ -220,13 +220,14 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
||||
mIsGettingMedia = true
|
||||
val token = object : TypeToken<List<Medium>>() {}.type
|
||||
val media = Gson().fromJson<ArrayList<Medium>>(config.loadFolderMedia(mPath), token) ?: ArrayList<Medium>(1)
|
||||
if (media.size == 0) {
|
||||
media_refresh_layout.isRefreshing = true
|
||||
} else if (!mLoadedInitialPhotos) {
|
||||
mLoadedInitialPhotos = true
|
||||
if (media.size == 0 && !mLoadedInitialPhotos) {
|
||||
gotMedia(media)
|
||||
}
|
||||
|
||||
if (!mLoadedInitialPhotos) {
|
||||
media_refresh_layout.isRefreshing = true
|
||||
}
|
||||
|
||||
mLoadedInitialPhotos = true
|
||||
mCurrAsyncTask = GetMediaAsynctask(applicationContext, mPath, mIsGetVideoIntent, mIsGetImageIntent, mShowAll) {
|
||||
gotMedia(it)
|
||||
|
Loading…
Reference in New Issue
Block a user