use the extension function for checking root folders

This commit is contained in:
tibbi 2016-11-13 11:45:43 +01:00
parent 511fc5e420
commit 04e3ea1fb2

View File

@ -111,10 +111,7 @@ class Utils {
}
}
fun isAStorageRootFolder(context: Context, path: String): Boolean {
val trimmed = path.trimEnd('/')
return trimmed.isEmpty() || trimmed == context.getInternalStoragePath() || trimmed == context.getSDCardPath()
}
fun isAStorageRootFolder(context: Context, path: String) = context.isAStorageRootFolder(path)
fun isPhotoVideo(file: File) = file.isPhotoVideo()