1
0
mirror of https://github.com/TwidereProject/Twidere-Android synced 2025-02-02 09:46:51 +01:00

fixed incoming message background color

This commit is contained in:
Mariotaku Lee 2017-09-18 16:39:06 +08:00
parent bcc1d2f140
commit 0bb81b5b15
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535

View File

@ -225,9 +225,9 @@ class MessagesConversationAdapter(
private const val ITEM_LOAD_OLDER_INDICATOR = 4
private fun Context.getIncomingMessageColor(): ColorStateList {
val foregroundColor = ThemeUtils.getColorForeground(this)
val defaultBubbleColor = ThemeUtils.getColorFromAttribute(this, R.attr.messageBubbleColor)
val themeColor = Chameleon.getOverrideTheme(this, ChameleonUtils.getActivity(this)).colorAccent
val normalColor = ThemeUtils.getOptimalAccentColor(themeColor, foregroundColor)
val normalColor = ColorUtils.compositeColors(ColorUtils.setAlphaComponent(themeColor, 0x33), defaultBubbleColor)
val pressedColor = if (ColorUtils.calculateLuminance(normalColor) < 0.1) {
ColorUtils.compositeColors(0x20FFFFFF, normalColor)
} else {