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:
parent
829e00126f
commit
ce72991d22
2 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue