Iterate on badge / unread indicator color (#5332)

This commit is contained in:
Benoit Marty 2022-03-08 13:55:19 +01:00
parent bdc9bc0d4d
commit b867e5f072
7 changed files with 14 additions and 5 deletions

1
changelog.d/5456.misc Normal file
View File

@ -0,0 +1 @@
Iterate on badge / unread indicator color

View File

@ -56,6 +56,12 @@
<!-- Used for item separators in list, on surface --> <!-- Used for item separators in list, on surface -->
<attr name="vctr_list_separator_on_surface" format="color" /> <attr name="vctr_list_separator_on_surface" format="color" />
<!-- Background color used for:
- unread badge background for a room item in the room list
- start unread indicator for a room item in the room list
- Background for unread badge background in the bottom navigation -->
<attr name="vctr_unread_background" format="color" />
<!-- Other colors, which are not in the palette --> <!-- Other colors, which are not in the palette -->
<attr name="vctr_fab_label_bg" format="color" /> <attr name="vctr_fab_label_bg" format="color" />
<color name="vctr_fab_label_bg_light">@android:color/white</color> <color name="vctr_fab_label_bg_light">@android:color/white</color>

View File

@ -46,11 +46,12 @@
<!-- Presence Indicator colors --> <!-- Presence Indicator colors -->
<item name="vctr_presence_indicator_offline">@color/vctr_presence_indicator_offline_dark</item> <item name="vctr_presence_indicator_offline">@color/vctr_presence_indicator_offline_dark</item>
<!-- Some alias --> <!-- Some aliases -->
<item name="vctr_header_background">?vctr_system</item> <item name="vctr_header_background">?vctr_system</item>
<item name="vctr_list_separator">?vctr_content_quinary</item> <item name="vctr_list_separator">?vctr_content_quinary</item>
<item name="vctr_list_separator_system">?vctr_system</item> <item name="vctr_list_separator_system">?vctr_system</item>
<item name="vctr_list_separator_on_surface">?vctr_system</item> <item name="vctr_list_separator_on_surface">?vctr_system</item>
<item name="vctr_unread_background">?vctr_content_tertiary</item>
<!-- Material color --> <!-- Material color -->
<item name="colorPrimary">@color/element_accent_dark</item> <item name="colorPrimary">@color/element_accent_dark</item>

View File

@ -46,11 +46,12 @@
<!-- Presence Indicator colors --> <!-- Presence Indicator colors -->
<item name="vctr_presence_indicator_offline">@color/vctr_presence_indicator_offline_light</item> <item name="vctr_presence_indicator_offline">@color/vctr_presence_indicator_offline_light</item>
<!-- Some alias --> <!-- Some aliases -->
<item name="vctr_header_background">?vctr_system</item> <item name="vctr_header_background">?vctr_system</item>
<item name="vctr_list_separator">?vctr_content_quinary</item> <item name="vctr_list_separator">?vctr_content_quinary</item>
<item name="vctr_list_separator_system">?vctr_system</item> <item name="vctr_list_separator_system">?vctr_system</item>
<item name="vctr_list_separator_on_surface">?vctr_system</item> <item name="vctr_list_separator_on_surface">?vctr_system</item>
<item name="vctr_unread_background">?vctr_content_tertiary</item>
<!-- Material color --> <!-- Material color -->
<item name="colorPrimary">@color/element_accent_light</item> <item name="colorPrimary">@color/element_accent_light</item>

View File

@ -457,7 +457,7 @@ class HomeDetailFragment @Inject constructor(
backgroundColor = if (highlight) { backgroundColor = if (highlight) {
ThemeUtils.getColor(requireContext(), R.attr.colorError) ThemeUtils.getColor(requireContext(), R.attr.colorError)
} else { } else {
ThemeUtils.getColor(requireContext(), R.attr.vctr_content_secondary) ThemeUtils.getColor(requireContext(), R.attr.vctr_unread_background)
} }
} }

View File

@ -4,5 +4,5 @@
<corners android:radius="40dp" /> <corners android:radius="40dp" />
<solid android:color="?vctr_content_secondary" /> <solid android:color="?vctr_unread_background" />
</shape> </shape>

View File

@ -15,7 +15,7 @@
android:id="@+id/roomUnreadIndicator" android:id="@+id/roomUnreadIndicator"
android:layout_width="4dp" android:layout_width="4dp"
android:layout_height="0dp" android:layout_height="0dp"
android:background="?vctr_content_secondary" android:background="?vctr_unread_background"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"