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

Make icon use dynamic Material You colors #57

Open
tegridyfarmer opened this issue Jan 10, 2025 · 3 comments
Open

Make icon use dynamic Material You colors #57

tegridyfarmer opened this issue Jan 10, 2025 · 3 comments

Comments

@tegridyfarmer
Copy link

This makes the icon look consistent for Android users who enabled this feature.

@felixwiemuth
Copy link
Owner

Contribution on this is welcome

@tegridyfarmer
Copy link
Author

The below would enable dynamic colors support. This should be done in the AndroidManifest.xml

<application
    android:theme="@style/Theme.Material3.DayNight">

And maybe something like this could work

@Composable
fun DynamicColorIcon() {
    // Get the dynamic color from MaterialTheme
    val iconColor = MaterialTheme.colorScheme.primary

    // Create an icon using the dynamic color
    Icon(
        imageVector = Icons.Default.Star, // Replace with your icon
        contentDescription = "Dynamic Color Icon",
        tint = iconColor,
        modifier = Modifier.size(48.dp) // Set size as needed
    )
}

But I do not know much about Jetpack.

@felixwiemuth
Copy link
Owner

Thanks, I will check it out when looking at the icons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants