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:
Moxie Marlinspike
2015-06-29 15:33:36 -07:00
parent 99c9c73c9d
commit 78289ded8f
40 changed files with 270 additions and 128 deletions

View File

@@ -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();
}