From c2f268d0048675e1e0cb2a495a610016024f7fda Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 14 Jan 2017 12:18:37 +0100 Subject: [PATCH] show a spinner while loading directories for the first time --- .../simplemobiletools/gallery/activities/MainActivity.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 8966b55bd..1c7b29ba4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -134,7 +134,11 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { val token = object : TypeToken>() {}.type val dirs = Gson().fromJson>(config.directories, token) ?: ArrayList(1) - gotDirectories(dirs) + if (dirs.size == 0) { + directories_holder.isRefreshing = true + } else { + gotDirectories(dirs) + } mIsGettingDirs = true GetDirectoriesAsynctask(applicationContext, mIsPickVideoIntent || mIsGetVideoContentIntent, mIsPickImageIntent || mIsGetImageContentIntent) {