Update ambient highlight and inner shadow

This commit is contained in:
Kyant0 committed 2025-09-22 20:52:13 +08:00
1 parent 9d33570561
commit 47efb1ec77
5 files changed
+27 -15

No files matched your search

@@ -153,7 +153,7 @@ fun LiquidSlider(
shadow = {
Shadow(
elevation = 4f.dp,
color = Color.Black.copy(0.08f)
color = Color.Black.copy(0.05f)
)
},
layer = {
@@ -167,14 +167,20 @@ fun LiquidSlider(
val shape = ContinuousCapsule
val outline = shape.createOutline(size, layoutDirection, this)
val innerShadowOffset = 4f.dp.toPx()
val innerShadowBlurRadius = 4f.dp.toPx()
val innerShadowOffset = 4f.dp.toPx() * progress
val innerShadowBlurRadius = 2f.dp.toPx() * progress
innerShadowLayer.alpha = progress
innerShadowLayer.renderEffect =
BlurEffect(innerShadowBlurRadius, innerShadowBlurRadius, TileMode.Decal)
if (innerShadowBlurRadius > 0f) {
innerShadowLayer.renderEffect =
BlurEffect(
innerShadowBlurRadius,
innerShadowBlurRadius,
TileMode.Decal
)
}
innerShadowLayer.record {
drawOutline(outline, Color.Black.copy(0.2f))
drawOutline(outline, Color.Black.copy(0.1f))
translate(0f, innerShadowOffset) {
drawOutline(outline, Color.Transparent, blendMode = BlendMode.Clear)
}
@@ -270,14 +270,20 @@ fun BottomTabsContent() {
val shape = ContinuousCapsule
val outline = shape.createOutline(size, layoutDirection, this)
val innerShadowOffset = 4f.dp.toPx()
val innerShadowBlurRadius = 4f.dp.toPx()
val innerShadowOffset = 4f.dp.toPx() * progress
val innerShadowBlurRadius = 2f.dp.toPx() * progress
innerShadowLayer.alpha = progress
innerShadowLayer.renderEffect =
BlurEffect(innerShadowBlurRadius, innerShadowBlurRadius, TileMode.Decal)
if (innerShadowBlurRadius > 0f) {
innerShadowLayer.renderEffect =
BlurEffect(
innerShadowBlurRadius,
innerShadowBlurRadius,
TileMode.Decal
)
}
innerShadowLayer.record {
drawOutline(outline, Color.Black.copy(0.2f))
drawOutline(outline, Color.Black.copy(0.1f))
translate(0f, innerShadowOffset) {
drawOutline(outline, Color.Transparent, blendMode = BlendMode.Clear)
}