more code style
This commit is contained in:
parent
15e73af1a9
commit
1d87967588
1 changed files with 4 additions and 3 deletions
|
@ -72,7 +72,7 @@ fun String.isImageFast() = photoExtensions.any { endsWith(it, true) }
|
|||
fun String.isAudioFast() = audioExtensions.any { endsWith(it, true) }
|
||||
fun String.isRawFast() = rawExtensions.any { endsWith(it, true) }
|
||||
|
||||
fun String. isImageSlow() = isImageFast() || getMimeType().startsWith("image") || startsWith(MediaStore.Images.Media.EXTERNAL_CONTENT_URI.toString())
|
||||
fun String.isImageSlow() = isImageFast() || getMimeType().startsWith("image") || startsWith(MediaStore.Images.Media.EXTERNAL_CONTENT_URI.toString())
|
||||
fun String.isVideoSlow() = isVideoFast() || getMimeType().startsWith("video") || startsWith(MediaStore.Video.Media.EXTERNAL_CONTENT_URI.toString())
|
||||
fun String.isAudioSlow() = isAudioFast() || getMimeType().startsWith("audio") || startsWith(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI.toString())
|
||||
|
||||
|
@ -105,11 +105,12 @@ fun String.doesThisOrParentHaveNoMedia(folderNoMediaStatuses: HashMap<String, Bo
|
|||
fun String.getImageResolution(context: Context): Point? {
|
||||
val options = BitmapFactory.Options()
|
||||
options.inJustDecodeBounds = true
|
||||
if(context.isRestrictedSAFOnlyRoot(this)){
|
||||
if (context.isRestrictedSAFOnlyRoot(this)) {
|
||||
BitmapFactory.decodeStream(context.contentResolver.openInputStream(context.getAndroidSAFUri(this)), null, options)
|
||||
}else{
|
||||
} else {
|
||||
BitmapFactory.decodeFile(this, options)
|
||||
}
|
||||
|
||||
val width = options.outWidth
|
||||
val height = options.outHeight
|
||||
return if (width > 0 && height > 0) {
|
||||
|
|
Loading…
Reference in a new issue