diff --git a/CHANGELOG.md b/CHANGELOG.md index 56c0e04afe5..0197894d343 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ ownCloud admins and users. * Enhancement - Select user and navigate to file when opening via deep link: [#4194](https://github.com/owncloud/android/issues/4194) * Enhancement - New branding/MDM parameter to show sensitive auth info in logs: [#4249](https://github.com/owncloud/android/issues/4249) * Enhancement - Fix in the type handling of the content-type: [#4258](https://github.com/owncloud/android/issues/4258) +* Enhancement - Added icon for .docxf files: [#4267](https://github.com/owncloud/android/issues/4267) * Enhancement - Manage password policy in live mode: [#4269](https://github.com/owncloud/android/issues/4269) * Enhancement - New branding/MDM parameter to send `login_hint` and `user` params: [#4288](https://github.com/owncloud/android/issues/4288) @@ -290,6 +291,13 @@ ownCloud admins and users. https://github.com/owncloud/android/issues/4258 https://github.com/owncloud/android/pull/4266 +* Enhancement - Added icon for .docxf files: [#4267](https://github.com/owncloud/android/issues/4267) + + An icon has been added for files that have a .docxf extension. + + https://github.com/owncloud/android/issues/4267 + https://github.com/owncloud/android/pull/4297 + * Enhancement - Manage password policy in live mode: [#4269](https://github.com/owncloud/android/issues/4269) Password policy for public links is handled in live mode with new items in the diff --git a/changelog/unreleased/4297 b/changelog/unreleased/4297 new file mode 100644 index 00000000000..4868d0a75eb --- /dev/null +++ b/changelog/unreleased/4297 @@ -0,0 +1,6 @@ +Enhancement: Added icon for .docxf files + +An icon has been added for files that have a .docxf extension. + +https://github.com/owncloud/android/issues/4267 +https://github.com/owncloud/android/pull/4297 diff --git a/owncloudApp/src/main/java/com/owncloud/android/presentation/files/filelist/MainFileListFragment.kt b/owncloudApp/src/main/java/com/owncloud/android/presentation/files/filelist/MainFileListFragment.kt index a935c83d0e2..77c2d7f2f5e 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/presentation/files/filelist/MainFileListFragment.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/presentation/files/filelist/MainFileListFragment.kt @@ -25,6 +25,7 @@ package com.owncloud.android.presentation.files.filelist import android.annotation.SuppressLint import android.content.Intent +import android.content.res.ColorStateList import android.net.Uri import android.os.Bundle import android.view.LayoutInflater @@ -854,6 +855,9 @@ class MainFileListFragment : Fragment(), removeDefaultTint() title = appRegistry.name itemIcon = ResourcesCompat.getDrawable(resources, MimetypeIconUtil.getFileTypeIconId(appRegistry.mimeType, appRegistry.ext), null) + if (appRegistry.ext == FILE_DOCXF_EXTENSION) { + itemIcon?.setTintList(ColorStateList.valueOf(ContextCompat.getColor(context, R.color.file_docxf))) + } setOnClickListener { showFilenameTextDialog(appRegistry.ext) currentDefaultApplication = appRegistry.defaultApplication @@ -1359,6 +1363,7 @@ class MainFileListFragment : Fragment(), private const val DIALOG_CREATE_FOLDER = "DIALOG_CREATE_FOLDER" private const val TAG_SECOND_FRAGMENT = "SECOND_FRAGMENT" + private const val FILE_DOCXF_EXTENSION = "docxf" @JvmStatic fun newInstance( diff --git a/owncloudApp/src/main/java/com/owncloud/android/utils/MimetypeIconUtil.java b/owncloudApp/src/main/java/com/owncloud/android/utils/MimetypeIconUtil.java index 87884a799db..589eaac827b 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/utils/MimetypeIconUtil.java +++ b/owncloudApp/src/main/java/com/owncloud/android/utils/MimetypeIconUtil.java @@ -213,6 +213,7 @@ private static void populateMimeTypeIconMapping() { MIMETYPE_TO_ICON_MAPPING.put("application/vnd.oasis.opendocument.text-master", R.drawable.file_doc); MIMETYPE_TO_ICON_MAPPING.put("application/vnd.oasis.opendocument.text-template", R.drawable.file_doc); MIMETYPE_TO_ICON_MAPPING.put("application/vnd.oasis.opendocument.text-web", R.drawable.file_doc); + MIMETYPE_TO_ICON_MAPPING.put("application/vnd.openxmlformats-officedocument.wordprocessingml.form", R.drawable.file_docxf); MIMETYPE_TO_ICON_MAPPING.put("application/vnd.openxmlformats-officedocument.presentationml.presentation", R.drawable.file_ppt); MIMETYPE_TO_ICON_MAPPING.put("application/vnd.openxmlformats-officedocument.presentationml.slideshow", @@ -324,6 +325,8 @@ private static void populateFileExtensionMimeTypeMapping() { ".macroEnabled.12")); FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("docx", Collections.singletonList("application/vnd" + ".openxmlformats-officedocument.wordprocessingml.document")); + FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("docxf", Collections.singletonList("application/vnd" + + ".openxmlformats-officedocument.wordprocessingml.form")); FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("dot", Collections.singletonList("application/msword")); FILE_EXTENSION_TO_MIMETYPE_MAPPING.put("dotx", Collections.singletonList("application/vnd" + ".openxmlformats-officedocument.wordprocessingml.template")); diff --git a/owncloudApp/src/main/res/drawable/file_docxf.xml b/owncloudApp/src/main/res/drawable/file_docxf.xml new file mode 100644 index 00000000000..ba0e7ec4c91 --- /dev/null +++ b/owncloudApp/src/main/res/drawable/file_docxf.xml @@ -0,0 +1,11 @@ + + + diff --git a/owncloudApp/src/main/res/values/colors.xml b/owncloudApp/src/main/res/values/colors.xml index d34da81229f..a3e78d3070c 100644 --- a/owncloudApp/src/main/res/values/colors.xml +++ b/owncloudApp/src/main/res/values/colors.xml @@ -64,6 +64,8 @@ #f4511e #009688 + #66a6a3 + #6E758C #6E758C