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

Add option to change list item leading icon's background color #5319

Closed

Conversation

LukasPaczos
Copy link
Contributor

Task/Issue URL: https://app.asana.com/0/1202857801505092/1208848663479871

Description

Introduces an option to set a color for the list item leading icon's background. All leading icon backgrounds by default use a default grey-ish colors (depending on light/dark mode) with no option to change them. A new design for the Privacy Pro subscription activation screen requires the background for one of the list items to be specifically yellow.

I opted to provide this functionality by tinting the existing background drawable. This ensures that tinted background will still use the same shape as all the other list items, which cuts any additional maintenance if the background shapes/sizes get updated.

Steps to test this PR

You can try this out by applying below diff and navigating to Settings -> Sync & Backup:

diff --git a/sync/sync-impl/src/main/res/layout/view_sync_disabled.xml b/sync/sync-impl/src/main/res/layout/view_sync_disabled.xml
index d39d01829..0e0894019 100644
--- a/sync/sync-impl/src/main/res/layout/view_sync_disabled.xml
+++ b/sync/sync-impl/src/main/res/layout/view_sync_disabled.xml
@@ -36,6 +36,7 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         app:leadingIconBackground="circular"
+        app:leadingIconBackgroundColor="@color/yellow10"
         app:leadingIcon="@drawable/ic_sync_device_all_24"
         app:primaryText="@string/sync_setup_with_another_device_cta_title"
         app:secondaryText="@string/sync_setup_with_another_device_cta_subtitle"/>
Before After
Screenshot_20241126_122237 Screenshot_20241126_122425

UI changes

No changes to existing views.

@malmstein malmstein self-assigned this Nov 26, 2024
@LukasPaczos LukasPaczos force-pushed the feature/lukasz-p/list-item-icon-background-color branch from 936e64a to fb6b106 Compare November 26, 2024 14:10
@LukasPaczos LukasPaczos force-pushed the feature/lukasz-p/list-item-icon-background-color branch from fb6b106 to 1ca3703 Compare November 26, 2024 14:14
@LukasPaczos
Copy link
Contributor Author

Design idea has changed and this PR isn't needed at this time anymore.

@LukasPaczos LukasPaczos deleted the feature/lukasz-p/list-item-icon-background-color branch November 26, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants