diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2021-05-14 09:37:42 +0300 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2021-05-14 09:37:42 +0300 |
commit | e02aaed7d23d176d95bdcc6ed20653ab286c441d (patch) | |
tree | cc8c37b007f230fa778fe5b3ae19cd14f6a547c9 /src/main | |
parent | c9f1bdc55197e97e32ef937abdaf8b8eecbf7056 (diff) |
call SVGs 'vector graphic' instead of 'image'
Diffstat (limited to 'src/main')
15 files changed, 11 insertions, 8 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MediaAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MediaAdapter.java index 75ab964f4..21473dafd 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MediaAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MediaAdapter.java @@ -92,6 +92,8 @@ public class MediaAdapter extends RecyclerView.Adapter<MediaAdapter.MediaViewHol attr = R.attr.media_preview_document; } else if (mime.equals("application/gpx+xml")) { attr = R.attr.media_preview_tour; + } else if (mime.startsWith("image/")) { + attr = R.attr.media_preview_image; } else { attr = R.attr.media_preview_unknown; } diff --git a/src/main/java/eu/siacs/conversations/utils/UIHelper.java b/src/main/java/eu/siacs/conversations/utils/UIHelper.java index a686f8697..c8b9823ee 100644 --- a/src/main/java/eu/siacs/conversations/utils/UIHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/UIHelper.java @@ -475,9 +475,6 @@ public class UIHelper { } public static String getFileDescriptionString(final Context context, final Message message) { - if (message.getType() == Message.TYPE_IMAGE) { - return context.getString(R.string.image); - } final String mime = message.getMimeType(); if (mime == null) { return context.getString(R.string.file); @@ -487,7 +484,9 @@ public class UIHelper { return context.getString(R.string.video); } else if (mime.equals("image/gif")) { return context.getString(R.string.gif); - } else if (mime.startsWith("image/")) { + } else if (mime.equals("image/svg+xml")) { + return context.getString(R.string.vector_graphic); + } else if (mime.startsWith("image/") || message.getType() == Message.TYPE_IMAGE) { return context.getString(R.string.image); } else if (mime.contains("pdf")) { return context.getString(R.string.pdf_document); diff --git a/src/main/res/drawable-hdpi/ic_image_black_48dp.png b/src/main/res/drawable-hdpi/ic_image_black_48dp.png Binary files differnew file mode 100644 index 000000000..7297bd5d2 --- /dev/null +++ b/src/main/res/drawable-hdpi/ic_image_black_48dp.png diff --git a/src/main/res/drawable-hdpi/ic_image_white_48dp.png b/src/main/res/drawable-hdpi/ic_image_white_48dp.png Binary files differnew file mode 100644 index 000000000..f9f1defa6 --- /dev/null +++ b/src/main/res/drawable-hdpi/ic_image_white_48dp.png diff --git a/src/main/res/drawable-mdpi/ic_image_black_48dp.png b/src/main/res/drawable-mdpi/ic_image_black_48dp.png Binary files differnew file mode 100644 index 000000000..6b7cd7838 --- /dev/null +++ b/src/main/res/drawable-mdpi/ic_image_black_48dp.png diff --git a/src/main/res/drawable-mdpi/ic_image_white_48dp.png b/src/main/res/drawable-mdpi/ic_image_white_48dp.png Binary files differnew file mode 100644 index 000000000..2642b9e09 --- /dev/null +++ b/src/main/res/drawable-mdpi/ic_image_white_48dp.png diff --git a/src/main/res/drawable-xhdpi/ic_image_black_48dp.png b/src/main/res/drawable-xhdpi/ic_image_black_48dp.png Binary files differnew file mode 100644 index 000000000..ebe206ff7 --- /dev/null +++ b/src/main/res/drawable-xhdpi/ic_image_black_48dp.png diff --git a/src/main/res/drawable-xhdpi/ic_image_white_48dp.png b/src/main/res/drawable-xhdpi/ic_image_white_48dp.png Binary files differnew file mode 100644 index 000000000..2ffdb55f2 --- /dev/null +++ b/src/main/res/drawable-xhdpi/ic_image_white_48dp.png diff --git a/src/main/res/drawable-xxhdpi/ic_image_black_48dp.png b/src/main/res/drawable-xxhdpi/ic_image_black_48dp.png Binary files differnew file mode 100644 index 000000000..b2a6b6448 --- /dev/null +++ b/src/main/res/drawable-xxhdpi/ic_image_black_48dp.png diff --git a/src/main/res/drawable-xxhdpi/ic_image_white_48dp.png b/src/main/res/drawable-xxhdpi/ic_image_white_48dp.png Binary files differnew file mode 100644 index 000000000..3fe5c5ceb --- /dev/null +++ b/src/main/res/drawable-xxhdpi/ic_image_white_48dp.png diff --git a/src/main/res/drawable-xxxhdpi/ic_image_black_48dp.png b/src/main/res/drawable-xxxhdpi/ic_image_black_48dp.png Binary files differnew file mode 100644 index 000000000..ab700a31b --- /dev/null +++ b/src/main/res/drawable-xxxhdpi/ic_image_black_48dp.png diff --git a/src/main/res/drawable-xxxhdpi/ic_image_white_48dp.png b/src/main/res/drawable-xxxhdpi/ic_image_white_48dp.png Binary files differnew file mode 100644 index 000000000..7d5091ded --- /dev/null +++ b/src/main/res/drawable-xxxhdpi/ic_image_white_48dp.png diff --git a/src/main/res/values/attrs.xml b/src/main/res/values/attrs.xml index fc05b1696..2a9a4a8e6 100644 --- a/src/main/res/values/attrs.xml +++ b/src/main/res/values/attrs.xml @@ -62,6 +62,7 @@ <attr name="icon_alpha" format="float" /> <attr name="delete_icon_alpha" format="float" /> + <attr name="media_preview_image" format="reference" /> <attr name="media_preview_document" format="reference" /> <attr name="media_preview_recording" format="reference" /> <attr name="media_preview_audio" format="reference" /> diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index c9ad3d891..87c44a9fd 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -412,6 +412,7 @@ <string name="audio">audio</string> <string name="video">video</string> <string name="image">image</string> + <string name="vector_graphic">vector graphic</string> <string name="pdf_document">PDF document</string> <string name="apk">Android App</string> <string name="vcard">Contact</string> diff --git a/src/main/res/values/themes.xml b/src/main/res/values/themes.xml index 0ba1106fe..9e757a626 100644 --- a/src/main/res/values/themes.xml +++ b/src/main/res/values/themes.xml @@ -80,8 +80,8 @@ <item name="dialog_horizontal_padding">24dp</item> <item name="dialog_vertical_padding">16dp</item> - <item name="media_preview_document" type="reference">@drawable/ic_description_black_48dp - </item> + <item name="media_preview_image" type="reference">@drawable/ic_image_black_48dp</item> + <item name="media_preview_document" type="reference">@drawable/ic_description_black_48dp</item> <item name="media_preview_recording" type="reference">@drawable/ic_mic_black_48dp</item> <item name="media_preview_audio" type="reference">@drawable/ic_headset_black_48dp</item> <item name="media_preview_location" type="reference">@drawable/ic_room_black_48dp</item> @@ -236,8 +236,8 @@ <item name="dialog_horizontal_padding">24dp</item> <item name="dialog_vertical_padding">16dp</item> - <item name="media_preview_document" type="reference">@drawable/ic_description_white_48dp - </item> + <item name="media_preview_image" type="reference">@drawable/ic_image_white_48dp</item> + <item name="media_preview_document" type="reference">@drawable/ic_description_white_48dp</item> <item name="media_preview_recording" type="reference">@drawable/ic_mic_white_48dp</item> <item name="media_preview_audio" type="reference">@drawable/ic_headset_white_48dp</item> <item name="media_preview_location" type="reference">@drawable/ic_room_white_48dp</item> |