mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-03 08:32:34 +00:00
Audio view and message bubbles properly themed.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user