2014-08-15 11:18:15 +00:00
|
|
|
package eu.siacs.conversations.ui.adapter;
|
|
|
|
|
2015-01-11 15:22:29 +00:00
|
|
|
import android.content.Context;
|
2015-02-15 17:48:05 +00:00
|
|
|
import android.content.res.Resources;
|
|
|
|
import android.graphics.Bitmap;
|
2015-01-11 15:22:29 +00:00
|
|
|
import android.graphics.Typeface;
|
2015-02-15 17:48:05 +00:00
|
|
|
import android.graphics.drawable.BitmapDrawable;
|
|
|
|
import android.graphics.drawable.Drawable;
|
|
|
|
import android.os.AsyncTask;
|
2018-03-11 11:13:56 +00:00
|
|
|
import android.support.annotation.NonNull;
|
2018-04-06 11:49:50 +00:00
|
|
|
import android.support.v7.widget.RecyclerView;
|
2015-01-12 15:09:39 +00:00
|
|
|
import android.util.Pair;
|
2015-01-11 15:22:29 +00:00
|
|
|
import android.view.LayoutInflater;
|
|
|
|
import android.view.View;
|
|
|
|
import android.view.ViewGroup;
|
2018-05-03 16:30:44 +00:00
|
|
|
import android.widget.FrameLayout;
|
2015-01-11 15:22:29 +00:00
|
|
|
import android.widget.ImageView;
|
|
|
|
import android.widget.TextView;
|
|
|
|
|
2015-02-15 17:48:05 +00:00
|
|
|
import java.lang.ref.WeakReference;
|
2014-08-15 11:18:15 +00:00
|
|
|
import java.util.List;
|
2015-02-15 17:48:05 +00:00
|
|
|
import java.util.concurrent.RejectedExecutionException;
|
2014-08-15 11:18:15 +00:00
|
|
|
|
|
|
|
import eu.siacs.conversations.R;
|
|
|
|
import eu.siacs.conversations.entities.Conversation;
|
|
|
|
import eu.siacs.conversations.entities.Message;
|
2015-07-20 12:26:29 +00:00
|
|
|
import eu.siacs.conversations.entities.Transferable;
|
2018-05-03 16:30:44 +00:00
|
|
|
import eu.siacs.conversations.ui.ConversationFragment;
|
2014-09-02 13:51:20 +00:00
|
|
|
import eu.siacs.conversations.ui.XmppActivity;
|
2018-09-12 12:37:41 +00:00
|
|
|
import eu.siacs.conversations.ui.util.StyledAttributes;
|
2017-03-02 21:24:58 +00:00
|
|
|
import eu.siacs.conversations.ui.widget.UnreadCountCustomView;
|
2017-11-23 08:36:51 +00:00
|
|
|
import eu.siacs.conversations.utils.EmojiWrapper;
|
2018-03-11 11:13:56 +00:00
|
|
|
import eu.siacs.conversations.utils.IrregularUnicodeDetector;
|
2014-08-15 11:18:15 +00:00
|
|
|
import eu.siacs.conversations.utils.UIHelper;
|
2018-03-11 11:13:56 +00:00
|
|
|
import rocks.xmpp.addr.Jid;
|
2014-08-15 11:18:15 +00:00
|
|
|
|
2018-04-06 11:49:50 +00:00
|
|
|
public class ConversationAdapter extends RecyclerView.Adapter<ConversationAdapter.ConversationViewHolder> {
|
2014-08-15 11:18:15 +00:00
|
|
|
|
2014-09-02 13:51:20 +00:00
|
|
|
private XmppActivity activity;
|
2018-04-06 11:49:50 +00:00
|
|
|
private List<Conversation> conversations;
|
|
|
|
private OnConversationClickListener listener;
|
2014-08-15 11:18:15 +00:00
|
|
|
|
2017-11-13 17:37:12 +00:00
|
|
|
public ConversationAdapter(XmppActivity activity, List<Conversation> conversations) {
|
2014-08-15 11:18:15 +00:00
|
|
|
this.activity = activity;
|
2018-04-06 11:49:50 +00:00
|
|
|
this.conversations = conversations;
|
2014-08-15 11:18:15 +00:00
|
|
|
}
|
|
|
|
|
2018-03-17 18:18:22 +00:00
|
|
|
private static boolean cancelPotentialWork(Conversation conversation, ImageView imageView) {
|
|
|
|
final BitmapWorkerTask bitmapWorkerTask = getBitmapWorkerTask(imageView);
|
|
|
|
|
|
|
|
if (bitmapWorkerTask != null) {
|
|
|
|
final Conversation oldConversation = bitmapWorkerTask.conversation;
|
|
|
|
if (oldConversation == null || conversation != oldConversation) {
|
|
|
|
bitmapWorkerTask.cancel(true);
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
private static BitmapWorkerTask getBitmapWorkerTask(ImageView imageView) {
|
|
|
|
if (imageView != null) {
|
|
|
|
final Drawable drawable = imageView.getDrawable();
|
|
|
|
if (drawable instanceof AsyncDrawable) {
|
|
|
|
final AsyncDrawable asyncDrawable = (AsyncDrawable) drawable;
|
|
|
|
return asyncDrawable.getBitmapWorkerTask();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2018-04-06 11:49:50 +00:00
|
|
|
@NonNull
|
2014-08-15 11:18:15 +00:00
|
|
|
@Override
|
2018-04-06 11:49:50 +00:00
|
|
|
public ConversationViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
|
|
|
LayoutInflater inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
|
|
View view = inflater.inflate(R.layout.conversation_list_row, parent, false);
|
2018-05-03 16:30:44 +00:00
|
|
|
return ConversationViewHolder.get(view);
|
2018-04-06 11:49:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onBindViewHolder(@NonNull ConversationViewHolder viewHolder, int position) {
|
|
|
|
Conversation conversation = conversations.get(position);
|
2018-03-17 18:18:22 +00:00
|
|
|
if (conversation == null) {
|
2018-04-06 11:49:50 +00:00
|
|
|
return;
|
2014-08-15 11:18:15 +00:00
|
|
|
}
|
2018-06-23 07:29:29 +00:00
|
|
|
CharSequence name = conversation.getName();
|
|
|
|
if (name instanceof Jid) {
|
|
|
|
viewHolder.name.setText(IrregularUnicodeDetector.style(activity, (Jid) name));
|
2014-09-22 11:23:35 +00:00
|
|
|
} else {
|
2018-06-23 07:29:29 +00:00
|
|
|
viewHolder.name.setText(EmojiWrapper.transform(name));
|
2014-09-22 11:23:35 +00:00
|
|
|
}
|
2014-08-15 11:18:15 +00:00
|
|
|
|
2018-06-24 14:59:27 +00:00
|
|
|
if (conversation == ConversationFragment.getConversation(activity)) {
|
2018-09-12 12:37:41 +00:00
|
|
|
viewHolder.frame.setBackgroundColor(StyledAttributes.getColor(activity,R.attr.color_background_tertiary));
|
2018-06-24 14:59:27 +00:00
|
|
|
} else {
|
2018-09-12 12:37:41 +00:00
|
|
|
viewHolder.frame.setBackgroundColor(StyledAttributes.getColor(activity,R.attr.color_background_primary));
|
2018-06-24 14:59:27 +00:00
|
|
|
}
|
2018-05-03 16:30:44 +00:00
|
|
|
|
2014-10-15 17:32:12 +00:00
|
|
|
Message message = conversation.getLatestMessage();
|
2018-03-17 18:18:22 +00:00
|
|
|
final int unreadCount = conversation.unreadCount();
|
|
|
|
final boolean isRead = conversation.isRead();
|
|
|
|
final Conversation.Draft draft = isRead ? conversation.getDraft() : null;
|
2017-03-17 11:55:33 +00:00
|
|
|
if (unreadCount > 0) {
|
2017-11-23 08:59:49 +00:00
|
|
|
viewHolder.unreadCount.setVisibility(View.VISIBLE);
|
|
|
|
viewHolder.unreadCount.setUnreadCount(unreadCount);
|
2017-03-17 11:55:33 +00:00
|
|
|
} else {
|
2017-11-23 08:59:49 +00:00
|
|
|
viewHolder.unreadCount.setVisibility(View.GONE);
|
2017-03-17 11:55:33 +00:00
|
|
|
}
|
2014-08-15 11:18:15 +00:00
|
|
|
|
2018-03-17 18:18:22 +00:00
|
|
|
if (isRead) {
|
2017-11-23 08:59:49 +00:00
|
|
|
viewHolder.name.setTypeface(null, Typeface.NORMAL);
|
2018-03-17 18:18:22 +00:00
|
|
|
} else {
|
|
|
|
viewHolder.name.setTypeface(null, Typeface.BOLD);
|
2014-10-15 17:32:12 +00:00
|
|
|
}
|
|
|
|
|
2018-03-17 18:18:22 +00:00
|
|
|
if (draft != null) {
|
2017-12-05 13:14:52 +00:00
|
|
|
viewHolder.lastMessageIcon.setVisibility(View.GONE);
|
2018-03-17 18:18:22 +00:00
|
|
|
viewHolder.lastMessage.setText(EmojiWrapper.transform(draft.getMessage()));
|
|
|
|
viewHolder.sender.setText(R.string.draft);
|
|
|
|
viewHolder.sender.setVisibility(View.VISIBLE);
|
|
|
|
viewHolder.lastMessage.setTypeface(null, Typeface.NORMAL);
|
|
|
|
viewHolder.sender.setTypeface(null, Typeface.ITALIC);
|
2017-12-05 13:14:52 +00:00
|
|
|
} else {
|
2019-01-10 13:52:27 +00:00
|
|
|
final boolean fileAvailable = !message.isDeleted();
|
2018-03-17 18:18:22 +00:00
|
|
|
final boolean showPreviewText;
|
|
|
|
if (fileAvailable && (message.isFileOrImage() || message.treatAsDownloadable() || message.isGeoUri())) {
|
|
|
|
final int imageResource;
|
|
|
|
if (message.isGeoUri()) {
|
|
|
|
imageResource = activity.getThemeResource(R.attr.ic_attach_location, R.drawable.ic_attach_location);
|
|
|
|
showPreviewText = false;
|
|
|
|
} else {
|
|
|
|
final String mime = message.getMimeType();
|
|
|
|
switch (mime == null ? "" : mime.split("/")[0]) {
|
|
|
|
case "image":
|
|
|
|
imageResource = activity.getThemeResource(R.attr.ic_attach_photo, R.drawable.ic_attach_photo);
|
|
|
|
showPreviewText = false;
|
|
|
|
break;
|
|
|
|
case "video":
|
|
|
|
imageResource = activity.getThemeResource(R.attr.ic_attach_videocam, R.drawable.ic_attach_videocam);
|
|
|
|
showPreviewText = false;
|
|
|
|
break;
|
|
|
|
case "audio":
|
|
|
|
imageResource = activity.getThemeResource(R.attr.ic_attach_record, R.drawable.ic_attach_record);
|
|
|
|
showPreviewText = false;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
imageResource = activity.getThemeResource(R.attr.ic_attach_document, R.drawable.ic_attach_document);
|
|
|
|
showPreviewText = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
viewHolder.lastMessageIcon.setImageResource(imageResource);
|
|
|
|
viewHolder.lastMessageIcon.setVisibility(View.VISIBLE);
|
2017-11-13 17:37:12 +00:00
|
|
|
} else {
|
2018-03-17 18:18:22 +00:00
|
|
|
viewHolder.lastMessageIcon.setVisibility(View.GONE);
|
|
|
|
showPreviewText = true;
|
2017-11-13 17:37:12 +00:00
|
|
|
}
|
2018-05-06 09:22:20 +00:00
|
|
|
final Pair<CharSequence, Boolean> preview = UIHelper.getMessagePreview(activity, message, viewHolder.lastMessage.getCurrentTextColor());
|
2018-03-17 18:18:22 +00:00
|
|
|
if (showPreviewText) {
|
2018-05-06 09:22:20 +00:00
|
|
|
viewHolder.lastMessage.setText(EmojiWrapper.transform(UIHelper.shorten(preview.first)));
|
2014-10-15 17:32:12 +00:00
|
|
|
} else {
|
2018-03-17 18:18:22 +00:00
|
|
|
viewHolder.lastMessageIcon.setContentDescription(preview.first);
|
2014-10-15 17:32:12 +00:00
|
|
|
}
|
2018-03-17 18:18:22 +00:00
|
|
|
viewHolder.lastMessage.setVisibility(showPreviewText ? View.VISIBLE : View.GONE);
|
|
|
|
if (preview.second) {
|
|
|
|
if (isRead) {
|
|
|
|
viewHolder.lastMessage.setTypeface(null, Typeface.ITALIC);
|
|
|
|
viewHolder.sender.setTypeface(null, Typeface.NORMAL);
|
|
|
|
} else {
|
|
|
|
viewHolder.lastMessage.setTypeface(null, Typeface.BOLD_ITALIC);
|
|
|
|
viewHolder.sender.setTypeface(null, Typeface.BOLD);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (isRead) {
|
|
|
|
viewHolder.lastMessage.setTypeface(null, Typeface.NORMAL);
|
|
|
|
viewHolder.sender.setTypeface(null, Typeface.NORMAL);
|
|
|
|
} else {
|
|
|
|
viewHolder.lastMessage.setTypeface(null, Typeface.BOLD);
|
|
|
|
viewHolder.sender.setTypeface(null, Typeface.BOLD);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (message.getStatus() == Message.STATUS_RECEIVED) {
|
|
|
|
if (conversation.getMode() == Conversation.MODE_MULTI) {
|
|
|
|
viewHolder.sender.setVisibility(View.VISIBLE);
|
|
|
|
viewHolder.sender.setText(UIHelper.getMessageDisplayName(message).split("\\s+")[0] + ':');
|
|
|
|
} else {
|
|
|
|
viewHolder.sender.setVisibility(View.GONE);
|
|
|
|
}
|
|
|
|
} else if (message.getType() != Message.TYPE_STATUS) {
|
2017-11-23 08:59:49 +00:00
|
|
|
viewHolder.sender.setVisibility(View.VISIBLE);
|
2018-03-17 18:18:22 +00:00
|
|
|
viewHolder.sender.setText(activity.getString(R.string.me) + ':');
|
2017-03-07 08:22:42 +00:00
|
|
|
} else {
|
2017-11-23 08:59:49 +00:00
|
|
|
viewHolder.sender.setVisibility(View.GONE);
|
2017-03-06 08:02:43 +00:00
|
|
|
}
|
2014-08-15 11:18:15 +00:00
|
|
|
}
|
|
|
|
|
2018-03-17 18:18:22 +00:00
|
|
|
long muted_till = conversation.getLongAttribute(Conversation.ATTRIBUTE_MUTED_TILL, 0);
|
2016-01-08 13:41:55 +00:00
|
|
|
if (muted_till == Long.MAX_VALUE) {
|
2017-11-23 08:59:49 +00:00
|
|
|
viewHolder.notificationIcon.setVisibility(View.VISIBLE);
|
2018-03-17 18:18:22 +00:00
|
|
|
int ic_notifications_off = activity.getThemeResource(R.attr.icon_notifications_off, R.drawable.ic_notifications_off_black_24dp);
|
2017-11-23 08:59:49 +00:00
|
|
|
viewHolder.notificationIcon.setImageResource(ic_notifications_off);
|
2016-01-08 13:41:55 +00:00
|
|
|
} else if (muted_till >= System.currentTimeMillis()) {
|
2017-11-23 08:59:49 +00:00
|
|
|
viewHolder.notificationIcon.setVisibility(View.VISIBLE);
|
2017-06-03 22:05:02 +00:00
|
|
|
int ic_notifications_paused = activity.getThemeResource(R.attr.icon_notifications_paused, R.drawable.ic_notifications_paused_black_24dp);
|
2017-11-23 08:59:49 +00:00
|
|
|
viewHolder.notificationIcon.setImageResource(ic_notifications_paused);
|
2016-01-08 20:30:46 +00:00
|
|
|
} else if (conversation.alwaysNotify()) {
|
2017-11-23 08:59:49 +00:00
|
|
|
viewHolder.notificationIcon.setVisibility(View.GONE);
|
2016-01-08 20:30:46 +00:00
|
|
|
} else {
|
2017-11-23 08:59:49 +00:00
|
|
|
viewHolder.notificationIcon.setVisibility(View.VISIBLE);
|
2018-03-17 18:18:22 +00:00
|
|
|
int ic_notifications_none = activity.getThemeResource(R.attr.icon_notifications_none, R.drawable.ic_notifications_none_black_24dp);
|
2017-11-23 08:59:49 +00:00
|
|
|
viewHolder.notificationIcon.setImageResource(ic_notifications_none);
|
2016-01-08 13:41:55 +00:00
|
|
|
}
|
|
|
|
|
2018-03-17 18:18:22 +00:00
|
|
|
long timestamp;
|
|
|
|
if (draft != null) {
|
|
|
|
timestamp = draft.getTimestamp();
|
|
|
|
} else {
|
|
|
|
timestamp = conversation.getLatestMessage().getTimeSent();
|
|
|
|
}
|
|
|
|
viewHolder.timestamp.setText(UIHelper.readableTimeDifference(activity, timestamp));
|
2017-11-23 08:59:49 +00:00
|
|
|
loadAvatar(conversation, viewHolder.avatar);
|
2018-04-06 11:49:50 +00:00
|
|
|
viewHolder.itemView.setOnClickListener(v -> listener.onConversationClick(v,conversation));
|
2014-08-15 11:18:15 +00:00
|
|
|
}
|
2015-02-15 17:48:05 +00:00
|
|
|
|
2018-02-22 18:49:39 +00:00
|
|
|
@Override
|
2018-04-06 11:49:50 +00:00
|
|
|
public int getItemCount() {
|
|
|
|
return conversations.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setConversationClickListener(OnConversationClickListener listener) {
|
|
|
|
this.listener = listener;
|
2018-02-22 18:49:39 +00:00
|
|
|
}
|
|
|
|
|
2018-03-17 18:18:22 +00:00
|
|
|
private void loadAvatar(Conversation conversation, ImageView imageView) {
|
|
|
|
if (cancelPotentialWork(conversation, imageView)) {
|
|
|
|
final Bitmap bm = activity.avatarService().get(conversation, activity.getPixel(56), true);
|
|
|
|
if (bm != null) {
|
|
|
|
cancelPotentialWork(conversation, imageView);
|
|
|
|
imageView.setImageBitmap(bm);
|
|
|
|
imageView.setBackgroundColor(0x00000000);
|
|
|
|
} else {
|
|
|
|
imageView.setBackgroundColor(UIHelper.getColorForName(conversation.getName().toString()));
|
|
|
|
imageView.setImageDrawable(null);
|
|
|
|
final BitmapWorkerTask task = new BitmapWorkerTask(imageView);
|
|
|
|
final AsyncDrawable asyncDrawable = new AsyncDrawable(activity.getResources(), null, task);
|
|
|
|
imageView.setImageDrawable(asyncDrawable);
|
|
|
|
try {
|
|
|
|
task.execute(conversation);
|
|
|
|
} catch (final RejectedExecutionException ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-06 11:49:50 +00:00
|
|
|
public void insert(Conversation c, int position) {
|
|
|
|
conversations.add(position,c);
|
|
|
|
notifyDataSetChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void remove(Conversation conversation,int position) {
|
|
|
|
conversations.remove(conversation);
|
|
|
|
notifyItemRemoved(position);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static class ConversationViewHolder extends RecyclerView.ViewHolder {
|
2017-11-23 08:59:49 +00:00
|
|
|
private TextView name;
|
|
|
|
private TextView lastMessage;
|
|
|
|
private ImageView lastMessageIcon;
|
|
|
|
private TextView sender;
|
|
|
|
private TextView timestamp;
|
|
|
|
private ImageView notificationIcon;
|
|
|
|
private UnreadCountCustomView unreadCount;
|
|
|
|
private ImageView avatar;
|
2018-05-03 16:30:44 +00:00
|
|
|
private FrameLayout frame;
|
2017-11-23 08:59:49 +00:00
|
|
|
|
2018-04-06 11:49:50 +00:00
|
|
|
private ConversationViewHolder(View view) {
|
|
|
|
super(view);
|
2017-11-23 08:59:49 +00:00
|
|
|
}
|
|
|
|
|
2018-04-06 11:49:50 +00:00
|
|
|
public static ConversationViewHolder get(View layout) {
|
|
|
|
ConversationViewHolder conversationViewHolder = (ConversationViewHolder) layout.getTag();
|
|
|
|
if (conversationViewHolder == null) {
|
|
|
|
conversationViewHolder = new ConversationViewHolder(layout);
|
2018-05-03 16:30:44 +00:00
|
|
|
conversationViewHolder.frame = layout.findViewById(R.id.frame);
|
2018-04-06 11:49:50 +00:00
|
|
|
conversationViewHolder.name = layout.findViewById(R.id.conversation_name);
|
|
|
|
conversationViewHolder.lastMessage = layout.findViewById(R.id.conversation_lastmsg);
|
|
|
|
conversationViewHolder.lastMessageIcon = layout.findViewById(R.id.conversation_lastmsg_img);
|
|
|
|
conversationViewHolder.timestamp = layout.findViewById(R.id.conversation_lastupdate);
|
|
|
|
conversationViewHolder.sender = layout.findViewById(R.id.sender_name);
|
|
|
|
conversationViewHolder.notificationIcon = layout.findViewById(R.id.notification_status);
|
|
|
|
conversationViewHolder.unreadCount = layout.findViewById(R.id.unread_count);
|
|
|
|
conversationViewHolder.avatar = layout.findViewById(R.id.conversation_image);
|
|
|
|
layout.setTag(conversationViewHolder);
|
2017-11-23 08:59:49 +00:00
|
|
|
}
|
2018-04-06 11:49:50 +00:00
|
|
|
return conversationViewHolder;
|
2017-11-23 08:59:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-17 18:18:22 +00:00
|
|
|
static class AsyncDrawable extends BitmapDrawable {
|
|
|
|
private final WeakReference<BitmapWorkerTask> bitmapWorkerTaskReference;
|
|
|
|
|
|
|
|
public AsyncDrawable(Resources res, Bitmap bitmap, BitmapWorkerTask bitmapWorkerTask) {
|
|
|
|
super(res, bitmap);
|
|
|
|
bitmapWorkerTaskReference = new WeakReference<>(bitmapWorkerTask);
|
|
|
|
}
|
|
|
|
|
|
|
|
public BitmapWorkerTask getBitmapWorkerTask() {
|
|
|
|
return bitmapWorkerTaskReference.get();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-15 17:48:05 +00:00
|
|
|
class BitmapWorkerTask extends AsyncTask<Conversation, Void, Bitmap> {
|
|
|
|
private final WeakReference<ImageView> imageViewReference;
|
|
|
|
private Conversation conversation = null;
|
|
|
|
|
|
|
|
public BitmapWorkerTask(ImageView imageView) {
|
|
|
|
imageViewReference = new WeakReference<>(imageView);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected Bitmap doInBackground(Conversation... params) {
|
2018-02-19 09:26:17 +00:00
|
|
|
this.conversation = params[0];
|
|
|
|
return activity.avatarService().get(this.conversation, activity.getPixel(56), isCancelled());
|
2015-02-15 17:48:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onPostExecute(Bitmap bitmap) {
|
2016-04-29 18:38:23 +00:00
|
|
|
if (bitmap != null && !isCancelled()) {
|
2015-02-15 17:48:05 +00:00
|
|
|
final ImageView imageView = imageViewReference.get();
|
|
|
|
if (imageView != null) {
|
|
|
|
imageView.setImageBitmap(bitmap);
|
|
|
|
imageView.setBackgroundColor(0x00000000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-04-06 11:49:50 +00:00
|
|
|
|
|
|
|
public interface OnConversationClickListener {
|
|
|
|
void onConversationClick(View view, Conversation conversation);
|
|
|
|
}
|
2017-11-02 09:10:20 +00:00
|
|
|
}
|