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

ANDROID-14416 Allow tint for RowItem icons #334

Merged
merged 2 commits into from
Mar 7, 2024

Conversation

haynlo
Copy link
Contributor

@haynlo haynlo commented Mar 6, 2024

🥅 What's the goal?

Currently the ListRowItem component in Mistica only admits a "ListRowIcon" param where we can only define a painterResource. This limitation causes that Icon types are tinted with default color (Black) instead of its original color.

We need to add a new optional param to allow original tint (tint= Color.Unspecified) or a custom tint color.

🚧 How do we do it?

  • Create new optional parameter "tint: Color? = null" for Icon builders data classes.
  • Use this value when composing the Icon.
    • If it's not provided (null) use the default color keeping the same behavior as before.

☑️ Checks

  • I updated the documentation, including readmes and wikis. If this is a breaking change, update UPGRADING.md to inform users how to proceed. If no updates are necessary, indicate so.
  • Tested with dark mode.
  • Tested with API 21.

🧪 How can I test this?

Captura de pantalla 2024-03-06 a las 16 00 39

@haynlo haynlo requested review from a team, jeprubio and DevPabloGarcia and removed request for a team March 6, 2024 15:03
@@ -88,7 +92,8 @@ sealed class ListRowIcon(val contentDescription: String?) {
Icon(
painter = painter,
modifier = Modifier.size(24.dp),
contentDescription = contentDescription
contentDescription = contentDescription,
tint = tint ?: LocalContentColor.current.copy(alpha = LocalContentAlpha.current)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link

github-actions bot commented Mar 6, 2024

📱 New catalog for testing generated: Download

Copy link
Contributor

@jeprubio jeprubio left a comment

Choose a reason for hiding this comment

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

👍

Copy link

github-actions bot commented Mar 6, 2024

📱 New catalog for testing generated: Download

Copy link
Contributor

@DevPabloGarcia DevPabloGarcia left a comment

Choose a reason for hiding this comment

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

Nice !

@haynlo haynlo merged commit 98877ee into main Mar 7, 2024
5 checks passed
@haynlo haynlo deleted the fer/ANDROID-14416_tint_row_item branch March 7, 2024 10:28
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.

3 participants