Skip to content

Commit

Permalink
Merge pull request #4297 from owncloud/fix/add_placeholder_icon_for_d…
Browse files Browse the repository at this point in the history
…ocxf_files

[FEATURE REQUEST] Add placeholder icon for .docxf files
  • Loading branch information
Aitorbp committed Feb 2, 2024
2 parents d8a69d8 + f06d471 commit 3eced78
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions changelog/unreleased/4297
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"));
Expand Down
11 changes: 11 additions & 0 deletions owncloudApp/src/main/res/drawable/file_docxf.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector android:autoMirrored="true"
android:height="128dp"
android:tint="@color/file_docxf"
android:viewportHeight="24"
android:viewportWidth="24"
android:width="128dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillColor="@android:color/white"
android:pathData="M14,2H6C4.9,2 4.01,2.9 4.01,4L4,20c0,1.1 0.89,2 1.99,2H18c1.1,0 2,-0.9 2,-2V8L14,2zM10.94,18L7.4,14.46l1.41,-1.41l2.12,2.12l4.24,-4.24l1.41,1.41L10.94,18zM13,9V3.5L18.5,9H13z" />
</vector>
2 changes: 2 additions & 0 deletions owncloudApp/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
<color name="warning">#f4511e</color>
<color name="success">#009688</color>

<color name="file_docxf">#66a6a3</color>

<!-- Bottom Sheet Fragment -->
<color name="bottom_sheet_fragment_item_color">#6E758C</color>
<color name="bottom_sheet_fragment_title_color">#6E758C</color>
Expand Down

0 comments on commit 3eced78

Please sign in to comment.