mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Improve default mime type.
This commit is contained in:
committed by
Benoit Marty
parent
34631f53b3
commit
e7ba973e7b
@@ -51,4 +51,12 @@ object MimeTypes {
|
||||
fun String?.isMimeTypeFile() = this?.startsWith("file/").orFalse()
|
||||
fun String?.isMimeTypeText() = this?.startsWith("text/").orFalse()
|
||||
fun String?.isMimeTypeAny() = this?.startsWith("*/").orFalse()
|
||||
|
||||
fun fromFileExtension(fileExtension: String): String {
|
||||
return when (fileExtension.lowercase()) {
|
||||
"apk" -> Apk
|
||||
"pdf" -> Pdf
|
||||
else -> OctetStream
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user