mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Update doc and rename param.
This commit is contained in:
+5
-4
@@ -51,11 +51,12 @@ 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
|
||||||
*/
|
*/
|
||||||
data class Default(
|
data class Default(
|
||||||
val vectorIcon: ImageVector,
|
val vectorIcon: ImageVector,
|
||||||
val contentDescription: String? = null,
|
val contentDescription: String? = null,
|
||||||
val destructive: Boolean = false,
|
val useCriticalTint: Boolean = false,
|
||||||
) : Style
|
) : Style
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -91,7 +92,7 @@ object BigIcon {
|
|||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
) {
|
) {
|
||||||
val backgroundColor = when (style) {
|
val backgroundColor = when (style) {
|
||||||
is Style.Default -> if (style.destructive) {
|
is Style.Default -> if (style.useCriticalTint) {
|
||||||
ElementTheme.colors.bgCriticalSubtle
|
ElementTheme.colors.bgCriticalSubtle
|
||||||
} else {
|
} else {
|
||||||
ElementTheme.colors.bgSubtleSecondary
|
ElementTheme.colors.bgSubtleSecondary
|
||||||
@@ -116,7 +117,7 @@ object BigIcon {
|
|||||||
Style.SuccessSolid -> stringResource(CommonStrings.common_success)
|
Style.SuccessSolid -> stringResource(CommonStrings.common_success)
|
||||||
}
|
}
|
||||||
val iconTint = when (style) {
|
val iconTint = when (style) {
|
||||||
is Style.Default -> if (style.destructive) {
|
is Style.Default -> if (style.useCriticalTint) {
|
||||||
ElementTheme.colors.iconCriticalPrimary
|
ElementTheme.colors.iconCriticalPrimary
|
||||||
} else {
|
} else {
|
||||||
ElementTheme.colors.iconSecondary
|
ElementTheme.colors.iconSecondary
|
||||||
@@ -170,7 +171,7 @@ internal class BigIconStyleProvider : PreviewParameterProvider<BigIcon.Style> {
|
|||||||
BigIcon.Style.Default(Icons.Filled.CatchingPokemon),
|
BigIcon.Style.Default(Icons.Filled.CatchingPokemon),
|
||||||
BigIcon.Style.Alert,
|
BigIcon.Style.Alert,
|
||||||
BigIcon.Style.AlertSolid,
|
BigIcon.Style.AlertSolid,
|
||||||
BigIcon.Style.Default(Icons.Filled.CatchingPokemon, destructive = true),
|
BigIcon.Style.Default(Icons.Filled.CatchingPokemon, useCriticalTint = true),
|
||||||
BigIcon.Style.Success,
|
BigIcon.Style.Success,
|
||||||
BigIcon.Style.SuccessSolid
|
BigIcon.Style.SuccessSolid
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user