NTP-43700 | Background color animation fix (#711)

This commit is contained in:
Naman Khurmi
2025-03-10 18:29:54 +05:30
committed by GitHub
parent d2e5b5e53c
commit e93a7f26e2
4 changed files with 8 additions and 12 deletions

View File

@@ -96,7 +96,7 @@ class AnimatedVisibilityRenderer(
animatedProperties,
)
.setBackground(
animatedProperties?.backgroundColor ?: property.backgroundColor,
property.backgroundColor,
property.shape,
property.backGroundBrushData,
animatedProperties,

View File

@@ -134,7 +134,7 @@ class BoxRenderer(
animatedProperties,
)
.setBackground(
animatedProperties?.backgroundColor ?: property.backgroundColor,
property.backgroundColor,
property.shape,
property.backGroundBrushData,
animatedProperties,

View File

@@ -193,7 +193,7 @@ class TextRenderer : Renderer<TextProperty> {
animatedProperties,
)
.setBackground(
animatedProperties?.backgroundColor ?: property.backgroundColor,
property.backgroundColor,
property.shape,
property.backGroundBrushData,
animatedProperties,

View File

@@ -484,7 +484,7 @@ fun Modifier.clip(uiTronShape: UiTronShape?): Modifier = composed {
}
fun Modifier.setBackground(
backgroundColor: Any?,
backgroundColor: String?,
uiTronShape: UiTronShape?,
brushData: BrushData?,
animatedProperties: AnimatedProperties? = null,
@@ -499,16 +499,12 @@ fun Modifier.setBackground(
} else if (backgroundColor.isNotNull()) {
this.background(
color =
when (backgroundColor) {
is String -> backgroundColor.hexToComposeColor
is Color -> animatedProperties?.backgroundColor?.value ?: backgroundColor
else -> Color.Transparent
},
animatedProperties?.backgroundColor?.value
?: backgroundColor?.hexToComposeColor
?: Color.Transparent,
shape = ShapeUtil.getShape(shape = uiTronShape),
)
} else {
this
}
} else this
}
fun getTileMode(tileMode: String?): TileMode {