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 { fun isAStorageRootFolder(context: Context, path: String) = context.isAStorageRootFolder(path)
val trimmed = path.trimEnd('/')
return trimmed.isEmpty() || trimmed == context.getInternalStoragePath() || trimmed == context.getSDCardPath()
}
fun isPhotoVideo(file: File) = file.isPhotoVideo() fun isPhotoVideo(file: File) = file.isPhotoVideo()