From aa97741724bec2101e7fceb1d4681d43c263b247 Mon Sep 17 00:00:00 2001 From: Aitorbp Date: Fri, 26 Jan 2024 08:45:27 +0000 Subject: [PATCH 1/4] Icon .docxf added --- .../com/owncloud/android/utils/MimetypeIconUtil.java | 3 +++ owncloudApp/src/main/res/drawable/file_docxf.xml | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 owncloudApp/src/main/res/drawable/file_docxf.xml 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..4612d51bcf8 --- /dev/null +++ b/owncloudApp/src/main/res/drawable/file_docxf.xml @@ -0,0 +1,11 @@ + + + From 44a46116ecb529340dd795e81c838bd8a274afdd Mon Sep 17 00:00:00 2001 From: Aitorbp Date: Fri, 26 Jan 2024 09:05:10 +0000 Subject: [PATCH 2/4] Added calens --- changelog/unreleased/4297 | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 changelog/unreleased/4297 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 From a2a269917d5cb890c1d090c6b32a28ad8154f751 Mon Sep 17 00:00:00 2001 From: Aitorbp Date: Fri, 26 Jan 2024 09:05:47 +0000 Subject: [PATCH 3/4] Calens changelog updated --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) 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 From b2f6433757e820a030614587b5e2fd5c6949f3cd Mon Sep 17 00:00:00 2001 From: Aitorbp Date: Tue, 30 Jan 2024 11:19:51 +0000 Subject: [PATCH 4/4] Added condition for docxf extension --- .../presentation/files/filelist/MainFileListFragment.kt | 5 +++++ owncloudApp/src/main/res/drawable/file_docxf.xml | 2 +- owncloudApp/src/main/res/values/colors.xml | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) 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/res/drawable/file_docxf.xml b/owncloudApp/src/main/res/drawable/file_docxf.xml index 4612d51bcf8..ba0e7ec4c91 100644 --- a/owncloudApp/src/main/res/drawable/file_docxf.xml +++ b/owncloudApp/src/main/res/drawable/file_docxf.xml @@ -1,6 +1,6 @@ #f4511e #009688 + #66a6a3 + #6E758C #6E758C