mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Add a way to use the primary color for the icon.
This commit is contained in:
committed by
Benoit Marty
parent
23ed5e71fd
commit
9f71bc4575
+4
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user