summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/compose/core/src/com/android/compose/PlatformSlider.kt14
1 files changed, 12 insertions, 2 deletions
diff --git a/packages/SystemUI/compose/core/src/com/android/compose/PlatformSlider.kt b/packages/SystemUI/compose/core/src/com/android/compose/PlatformSlider.kt
index 596a297a6dbe..4a89e31bcea8 100644
--- a/packages/SystemUI/compose/core/src/com/android/compose/PlatformSlider.kt
+++ b/packages/SystemUI/compose/core/src/com/android/compose/PlatformSlider.kt
@@ -18,6 +18,7 @@
package com.android.compose
+import androidx.compose.animation.animateColorAsState
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.Canvas
@@ -266,8 +267,17 @@ private fun TrackBackground(
label = "PlatformSliderCornersAnimation",
)
- val trackColor = colors.getTrackColor(enabled)
- val indicatorColor = colors.getIndicatorColor(enabled)
+ val trackColor by
+ animateColorAsState(
+ colors.getTrackColor(enabled),
+ label = "PlatformSliderTrackColorAnimation",
+ )
+
+ val indicatorColor by
+ animateColorAsState(
+ colors.getIndicatorColor(enabled),
+ label = "PlatformSliderIndicatorColorAnimation",
+ )
Canvas(modifier.fillMaxSize()) {
val trackCornerRadius = CornerRadius(size.height / 2, size.height / 2)
val trackPath = Path()