Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
fix display issues with thumbnail on convo list
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed Feb 9, 2018
1 parent 525d341 commit d35e1e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,6 @@ public ConversationListItem(Context context, AttributeSet attrs) {
sPrettyTime = new PrettyTime(getCurrentLocale());
}

/**
public void bind(ConversationViewHolder holder, Cursor cursor, String underLineText, boolean scrolling) {
bind(holder, cursor, underLineText, true, scrolling);
}
*/

public void bind(ConversationViewHolder holder, long contactId, long providerId, long accountId, String address, String nickname, int contactType, String message, long messageDate, String messageType, int presence, int subscription, String underLineText, boolean showChatMsg, boolean scrolling, boolean isMuted) {

//applyStyleColors(holder);
Expand All @@ -130,13 +124,6 @@ public void bind(ConversationViewHolder holder, long contactId, long providerId,
nickname += " \uD83D\uDD15";
}

/**
if (Imps.Contacts.TYPE_GROUP == contactType) {
String groupCountString = getGroupCount(getContext().getContentResolver(), contactId);
nickname += groupCountString;
}**/

if (!TextUtils.isEmpty(underLineText)) {
// highlight/underline the word being searched
String lowercase = nickname.toLowerCase();
Expand Down Expand Up @@ -264,27 +251,31 @@ else if (messageType.startsWith("image"))
}
else if (messageType.startsWith("audio"))
{
mLastMediaUri = null;
holder.mMediaThumb.setVisibility(View.VISIBLE);
holder.mMediaThumb.setImageResource(R.drawable.ic_volume_up_black_24dp);
holder.mMediaThumb.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
holder.mMediaThumb.setImageResource(R.drawable.ic_volume_up_black_24dp);
holder.mLine2.setText("");
}
else if (messageType.startsWith("video"))
{
mLastMediaUri = null;
holder.mMediaThumb.setVisibility(View.VISIBLE);
holder.mMediaThumb.setImageResource(R.drawable.video256);
holder.mMediaThumb.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
holder.mMediaThumb.setImageResource(R.drawable.video256);
holder.mLine2.setText("");
}
else if (messageType.startsWith("application"))
{
mLastMediaUri = null;
holder.mMediaThumb.setVisibility(View.VISIBLE);
holder.mMediaThumb.setImageResource(R.drawable.ic_attach_file_black_36dp);
holder.mMediaThumb.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
holder.mMediaThumb.setImageResource(R.drawable.ic_attach_file_black_36dp);
holder.mLine2.setText("");
}
else
{
mLastMediaUri = null;
holder.mMediaThumb.setVisibility(View.GONE);
holder.mLine2.setText(messageType);
}
Expand All @@ -301,6 +292,7 @@ else if ((!TextUtils.isEmpty(message)) && message.startsWith("/"))
String mimeTypeSticker = "image/png";
Uri mediaUri = Uri.parse("asset://"+cmds[1]);

mLastMediaUri = null;
setThumbnail(getContext().getContentResolver(), holder, mediaUri, false);
holder.mLine2.setVisibility(View.GONE);

Expand Down Expand Up @@ -333,6 +325,7 @@ else if ((!TextUtils.isEmpty(message)) && message.startsWith(":"))

//now setup the new URI for loading local sticker asset
Uri mediaUri = Uri.parse("asset://localhost/" + stickerPath);
mLastMediaUri = null;
setThumbnail(getContext().getContentResolver(), holder, mediaUri, false);
holder.mLine2.setVisibility(View.GONE);
holder.mMediaThumb.setScaleType(ImageView.ScaleType.FIT_CENTER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2901,6 +2901,7 @@ public boolean onLongClick(View view) {
}
});


MessageViewHolder mvh = new MessageViewHolder(view);
mvh.setLayoutInflater(inflater);
mvh.setOnImageClickedListener(this);
Expand Down

0 comments on commit d35e1e5

Please sign in to comment.