mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-03 15:11:42 +01:00
Fully colorize conversations.
1. Switch from 300 to 500 colors. 2. Colorize incoming conversation bubbles. 3. Colorize recipeint preference activity toolbar. 4. Support inverted colors in avatars. 5. Make status bar icons tint according to secondary color. // FREEBIE
This commit is contained in:
@@ -188,10 +188,18 @@ public class ConversationItem extends LinearLayout {
|
||||
/// MessageRecord Attribute Parsers
|
||||
|
||||
private void setBubbleState(MessageRecord messageRecord) {
|
||||
int[] attributes = new int[]{R.attr.conversation_item_bubble_background};
|
||||
TypedArray colors = context.obtainStyledAttributes(attributes);
|
||||
int[] attributes = new int[]{R.attr.conversation_item_bubble_background};
|
||||
TypedArray colors = context.obtainStyledAttributes(attributes);
|
||||
int defaultColor = colors.getColor(0, 0xFFFFFF);
|
||||
|
||||
bodyBubble.getBackground().setColorFilter(colors.getColor(0, 0xFFFFFFFF), PorterDuff.Mode.MULTIPLY);
|
||||
if (messageRecord.isOutgoing()) {
|
||||
bodyBubble.getBackground().setColorFilter(defaultColor, PorterDuff.Mode.MULTIPLY);
|
||||
} else {
|
||||
bodyBubble.getBackground().setColorFilter(messageRecord.getIndividualRecipient()
|
||||
.getColor()
|
||||
.or(defaultColor),
|
||||
PorterDuff.Mode.MULTIPLY);
|
||||
}
|
||||
|
||||
colors.recycle();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user