Audio view and message bubbles properly themed.

This commit is contained in:
Anton Chekulaev
2020-08-24 18:38:48 +10:00
parent afe90200f1
commit 5e5b88148d
17 changed files with 63 additions and 33 deletions

View File

@@ -10,6 +10,7 @@ import android.widget.LinearLayout;
import org.thoughtcrime.securesms.mms.GlideRequests;
import org.thoughtcrime.securesms.recipients.Recipient;
import org.thoughtcrime.securesms.util.ThemeUtil;
import java.util.List;
@@ -41,7 +42,10 @@ public class ConversationTypingView extends LinearLayout {
}
Recipient typist = typists.get(0);
bubble.getBackground().setColorFilter(getResources().getColor(R.color.received_message_background), PorterDuff.Mode.MULTIPLY);
bubble.getBackground().setColorFilter(
ThemeUtil.getThemedColor(getContext(), R.attr.message_received_background_color),
PorterDuff.Mode.MULTIPLY);
if (isGroupThread) {
avatar.setAvatar(glideRequests, typist, false);

View File

@@ -210,7 +210,8 @@ public class QuoteView extends FrameLayout implements RecipientModifiedListener
// We use the raw color resource because Android 4.x was struggling with tints here
quoteBarView.setImageResource(R.color.accent);
mainView.setBackgroundColor(getResources().getColor(outgoing ? R.color.received_message_background : R.color.sent_message_background));
mainView.setBackgroundColor(ThemeUtil.getThemedColor(getContext(),
outgoing ? R.attr.message_received_background_color : R.attr.message_sent_background_color));
}
private void setQuoteText(@Nullable String body, @NonNull SlideDeck attachments) {

View File

@@ -352,11 +352,10 @@ public class ConversationItem extends LinearLayout
/// MessageRecord Attribute Parsers
private void setBubbleState(MessageRecord messageRecord) {
if (messageRecord.isOutgoing()) {
bodyBubble.getBackground().setColorFilter(getResources().getColor(R.color.sent_message_background), PorterDuff.Mode.MULTIPLY);
} else {
bodyBubble.getBackground().setColorFilter(getResources().getColor(R.color.received_message_background), PorterDuff.Mode.MULTIPLY);
}
int bubbleColor = ThemeUtil.getThemedColor(getContext(), messageRecord.isOutgoing() ?
R.attr.message_sent_background_color :
R.attr.message_received_background_color);
bodyBubble.getBackground().setColorFilter(bubbleColor, PorterDuff.Mode.MULTIPLY);
if (audioViewStub.resolved()) {
setAudioViewTint(messageRecord, this.conversationRecipient);
@@ -364,7 +363,7 @@ public class ConversationItem extends LinearLayout
}
private void setAudioViewTint(MessageRecord messageRecord, Recipient recipient) {
audioViewStub.get().setTint(Color.WHITE, getResources().getColor(R.color.action_bar_background));
// audioViewStub.get().setTint(Color.WHITE, getResources().getColor(R.color.action_bar_background));
}
private void setInteractionState(MessageRecord messageRecord, boolean pulseHighlight) {