aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/de/pixart/messenger/ui/adapter/MediaPreviewAdapter.java16
-rw-r--r--src/main/res/drawable-hdpi/ic_help_black_48dp.pngbin0 -> 1176 bytes
-rw-r--r--src/main/res/drawable-hdpi/ic_help_white_48dp.pngbin0 -> 1177 bytes
-rw-r--r--src/main/res/drawable-mdpi/ic_help_black_48dp.pngbin0 -> 656 bytes
-rw-r--r--src/main/res/drawable-mdpi/ic_help_white_48dp.pngbin0 -> 659 bytes
-rw-r--r--src/main/res/drawable-xhdpi/ic_help_black_48dp.pngbin0 -> 1406 bytes
-rw-r--r--src/main/res/drawable-xhdpi/ic_help_white_48dp.pngbin0 -> 1426 bytes
-rw-r--r--src/main/res/drawable-xxhdpi/ic_help_black_48dp.pngbin0 -> 2613 bytes
-rw-r--r--src/main/res/drawable-xxhdpi/ic_help_white_48dp.pngbin0 -> 2702 bytes
-rw-r--r--src/main/res/drawable-xxxhdpi/ic_help_black_48dp.pngbin0 -> 2945 bytes
-rw-r--r--src/main/res/drawable-xxxhdpi/ic_help_white_48dp.pngbin0 -> 3067 bytes
-rw-r--r--src/main/res/values/attrs.xml3
-rw-r--r--src/main/res/values/themes.xml6
13 files changed, 20 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MediaPreviewAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MediaPreviewAdapter.java
index c89ce6216..3d9bce508 100644
--- a/src/main/java/de/pixart/messenger/ui/adapter/MediaPreviewAdapter.java
+++ b/src/main/java/de/pixart/messenger/ui/adapter/MediaPreviewAdapter.java
@@ -17,6 +17,7 @@ import android.widget.ImageView;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.concurrent.RejectedExecutionException;
@@ -29,6 +30,15 @@ import de.pixart.messenger.ui.util.StyledAttributes;
public class MediaPreviewAdapter extends RecyclerView.Adapter<MediaPreviewAdapter.MediaPreviewViewHolder> {
+ private static final List<String> DOCUMENT_MIMES = Arrays.asList(
+ "application/pdf",
+ "application/vnd.oasis.opendocument.text",
+ "application/msword",
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
+ "text/x-tex",
+ "text/plain"
+ );
+
private final ArrayList<Attachment> mediaPreviews = new ArrayList<>();
private final ConversationFragment conversationFragment;
@@ -89,7 +99,7 @@ public class MediaPreviewAdapter extends RecyclerView.Adapter<MediaPreviewAdapte
} else {
final String mime = attachment.getMime();
if (mime == null) {
- attr = R.attr.media_preview_file;
+ attr = R.attr.media_preview_unknown;
} else if (mime.startsWith("audio/")) {
attr = R.attr.media_preview_audio;
} else if (mime.equals("text/calendar") || (mime.equals("text/x-vcalendar"))) {
@@ -100,8 +110,10 @@ public class MediaPreviewAdapter extends RecyclerView.Adapter<MediaPreviewAdapte
attr = R.attr.media_preview_app;
} else if (mime.equals("application/zip") || mime.equals("application/rar")) {
attr = R.attr.media_preview_archive;
+ } else if (DOCUMENT_MIMES.contains(mime)) {
+ attr = R.attr.media_preview_document;
} else {
- attr = R.attr.media_preview_file;
+ attr = R.attr.media_preview_unknown;
}
}
holder.binding.mediaPreview.setImageDrawable(StyledAttributes.getDrawable(context, attr));
diff --git a/src/main/res/drawable-hdpi/ic_help_black_48dp.png b/src/main/res/drawable-hdpi/ic_help_black_48dp.png
new file mode 100644
index 000000000..b2ea7914a
--- /dev/null
+++ b/src/main/res/drawable-hdpi/ic_help_black_48dp.png
Binary files differ
diff --git a/src/main/res/drawable-hdpi/ic_help_white_48dp.png b/src/main/res/drawable-hdpi/ic_help_white_48dp.png
new file mode 100644
index 000000000..6827c3fac
--- /dev/null
+++ b/src/main/res/drawable-hdpi/ic_help_white_48dp.png
Binary files differ
diff --git a/src/main/res/drawable-mdpi/ic_help_black_48dp.png b/src/main/res/drawable-mdpi/ic_help_black_48dp.png
new file mode 100644
index 000000000..3678f6f23
--- /dev/null
+++ b/src/main/res/drawable-mdpi/ic_help_black_48dp.png
Binary files differ
diff --git a/src/main/res/drawable-mdpi/ic_help_white_48dp.png b/src/main/res/drawable-mdpi/ic_help_white_48dp.png
new file mode 100644
index 000000000..68e4b1563
--- /dev/null
+++ b/src/main/res/drawable-mdpi/ic_help_white_48dp.png
Binary files differ
diff --git a/src/main/res/drawable-xhdpi/ic_help_black_48dp.png b/src/main/res/drawable-xhdpi/ic_help_black_48dp.png
new file mode 100644
index 000000000..066c88bbe
--- /dev/null
+++ b/src/main/res/drawable-xhdpi/ic_help_black_48dp.png
Binary files differ
diff --git a/src/main/res/drawable-xhdpi/ic_help_white_48dp.png b/src/main/res/drawable-xhdpi/ic_help_white_48dp.png
new file mode 100644
index 000000000..805ea1efb
--- /dev/null
+++ b/src/main/res/drawable-xhdpi/ic_help_white_48dp.png
Binary files differ
diff --git a/src/main/res/drawable-xxhdpi/ic_help_black_48dp.png b/src/main/res/drawable-xxhdpi/ic_help_black_48dp.png
new file mode 100644
index 000000000..2f8af6e41
--- /dev/null
+++ b/src/main/res/drawable-xxhdpi/ic_help_black_48dp.png
Binary files differ
diff --git a/src/main/res/drawable-xxhdpi/ic_help_white_48dp.png b/src/main/res/drawable-xxhdpi/ic_help_white_48dp.png
new file mode 100644
index 000000000..1a3e87205
--- /dev/null
+++ b/src/main/res/drawable-xxhdpi/ic_help_white_48dp.png
Binary files differ
diff --git a/src/main/res/drawable-xxxhdpi/ic_help_black_48dp.png b/src/main/res/drawable-xxxhdpi/ic_help_black_48dp.png
new file mode 100644
index 000000000..45e2e7b21
--- /dev/null
+++ b/src/main/res/drawable-xxxhdpi/ic_help_black_48dp.png
Binary files differ
diff --git a/src/main/res/drawable-xxxhdpi/ic_help_white_48dp.png b/src/main/res/drawable-xxxhdpi/ic_help_white_48dp.png
new file mode 100644
index 000000000..dc996ae81
--- /dev/null
+++ b/src/main/res/drawable-xxxhdpi/ic_help_white_48dp.png
Binary files differ
diff --git a/src/main/res/values/attrs.xml b/src/main/res/values/attrs.xml
index b10a13815..c8ccec47a 100644
--- a/src/main/res/values/attrs.xml
+++ b/src/main/res/values/attrs.xml
@@ -42,7 +42,7 @@
<attr name="conversations_overview_background" format="reference|color" />
- <attr name="media_preview_file" format="reference" />
+ <attr name="media_preview_document" format="reference" />
<attr name="media_preview_recording" format="reference" />
<attr name="media_preview_audio" format="reference" />
<attr name="media_preview_location" format="reference" />
@@ -50,6 +50,7 @@
<attr name="media_preview_app" format="reference" />
<attr name="media_preview_calendar" format="reference" />
<attr name="media_preview_archive" format="reference" />
+ <attr name="media_preview_unknown" format="reference" />
<attr name="icon_add_group" format="reference" />
<attr name="icon_add_person" format="reference" />
diff --git a/src/main/res/values/themes.xml b/src/main/res/values/themes.xml
index 628963db2..0d2eab4fe 100644
--- a/src/main/res/values/themes.xml
+++ b/src/main/res/values/themes.xml
@@ -65,7 +65,7 @@
</item>
<item name="ic_send_voice_offline" type="reference">@drawable/ic_send_voice_offline</item>
- <item name="media_preview_file" type="reference">@drawable/ic_description_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>
@@ -73,6 +73,7 @@
<item name="media_preview_app" type="reference">@drawable/ic_android_black_48dp</item>
<item name="media_preview_calendar" type="reference">@drawable/ic_event_black_48dp</item>
<item name="media_preview_archive" type="reference">@drawable/ic_archive_black_48dp</item>
+ <item name="media_preview_unknown" type="reference">@drawable/ic_help_black_48dp</item>
<item name="icon_add_group" type="reference">@drawable/ic_group_add_white_24dp</item>
<item name="icon_add_person" type="reference">@drawable/ic_person_add_white_24dp</item>
@@ -234,7 +235,7 @@
<item name="dialog_horizontal_padding">24dp</item>
<item name="dialog_vertical_padding">16dp</item>
- <item name="media_preview_file" type="reference">@drawable/ic_description_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>
@@ -242,6 +243,7 @@
<item name="media_preview_app" type="reference">@drawable/ic_android_white_48dp</item>
<item name="media_preview_calendar" type="reference">@drawable/ic_event_white_48dp</item>
<item name="media_preview_archive" type="reference">@drawable/ic_archive_white_48dp</item>
+ <item name="media_preview_unknown" type="reference">@drawable/ic_help_white_48dp</item>
<item name="icon_add_group" type="reference">@drawable/ic_group_add_white_24dp</item>
<item name="icon_add_person" type="reference">@drawable/ic_person_add_white_24dp</item>