mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-06-05 22:09:15 +02:00
handle gif and video thumbnails too
This commit is contained in:
@ -22,6 +22,10 @@ class FileDirItem(val path: String, val name: String, val isDirectory: Boolean,
|
||||
return "FileDirItem{name=$name, isDirectory=$isDirectory, path=$path, children=$children, size=$size}"
|
||||
}
|
||||
|
||||
fun isGif() = name.toLowerCase().endsWith(".gif")
|
||||
fun isVideo() = getMimeType().startsWith("video")
|
||||
fun isAudio() = getMimeType().startsWith("audio")
|
||||
|
||||
fun isImage(): Boolean {
|
||||
val options = BitmapFactory.Options()
|
||||
options.inJustDecodeBounds = true
|
||||
@ -29,14 +33,6 @@ class FileDirItem(val path: String, val name: String, val isDirectory: Boolean,
|
||||
return options.outWidth != -1 && options.outHeight != -1
|
||||
}
|
||||
|
||||
fun isVideo(): Boolean {
|
||||
return getMimeType().startsWith("video")
|
||||
}
|
||||
|
||||
fun isAudio(): Boolean {
|
||||
return getMimeType().startsWith("audio")
|
||||
}
|
||||
|
||||
fun getMimeType(): String {
|
||||
try {
|
||||
val retriever = MediaMetadataRetriever()
|
||||
|
Reference in New Issue
Block a user