ConversationsAdapter: code cleanup
This commit is contained in:
parent
ff0e2ff8e4
commit
1780a4257f
|
@ -84,19 +84,19 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
|
||||||
|| message.getTransferable().getStatus() != Transferable.STATUS_DELETED)) {
|
|| message.getTransferable().getStatus() != Transferable.STATUS_DELETED)) {
|
||||||
mSenderName.setVisibility(View.GONE);
|
mSenderName.setVisibility(View.GONE);
|
||||||
mLastMessage.setVisibility(View.GONE);
|
mLastMessage.setVisibility(View.GONE);
|
||||||
mLastMessageImage.setVisibility(View.GONE);
|
mLastMessageImage.setVisibility(View.GONE);
|
||||||
imagePreview.setVisibility(View.VISIBLE);
|
imagePreview.setVisibility(View.VISIBLE);
|
||||||
activity.loadBitmap(message, imagePreview);
|
activity.loadBitmap(message, imagePreview);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
final boolean showPreviewText;
|
final boolean showPreviewText;
|
||||||
if (message.getFileParams().runtime > 0) {
|
if (message.getType() == Message.TYPE_FILE) {
|
||||||
showPreviewText = false;
|
if (message.getFileParams().runtime > 0) {
|
||||||
mLastMessageImage.setImageResource(activity.getThemeResource(R.attr.ic_attach_record, R.drawable.ic_attach_record));
|
showPreviewText = false;
|
||||||
mLastMessageImage.setVisibility(View.VISIBLE);
|
mLastMessageImage.setImageResource(activity.getThemeResource(R.attr.ic_attach_record, R.drawable.ic_attach_record));
|
||||||
} else if (message.getType() == Message.TYPE_FILE) {
|
} else {
|
||||||
showPreviewText = true;
|
showPreviewText = true;
|
||||||
mLastMessageImage.setImageResource(activity.getThemeResource(R.attr.ic_attach_document, R.drawable.ic_attach_document));
|
mLastMessageImage.setImageResource(activity.getThemeResource(R.attr.ic_attach_document, R.drawable.ic_attach_document));
|
||||||
|
}
|
||||||
mLastMessageImage.setVisibility(View.VISIBLE);
|
mLastMessageImage.setVisibility(View.VISIBLE);
|
||||||
} else if (message.isGeoUri()) {
|
} else if (message.isGeoUri()) {
|
||||||
showPreviewText = false;
|
showPreviewText = false;
|
||||||
|
|
Loading…
Reference in New Issue