mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-25 07:09:31 +00:00
committed by
Moxie Marlinspike
parent
9408579862
commit
bd2e984963
@@ -17,7 +17,6 @@
|
||||
package org.thoughtcrime.securesms;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Handler;
|
||||
import android.util.AttributeSet;
|
||||
@@ -104,7 +103,7 @@ public class ConversationListItem extends RelativeLayout
|
||||
dateView.setTypeface(read ? LIGHT_TYPEFACE : BOLD_TYPEFACE);
|
||||
}
|
||||
|
||||
setBackground(read, batchMode);
|
||||
setBatchState(batchMode);
|
||||
this.contactPhotoImage.setAvatar(recipients.getPrimaryRecipient(), true);
|
||||
}
|
||||
|
||||
@@ -117,22 +116,8 @@ public class ConversationListItem extends RelativeLayout
|
||||
contactPhotoImage.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
private void setBackground(boolean read, boolean batch) {
|
||||
int[] attributes = new int[]{R.attr.conversation_list_item_background_selected,
|
||||
R.attr.conversation_list_item_background_read,
|
||||
R.attr.conversation_list_item_background_unread};
|
||||
|
||||
TypedArray drawables = context.obtainStyledAttributes(attributes);
|
||||
|
||||
if (batch && selectedThreads.contains(threadId)) {
|
||||
setBackgroundDrawable(drawables.getDrawable(0));
|
||||
} else if (read) {
|
||||
setBackgroundDrawable(drawables.getDrawable(1));
|
||||
} else {
|
||||
setBackgroundDrawable(drawables.getDrawable(2));
|
||||
}
|
||||
|
||||
drawables.recycle();
|
||||
private void setBatchState(boolean batch) {
|
||||
setSelected(batch && selectedThreads.contains(threadId));
|
||||
}
|
||||
|
||||
public Recipients getRecipients() {
|
||||
|
||||
Reference in New Issue
Block a user