mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-24 16:00:02 +00:00
Use theme-defined weights instead of ThemeType.
// FREEBIE
This commit is contained in:
@@ -11,7 +11,6 @@ import android.widget.ImageView;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.color.MaterialColor;
|
||||
import org.thoughtcrime.securesms.color.ThemeType;
|
||||
import org.thoughtcrime.securesms.contacts.avatars.ContactColors;
|
||||
import org.thoughtcrime.securesms.contacts.avatars.ContactPhotoFactory;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
@@ -39,14 +38,12 @@ public class AvatarImageView extends ImageView {
|
||||
}
|
||||
|
||||
public void setAvatar(@Nullable Recipients recipients, boolean quickContactEnabled) {
|
||||
ThemeType themeType = ThemeType.getCurrent(getContext());
|
||||
|
||||
if (recipients != null) {
|
||||
MaterialColor backgroundColor = recipients.getColor(getContext());
|
||||
setImageDrawable(recipients.getContactPhoto().asDrawable(getContext(), backgroundColor.toConversationColor(themeType), inverted));
|
||||
setImageDrawable(recipients.getContactPhoto().asDrawable(getContext(), backgroundColor.toConversationColor(getContext()), inverted));
|
||||
setAvatarClickHandler(recipients, quickContactEnabled);
|
||||
} else {
|
||||
setImageDrawable(ContactPhotoFactory.getDefaultContactPhoto(null).asDrawable(getContext(), ContactColors.UNKNOWN_COLOR.toConversationColor(themeType), inverted));
|
||||
setImageDrawable(ContactPhotoFactory.getDefaultContactPhoto(null).asDrawable(getContext(), ContactColors.UNKNOWN_COLOR.toConversationColor(getContext()), inverted));
|
||||
setOnClickListener(null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user