add an extra check to avoid displaying hidden folders if shouldnt
This commit is contained in:
parent
4164f6c980
commit
97554c36ed
|
@ -71,6 +71,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va
|
||||||
private fun groupDirectories(media: ArrayList<Medium>): Map<String, Directory> {
|
private fun groupDirectories(media: ArrayList<Medium>): Map<String, Directory> {
|
||||||
val hidden = context.resources.getString(R.string.hidden)
|
val hidden = context.resources.getString(R.string.hidden)
|
||||||
val directories = LinkedHashMap<String, Directory>()
|
val directories = LinkedHashMap<String, Directory>()
|
||||||
|
val showHidden = config.showHiddenFolders
|
||||||
for ((name, path, isVideo, dateModified, dateTaken, size) in media) {
|
for ((name, path, isVideo, dateModified, dateTaken, size) in media) {
|
||||||
if (shouldStop)
|
if (shouldStop)
|
||||||
cancel(true)
|
cancel(true)
|
||||||
|
@ -91,6 +92,9 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va
|
||||||
|
|
||||||
if (File(parentDir).containsNoMedia()) {
|
if (File(parentDir).containsNoMedia()) {
|
||||||
dirName += " $hidden"
|
dirName += " $hidden"
|
||||||
|
|
||||||
|
if (!showHidden)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
val directory = Directory(parentDir, path, dirName, 1, dateModified, dateTaken, size)
|
val directory = Directory(parentDir, path, dirName, 1, dateModified, dateTaken, size)
|
||||||
|
|
Loading…
Reference in New Issue