From b6c951c02666ca5082ca0d5a508d5074a1bfba02 Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Tue, 5 Sep 2023 14:51:32 -0300 Subject: [PATCH] feat: add indicatives/hints of what type of media is on an media item without preview --- .../android/ui/displayitems/FileStatusDisplayItem.java | 8 +++++++- .../res/drawable/ic_fluent_video_clip_24_regular.xml | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 mastodon/src/main/res/drawable/ic_fluent_video_clip_24_regular.xml diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/FileStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/FileStatusDisplayItem.java index 0a2782267..7eafffe65 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/FileStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/FileStatusDisplayItem.java @@ -85,7 +85,13 @@ public class FileStatusDisplayItem extends StatusDisplayItem{ domain.setText(item.status.sensitive ? context.getString(R.string.sensitive_content_explain) : null); domain.setVisibility(item.status.sensitive ? View.VISIBLE : View.GONE); - icon.setImageDrawable(context.getDrawable(R.drawable.ic_fluent_image_24_regular)); + if(item.attachment.type == Attachment.Type.IMAGE) + icon.setImageDrawable(context.getDrawable(R.drawable.ic_fluent_image_24_regular)); + if(item.attachment.type == Attachment.Type.VIDEO) + icon.setImageDrawable(context.getDrawable(R.drawable.ic_fluent_video_clip_24_regular)); + if(item.attachment.type == Attachment.Type.GIFV) + icon.setImageDrawable(context.getDrawable(R.drawable.ic_fluent_gif_24_regular)); + } } diff --git a/mastodon/src/main/res/drawable/ic_fluent_video_clip_24_regular.xml b/mastodon/src/main/res/drawable/ic_fluent_video_clip_24_regular.xml new file mode 100644 index 000000000..98eeae2db --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_video_clip_24_regular.xml @@ -0,0 +1,9 @@ + + +