Add a way to use the primary color for the icon.
This commit is contained in:
parent
6e9ba7760e
commit
8664b2ce90
1 changed files with 4 additions and 0 deletions
|
|
@ -53,11 +53,13 @@ object BigIcon {
|
||||||
* @param vectorIcon the [ImageVector] to display
|
* @param vectorIcon the [ImageVector] to display
|
||||||
* @param contentDescription the content description of the icon, if any. It defaults to `null`
|
* @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 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(
|
data class Default(
|
||||||
val vectorIcon: ImageVector,
|
val vectorIcon: ImageVector,
|
||||||
val contentDescription: String? = null,
|
val contentDescription: String? = null,
|
||||||
val useCriticalTint: Boolean = false,
|
val useCriticalTint: Boolean = false,
|
||||||
|
val usePrimaryTint: Boolean = false,
|
||||||
) : Style
|
) : Style
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -143,6 +145,8 @@ object BigIcon {
|
||||||
val iconTint = when (style) {
|
val iconTint = when (style) {
|
||||||
is Style.Default -> if (style.useCriticalTint) {
|
is Style.Default -> if (style.useCriticalTint) {
|
||||||
ElementTheme.colors.iconCriticalPrimary
|
ElementTheme.colors.iconCriticalPrimary
|
||||||
|
} else if (style.usePrimaryTint) {
|
||||||
|
ElementTheme.colors.iconPrimary
|
||||||
} else {
|
} else {
|
||||||
ElementTheme.colors.iconSecondary
|
ElementTheme.colors.iconSecondary
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue