mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Added support for JSON file in plain text file viewer
This commit is contained in:
parent
a64db777d9
commit
559397d420
1 changed files with 4 additions and 1 deletions
|
|
@ -108,15 +108,18 @@ class FileUtils {
|
|||
@AnyThread
|
||||
fun getMimeType(type: String?): MimeType {
|
||||
if (type.isNullOrEmpty()) return MimeType.Unknown
|
||||
return when {
|
||||
val mime = when {
|
||||
type.startsWith("image/") -> MimeType.Image
|
||||
type.startsWith("text/") -> MimeType.PlainText
|
||||
type.endsWith("/log") -> MimeType.PlainText
|
||||
type.startsWith("video/") -> MimeType.Video
|
||||
type.startsWith("audio/") -> MimeType.Audio
|
||||
type.startsWith("application/pdf") -> MimeType.Pdf
|
||||
type.startsWith("application/json") -> MimeType.PlainText
|
||||
else -> MimeType.Unknown
|
||||
}
|
||||
Log.i("$TAG MIME type for [$type] is [$mime]")
|
||||
return mime
|
||||
}
|
||||
|
||||
@AnyThread
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue