1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00

Editor | Fix | Mime types (#1834)

This commit is contained in:
Konstantin Ivanov 2021-10-01 13:36:32 +04:00 committed by GitHub
parent 829e00126f
commit ce72991d22
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -241,10 +241,10 @@ fun DVSortType.text(format: Relation.Format): Int = when (format) {
}
fun String?.getMimeIcon(name: String?): Int {
var mime = this
val extension = MimeTypeMap.getFileExtensionFromUrl(name)
var mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension)
if (mime.isNullOrBlank()) {
val extension = MimeTypeMap.getFileExtensionFromUrl(name)
mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension)
mime = this
}
return when (MimeTypes.category(mime)) {
MimeTypes.Category.PDF -> R.drawable.ic_mime_pdf

View file

@ -32,7 +32,6 @@ object MimeTypes {
"application/vnd.openxmlformats-officedocument.wordprocessingml.template",
"application/json",
"application/ld+json",
"application/msword",
"text/comma-separated-values"
)
@ -51,6 +50,7 @@ object MimeTypes {
"audio/mp4",
"audio/wave",
"audio/wav",
"audio/x-wav",
"audio/webm",
"audio/ogg",
"audio/aac",