ConversationsAdapter: code cleanup

This commit is contained in:
Daniel Gultsch 2017-11-20 11:12:11 +01:00
parent ff0e2ff8e4
commit 1780a4257f
1 changed files with 9 additions and 9 deletions

View File

@ -84,19 +84,19 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
|| message.getTransferable().getStatus() != Transferable.STATUS_DELETED)) {
mSenderName.setVisibility(View.GONE);
mLastMessage.setVisibility(View.GONE);
mLastMessageImage.setVisibility(View.GONE);
mLastMessageImage.setVisibility(View.GONE);
imagePreview.setVisibility(View.VISIBLE);
activity.loadBitmap(message, imagePreview);
} else {
final boolean showPreviewText;
if (message.getFileParams().runtime > 0) {
showPreviewText = false;
mLastMessageImage.setImageResource(activity.getThemeResource(R.attr.ic_attach_record, R.drawable.ic_attach_record));
mLastMessageImage.setVisibility(View.VISIBLE);
} else if (message.getType() == Message.TYPE_FILE) {
showPreviewText = true;
mLastMessageImage.setImageResource(activity.getThemeResource(R.attr.ic_attach_document, R.drawable.ic_attach_document));
if (message.getType() == Message.TYPE_FILE) {
if (message.getFileParams().runtime > 0) {
showPreviewText = false;
mLastMessageImage.setImageResource(activity.getThemeResource(R.attr.ic_attach_record, R.drawable.ic_attach_record));
} else {
showPreviewText = true;
mLastMessageImage.setImageResource(activity.getThemeResource(R.attr.ic_attach_document, R.drawable.ic_attach_document));
}
mLastMessageImage.setVisibility(View.VISIBLE);
} else if (message.isGeoUri()) {
showPreviewText = false;