From d91228eedf74c0a05d22134c41eb48fdb6bef34a Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 9 Apr 2018 14:04:42 +0200 Subject: [PATCH] adding a couple improvements related to un/hiding folders --- .../gallery/activities/MainActivity.kt | 1 + .../gallery/adapters/DirectoryAdapter.kt | 37 +++++++++---------- .../asynctasks/GetDirectoriesAsynctask.kt | 20 +--------- .../gallery/extensions/Activity.kt | 17 +++++++-- .../gallery/extensions/Context.kt | 25 ++++++++++++- .../gallery/extensions/File.kt | 4 +- .../gallery/helpers/MediaFetcher.kt | 4 +- 7 files changed, 61 insertions(+), 47 deletions(-) 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 6de05308c..eeb7d3274 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -686,6 +686,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { gotDirectories(directories, true) } else { mDirs = directories + storeDirectories() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index f028c24af..7d1b84e51 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -181,26 +181,20 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList - if (directory.path.startsWith(it, true)) { - val hidden = activity.getString(R.string.hidden) - directory.name = directory.name.removeSuffix(hidden).trim() - } - } - updateDirs(dirs) - listener?.updateDirectories(dirs.toList() as ArrayList, true) + updateFolderNames() } else { activity.runOnUiThread { listener?.refreshItems() @@ -212,17 +206,22 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList