Bubbles: change colors

This commit is contained in:
ganfra 2022-01-24 19:31:04 +01:00
parent 1580269857
commit 608d8a5d54
4 changed files with 19 additions and 4 deletions

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Timeline bubble background colors -->
<attr name="vctr_message_bubble_inbound" format="color" />
<color name="vctr_message_bubble_inbound_light">#E8EDF4</color>
<color name="vctr_message_bubble_inbound_dark">#21262C</color>
<attr name="vctr_message_bubble_outbound" format="color" />
<color name="vctr_message_bubble_outbound_light">#E7F8F3</color>
<color name="vctr_message_bubble_outbound_dark">#133A34</color>
</resources>

View file

@ -31,6 +31,8 @@
<item name="vctr_waiting_background_color">@color/vctr_waiting_background_color_dark</item>
<item name="vctr_chat_effect_snow_background">@color/vctr_chat_effect_snow_background_dark</item>
<item name="vctr_toolbar_background">@color/element_system_dark</item>
<item name="vctr_message_bubble_inbound">@color/vctr_message_bubble_inbound_dark</item>
<item name="vctr_message_bubble_outbound">@color/vctr_message_bubble_outbound_dark</item>
<!-- room message colors -->
<item name="vctr_notice_secondary">#61708B</item>

View file

@ -31,6 +31,8 @@
<item name="vctr_waiting_background_color">@color/vctr_waiting_background_color_light</item>
<item name="vctr_chat_effect_snow_background">@color/vctr_chat_effect_snow_background_light</item>
<item name="vctr_toolbar_background">@color/element_background_light</item>
<item name="vctr_message_bubble_inbound">@color/vctr_message_bubble_inbound_light</item>
<item name="vctr_message_bubble_outbound">@color/vctr_message_bubble_outbound_light</item>
<!-- room message colors -->
<item name="vctr_notice_secondary">#61708B</item>

View file

@ -139,16 +139,16 @@ class MessageBubbleView @JvmOverloads constructor(context: Context, attrs: Attri
val shapeAppearanceModelBuilder = ShapeAppearanceModel().toBuilder()
val backgroundColor: Int
if (isIncoming) {
backgroundColor = ThemeUtils.getColor(context, R.attr.vctr_system)
backgroundColor = ThemeUtils.getColor(context, R.attr.vctr_message_bubble_inbound)
shapeAppearanceModelBuilder
.setTopRightCorner(CornerFamily.ROUNDED, cornerRadius)
.setBottomRightCorner(CornerFamily.ROUNDED, cornerRadius)
.setTopLeftCorner(topCornerFamily, topRadius)
.setBottomLeftCorner(bottomCornerFamily, bottomRadius)
} else {
val resolvedColor = ContextCompat.getColor(context, R.color.palette_element_green)
val alpha = if (ThemeUtils.isLightTheme(context)) 0x0E else 0x26
backgroundColor = ColorUtils.setAlphaComponent(resolvedColor, alpha)
backgroundColor = ThemeUtils.getColor(context, R.attr.vctr_message_bubble_outbound)
//val alpha = if (ThemeUtils.isLightTheme(context)) 0x0E else 0x26
//backgroundColor = ColorUtils.setAlphaComponent(resolvedColor, alpha)
shapeAppearanceModelBuilder
.setTopLeftCorner(CornerFamily.ROUNDED, cornerRadius)
.setBottomLeftCorner(CornerFamily.ROUNDED, cornerRadius)