Skip to content

Commit 5847f7b

Browse files
committed
Iterate on badge / unread indicator color (#5332)
1 parent bdc9bc0 commit 5847f7b

File tree

6 files changed

+13
-5
lines changed

6 files changed

+13
-5
lines changed

library/ui-styles/src/main/res/values/colors.xml

+6
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@
5656
<!-- Used for item separators in list, on surface -->
5757
<attr name="vctr_list_separator_on_surface" format="color" />
5858

59+
<!-- Background color used for:
60+
- unread badge background for a room item in the room list
61+
- start unread indicator for a room item in the room list
62+
- Background for unread badge background in the bottom navigation -->
63+
<attr name="vctr_unread_background" format="color" />
64+
5965
<!-- Other colors, which are not in the palette -->
6066
<attr name="vctr_fab_label_bg" format="color" />
6167
<color name="vctr_fab_label_bg_light">@android:color/white</color>

library/ui-styles/src/main/res/values/theme_dark.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@
4646
<!-- Presence Indicator colors -->
4747
<item name="vctr_presence_indicator_offline">@color/vctr_presence_indicator_offline_dark</item>
4848

49-
<!-- Some alias -->
49+
<!-- Some aliases -->
5050
<item name="vctr_header_background">?vctr_system</item>
5151
<item name="vctr_list_separator">?vctr_content_quinary</item>
5252
<item name="vctr_list_separator_system">?vctr_system</item>
5353
<item name="vctr_list_separator_on_surface">?vctr_system</item>
54+
<item name="vctr_unread_background">?vctr_content_tertiary</item>
5455

5556
<!-- Material color -->
5657
<item name="colorPrimary">@color/element_accent_dark</item>

library/ui-styles/src/main/res/values/theme_light.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@
4646
<!-- Presence Indicator colors -->
4747
<item name="vctr_presence_indicator_offline">@color/vctr_presence_indicator_offline_light</item>
4848

49-
<!-- Some alias -->
49+
<!-- Some aliases -->
5050
<item name="vctr_header_background">?vctr_system</item>
5151
<item name="vctr_list_separator">?vctr_content_quinary</item>
5252
<item name="vctr_list_separator_system">?vctr_system</item>
5353
<item name="vctr_list_separator_on_surface">?vctr_system</item>
54+
<item name="vctr_unread_background">?vctr_content_tertiary</item>
5455

5556
<!-- Material color -->
5657
<item name="colorPrimary">@color/element_accent_light</item>

vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ class HomeDetailFragment @Inject constructor(
457457
backgroundColor = if (highlight) {
458458
ThemeUtils.getColor(requireContext(), R.attr.colorError)
459459
} else {
460-
ThemeUtils.getColor(requireContext(), R.attr.vctr_content_secondary)
460+
ThemeUtils.getColor(requireContext(), R.attr.vctr_unread_background)
461461
}
462462
}
463463

vector/src/main/res/drawable/bg_unread_notification.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
<corners android:radius="40dp" />
66

7-
<solid android:color="?vctr_content_secondary" />
7+
<solid android:color="?vctr_unread_background" />
88
</shape>

vector/src/main/res/layout/item_room.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
android:id="@+id/roomUnreadIndicator"
1616
android:layout_width="4dp"
1717
android:layout_height="0dp"
18-
android:background="?vctr_content_secondary"
18+
android:background="?vctr_unread_background"
1919
android:visibility="gone"
2020
app:layout_constraintBottom_toBottomOf="parent"
2121
app:layout_constraintStart_toStartOf="parent"

0 commit comments

Comments
 (0)