add the slash after nomedia folders right at fetching

This commit is contained in:
tibbi 2017-08-31 14:28:15 +02:00
parent 416f459bc5
commit 6b61883214

View file

@ -127,7 +127,7 @@ private fun parseCursor(context: Context, cur: Cursor, isPickImage: Boolean, isP
if (!isExcluded && !showHidden) { if (!isExcluded && !showHidden) {
noMediaFolders.forEach { noMediaFolders.forEach {
if (path.startsWith("$it/")) { if (path.startsWith(it)) {
isExcluded = true isExcluded = true
} }
} }
@ -225,7 +225,7 @@ fun Context.getNoMediaFolders(): ArrayList<String> {
val path = cursor.getString(cursor.getColumnIndex(MediaStore.Files.FileColumns.DATA)) ?: continue val path = cursor.getString(cursor.getColumnIndex(MediaStore.Files.FileColumns.DATA)) ?: continue
val noMediaFile = File(path) val noMediaFile = File(path)
if (noMediaFile.exists()) if (noMediaFile.exists())
folders.add(noMediaFile.parent) folders.add("${noMediaFile.parent}/")
} while (cursor.moveToNext()) } while (cursor.moveToNext())
} }
} finally { } finally {