Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterate on badge / unread indicator color (#5332) #5456

Merged
merged 1 commit into from
Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/5456.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Iterate on badge / unread indicator color
6 changes: 6 additions & 0 deletions library/ui-styles/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
<!-- Used for item separators in list, on surface -->
<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 -->
<attr name="vctr_fab_label_bg" format="color" />
<color name="vctr_fab_label_bg_light">@android:color/white</color>
Expand Down
3 changes: 2 additions & 1 deletion library/ui-styles/src/main/res/values/theme_dark.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@
<!-- Presence Indicator colors -->
<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_list_separator">?vctr_content_quinary</item>
<item name="vctr_list_separator_system">?vctr_system</item>
<item name="vctr_list_separator_on_surface">?vctr_system</item>
<item name="vctr_unread_background">?vctr_content_tertiary</item>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for the alias, also allows light/dark to use separate theme values if needed


<!-- Material color -->
<item name="colorPrimary">@color/element_accent_dark</item>
Expand Down
3 changes: 2 additions & 1 deletion library/ui-styles/src/main/res/values/theme_light.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@
<!-- Presence Indicator colors -->
<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_list_separator">?vctr_content_quinary</item>
<item name="vctr_list_separator_system">?vctr_system</item>
<item name="vctr_list_separator_on_surface">?vctr_system</item>
<item name="vctr_unread_background">?vctr_content_tertiary</item>

<!-- Material color -->
<item name="colorPrimary">@color/element_accent_light</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ class HomeDetailFragment @Inject constructor(
backgroundColor = if (highlight) {
ThemeUtils.getColor(requireContext(), R.attr.colorError)
} else {
ThemeUtils.getColor(requireContext(), R.attr.vctr_content_secondary)
ThemeUtils.getColor(requireContext(), R.attr.vctr_unread_background)
}
}

Expand Down
2 changes: 1 addition & 1 deletion vector/src/main/res/drawable/bg_unread_notification.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

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

<solid android:color="?vctr_content_secondary" />
<solid android:color="?vctr_unread_background" />
</shape>
2 changes: 1 addition & 1 deletion vector/src/main/res/layout/item_room.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
android:id="@+id/roomUnreadIndicator"
android:layout_width="4dp"
android:layout_height="0dp"
android:background="?vctr_content_secondary"
android:background="?vctr_unread_background"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down