From a7480c1860b62454b1dcee5cfb61ae13448efb75 Mon Sep 17 00:00:00 2001 From: Onuray Sahin Date: Fri, 3 Jul 2020 13:36:30 +0300 Subject: [PATCH] Change colors according to the new color palette. --- .../core/epoxy/profiles/ProfileActionItem.kt | 13 ++-- .../bottom_navigation_icon_tint_selector.xml | 5 ++ .../main/res/layout/fragment_home_detail.xml | 1 + vector/src/main/res/values/colors_riotx.xml | 59 ++++++++++--------- vector/src/main/res/values/theme_black.xml | 2 + vector/src/main/res/values/theme_dark.xml | 2 + vector/src/main/res/values/theme_light.xml | 2 + 7 files changed, 53 insertions(+), 31 deletions(-) create mode 100644 vector/src/main/res/color/bottom_navigation_icon_tint_selector.xml diff --git a/vector/src/main/java/im/vector/riotx/core/epoxy/profiles/ProfileActionItem.kt b/vector/src/main/java/im/vector/riotx/core/epoxy/profiles/ProfileActionItem.kt index a015358d8b..66296dc71d 100644 --- a/vector/src/main/java/im/vector/riotx/core/epoxy/profiles/ProfileActionItem.kt +++ b/vector/src/main/java/im/vector/riotx/core/epoxy/profiles/ProfileActionItem.kt @@ -67,17 +67,22 @@ abstract class ProfileActionItem : VectorEpoxyModel() holder.view.isClickable = false } holder.title.text = title - val tintColor = if (destructive) { + val titleTintColor = if (destructive) { ContextCompat.getColor(holder.view.context, R.color.riotx_notice) } else { ThemeUtils.getColor(holder.view.context, R.attr.riotx_text_primary) } - holder.title.setTextColor(tintColor) + val iconTintColor = if (destructive) { + ContextCompat.getColor(holder.view.context, R.color.riotx_notice) + } else { + ThemeUtils.getColor(holder.view.context, R.attr.riotx_text_secondary) + } + holder.title.setTextColor(titleTintColor) holder.subtitle.setTextOrHide(subtitle) if (iconRes != 0) { holder.icon.setImageResource(iconRes) if (tintIcon) { - ImageViewCompat.setImageTintList(holder.icon, ColorStateList.valueOf(tintColor)) + ImageViewCompat.setImageTintList(holder.icon, ColorStateList.valueOf(iconTintColor)) } else { ImageViewCompat.setImageTintList(holder.icon, null) } @@ -95,7 +100,7 @@ abstract class ProfileActionItem : VectorEpoxyModel() if (editableRes != 0 && editable) { val tintColorSecondary = if (destructive) { - tintColor + titleTintColor } else { ThemeUtils.getColor(holder.view.context, R.attr.riotx_text_secondary) } diff --git a/vector/src/main/res/color/bottom_navigation_icon_tint_selector.xml b/vector/src/main/res/color/bottom_navigation_icon_tint_selector.xml new file mode 100644 index 0000000000..4326827467 --- /dev/null +++ b/vector/src/main/res/color/bottom_navigation_icon_tint_selector.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/vector/src/main/res/layout/fragment_home_detail.xml b/vector/src/main/res/layout/fragment_home_detail.xml index f90422dff9..385e1cb3cc 100644 --- a/vector/src/main/res/layout/fragment_home_detail.xml +++ b/vector/src/main/res/layout/fragment_home_detail.xml @@ -106,6 +106,7 @@ android:layout_height="48dp" android:background="?riotx_background" app:itemIconSize="20dp" + app:itemIconTint="@color/bottom_navigation_icon_tint_selector" app:labelVisibilityMode="unlabeled" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/vector/src/main/res/values/colors_riotx.xml b/vector/src/main/res/values/colors_riotx.xml index ce99b3a0b1..04a444cf48 100644 --- a/vector/src/main/res/values/colors_riotx.xml +++ b/vector/src/main/res/values/colors_riotx.xml @@ -4,8 +4,8 @@ - #FF03B381 - #3F03B381 + #FF00BE8A + #3F00BE8A #FFFF4B55 @@ -13,9 +13,9 @@ #14368BD6 - #03B381 - #61708B - #1E03B381 + #00BE8A + #C4C4C4 + #1E00BE8A #1E61708B @@ -23,13 +23,13 @@ #FF61708B #FF368BD6 - #FF03b381 + #FF03B381 #FF368bd6 #FFac3ba8 #368bd6 #ac3ba8 - #03b381 + #03B381 #e64f7a #ff812d #2dc2c5 @@ -46,13 +46,13 @@ #FFFFFFFF - #FF181B21 + #FF15191E #FF000000 - #FF27303A - #FF15171B - #FF060708 + #FFF5F7FA + #FF22282F + #FF000000 #FFFFFFFF @@ -80,14 +80,14 @@ #FF0D0F12 - #FF61708B - #FFA1B2D1 - #FFA1B2D1 + #FF171910 + #FFFFFFFF + #FFFFFFFF - #FFC8C8CD - #FFC8C8CD - #FFC8C8CD + #8F97A3 + #FFA9B2BC + #FFA9B2BC #FF2E2F32 @@ -110,14 +110,14 @@ #FF7E899C - #FF61708B - #FF61708B - #FF61708B + #FF8F97A3 + #FFA9B2BC + #FFA9B2BC - #FFFFFFFF + #FFF6F7F8 #FF343446 - #FF22262E + #FF343446 #FF2E3648 @@ -127,12 +127,12 @@ #FF2E3648 #FF0D0E10 - #FF000000 + #FF0D0E10 #FFEEEFEF #FF61708B - #FF22262E + #FF61708B @@ -186,16 +186,21 @@ #E3E8F0 - #FFF3F8FD + @color/riot_primary_background_color_light @color/primary_color_dark @color/primary_color_black @color/riot_primary_background_color_status - ##AAAAAAAA + #E9EDF1 #55555555 #FF15171b - FFE9EDF1 + #FFE9EDF1 + + + #C1C6CD + #8E99A4 + #8E99A4 #FFE9EDF1 diff --git a/vector/src/main/res/values/theme_black.xml b/vector/src/main/res/values/theme_black.xml index 87d41b8da1..91ae2c9f0b 100644 --- a/vector/src/main/res/values/theme_black.xml +++ b/vector/src/main/res/values/theme_black.xml @@ -36,6 +36,8 @@ @color/riotx_room_active_widgets_banner_bg_black @color/riotx_room_active_widgets_banner_text_black + @color/riotx_bottom_nav_icon_color_black + @drawable/highlighted_message_background_black diff --git a/vector/src/main/res/values/theme_dark.xml b/vector/src/main/res/values/theme_dark.xml index 2cf29005a6..42ba8ad381 100644 --- a/vector/src/main/res/values/theme_dark.xml +++ b/vector/src/main/res/values/theme_dark.xml @@ -34,6 +34,8 @@ @color/riotx_room_active_widgets_banner_bg_dark @color/riotx_room_active_widgets_banner_text_dark + @color/riotx_bottom_nav_icon_color_dark + @color/riotx_keys_backup_banner_accent_color_dark diff --git a/vector/src/main/res/values/theme_light.xml b/vector/src/main/res/values/theme_light.xml index 0bad238794..869fdad3ee 100644 --- a/vector/src/main/res/values/theme_light.xml +++ b/vector/src/main/res/values/theme_light.xml @@ -35,6 +35,8 @@ @color/riotx_room_active_widgets_banner_bg_light @color/riotx_room_active_widgets_banner_text_light + @color/riotx_bottom_nav_icon_color_light + @drawable/highlighted_message_background_light