aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-05-21 23:06:03 +0200
committerChristian Schneppe <christian@pix-art.de>2016-05-21 23:06:03 +0200
commit640aa7aee071159488857dff04fa2e8b49506c30 (patch)
tree9c9aac18319527dacc0d8ad80c2d1b18c81cc664 /src/main/java
parent366e04d81feb9a403f643bfe9aee0cd934993cbd (diff)
show videopreview also in chatlist
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
index afef5a1d1..9a6c24a83 100644
--- a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
+++ b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
@@ -3,12 +3,10 @@ package eu.siacs.conversations.ui.adapter;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
-import android.graphics.Color;
import android.graphics.Typeface;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
-import android.support.v4.content.ContextCompat;
import android.util.Pair;
import android.view.LayoutInflater;
import android.view.View;
@@ -90,6 +88,7 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
ImageView notificationStatus = (ImageView) view.findViewById(R.id.notification_status);
Message message = conversation.getLatestMessage();
+ String mimeType = message.getMimeType();
if (!conversation.isRead()) {
convName.setTypeface(null, Typeface.BOLD);
@@ -97,7 +96,13 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
convName.setTypeface(null, Typeface.NORMAL);
}
- if (message.getFileParams().width > 0
+ if (mimeType != null) {
+ if (message.getMimeType().startsWith("video/")) {
+ mLastMessage.setVisibility(View.GONE);
+ imagePreview.setVisibility(View.VISIBLE);
+ activity.loadVideoPreview(message, imagePreview);
+ }
+ } else if (message.getFileParams().width > 0
&& (message.getTransferable() == null
|| message.getTransferable().getStatus() != Transferable.STATUS_DELETED)) {
mLastMessage.setVisibility(View.GONE);