diff options
author | lookshe <github@lookshe.org> | 2015-08-11 17:35:53 +0200 |
---|---|---|
committer | lookshe <github@lookshe.org> | 2015-08-11 17:35:53 +0200 |
commit | 8fd688ca96005152be754eeba1be72c7c0aab9ad (patch) | |
tree | c4d2e3dfe7250a6794aaa3fa9816ad3da70a813e /src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java | |
parent | 553f41a2dbc068a8a43f613e088713cd3ec7680e (diff) |
Merge tag '1.5.2' into trz/rebase
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java | 24 |
1 files changed, 8 insertions, 16 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 b6f88356..c42dd305 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java @@ -3,7 +3,6 @@ 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; @@ -25,7 +24,7 @@ import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Conversation; -import eu.siacs.conversations.entities.Downloadable; +import eu.siacs.conversations.entities.Transferable; import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.entities.Presences; import eu.siacs.conversations.ui.ConversationActivity; @@ -63,17 +62,10 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> { } Conversation conversation = getItem(position); if (this.activity instanceof ConversationActivity) { - ConversationActivity activity = (ConversationActivity) this.activity; - if (!activity.isConversationsOverviewHideable()) { - if (conversation == activity.getSelectedConversation()) { - view.setBackgroundColor(activity - .getSecondaryBackgroundColor()); - } else { - view.setBackgroundColor(Color.TRANSPARENT); - } - } else { - view.setBackgroundColor(Color.TRANSPARENT); - } + View swipeableItem = view.findViewById(R.id.swipeable_item); + ConversationActivity a = (ConversationActivity) this.activity; + int c = !a.isConversationsOverviewHideable() && conversation == a.getSelectedConversation() ? a.getSecondaryBackgroundColor() : a.getPrimaryBackgroundColor(); + swipeableItem.setBackgroundColor(c); } TextView convName = (TextView) view.findViewById(R.id.conversation_name); if (conversation.getMode() == Conversation.MODE_SINGLE || activity.useSubjectToIdentifyConference()) { @@ -117,9 +109,9 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> { convName.setTypeface(null, Typeface.NORMAL); } - if (message.getImageParams().width > 0 - && (message.getDownloadable() == null - || message.getDownloadable().getStatus() != Downloadable.STATUS_DELETED)) { + if (message.getFileParams().width > 0 + && (message.getTransferable() == null + || message.getTransferable().getStatus() != Transferable.STATUS_DELETED)) { mLastMessage.setVisibility(View.GONE); imagePreview.setVisibility(View.VISIBLE); activity.loadBitmap(message, imagePreview); |