Add a way to use the primary color for the icon.

This commit is contained in:
Benoit Marty
2025-10-02 22:06:21 +02:00
committed by Benoit Marty
parent 6e9ba7760e
commit 8664b2ce90

View File

@@ -53,11 +53,13 @@ object BigIcon {
* @param vectorIcon the [ImageVector] to display
* @param contentDescription the content description of the icon, if any. It defaults to `null`
* @param useCriticalTint whether the icon and background should be rendered using critical tint
* @param usePrimaryTint whether the icon should be rendered using primary tint
*/
data class Default(
val vectorIcon: ImageVector,
val contentDescription: String? = null,
val useCriticalTint: Boolean = false,
val usePrimaryTint: Boolean = false,
) : Style
/**
@@ -143,6 +145,8 @@ object BigIcon {
val iconTint = when (style) {
is Style.Default -> if (style.useCriticalTint) {
ElementTheme.colors.iconCriticalPrimary
} else if (style.usePrimaryTint) {
ElementTheme.colors.iconPrimary
} else {
ElementTheme.colors.iconSecondary
}