Skip to content

Commit 1e54aad

Browse files
Update Transition and Ripple
1 parent 9c585a5 commit 1e54aad

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

NavigationCodelab/app/src/main/java/com/example/compose/rally/ui/components/RallyAnimatedCircle.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import androidx.compose.animation.core.CubicBezierEasing
2020
import androidx.compose.animation.core.LinearOutSlowInEasing
2121
import androidx.compose.animation.core.MutableTransitionState
2222
import androidx.compose.animation.core.animateFloat
23+
import androidx.compose.animation.core.rememberTransition
2324
import androidx.compose.animation.core.tween
24-
import androidx.compose.animation.core.updateTransition
2525
import androidx.compose.foundation.Canvas
2626
import androidx.compose.runtime.Composable
2727
import androidx.compose.runtime.getValue
@@ -50,7 +50,7 @@ fun AnimatedCircle(
5050
.apply { targetState = AnimatedCircleProgress.END }
5151
}
5252
val stroke = with(LocalDensity.current) { Stroke(5.dp.toPx()) }
53-
val transition = updateTransition(currentState)
53+
val transition = rememberTransition(currentState)
5454
val angleOffset by transition.animateFloat(
5555
transitionSpec = {
5656
tween(

NavigationCodelab/app/src/main/java/com/example/compose/rally/ui/components/RallyTabRow.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import androidx.compose.material.Icon
3333
import androidx.compose.material.MaterialTheme
3434
import androidx.compose.material.Surface
3535
import androidx.compose.material.Text
36-
import androidx.compose.material.ripple.rememberRipple
36+
import androidx.compose.material.ripple
3737
import androidx.compose.runtime.Composable
3838
import androidx.compose.runtime.getValue
3939
import androidx.compose.runtime.remember
@@ -102,7 +102,7 @@ private fun RallyTab(
102102
onClick = onSelected,
103103
role = Role.Tab,
104104
interactionSource = remember { MutableInteractionSource() },
105-
indication = rememberRipple(
105+
indication = ripple(
106106
bounded = false,
107107
radius = Dp.Unspecified,
108108
color = Color.Unspecified

TestingCodelab/app/src/main/java/com/example/compose/rally/ui/components/AnimatedCircle.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import androidx.compose.animation.core.CubicBezierEasing
2020
import androidx.compose.animation.core.LinearOutSlowInEasing
2121
import androidx.compose.animation.core.MutableTransitionState
2222
import androidx.compose.animation.core.animateFloat
23+
import androidx.compose.animation.core.rememberTransition
2324
import androidx.compose.animation.core.tween
24-
import androidx.compose.animation.core.updateTransition
2525
import androidx.compose.foundation.Canvas
2626
import androidx.compose.runtime.Composable
2727
import androidx.compose.runtime.getValue
@@ -50,7 +50,7 @@ fun AnimatedCircle(
5050
.apply { targetState = AnimatedCircleProgress.END }
5151
}
5252
val stroke = with(LocalDensity.current) { Stroke(5.dp.toPx()) }
53-
val transition = updateTransition(currentState)
53+
val transition = rememberTransition(currentState)
5454
val angleOffset by transition.animateFloat(
5555
transitionSpec = {
5656
tween(

TestingCodelab/app/src/main/java/com/example/compose/rally/ui/components/RallyTopAppBar.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import androidx.compose.material.Icon
3333
import androidx.compose.material.MaterialTheme
3434
import androidx.compose.material.Surface
3535
import androidx.compose.material.Text
36-
import androidx.compose.material.ripple.rememberRipple
36+
import androidx.compose.material.ripple
3737
import androidx.compose.runtime.Composable
3838
import androidx.compose.runtime.getValue
3939
import androidx.compose.runtime.remember
@@ -102,7 +102,7 @@ private fun RallyTab(
102102
onClick = onSelected,
103103
role = Role.Tab,
104104
interactionSource = remember { MutableInteractionSource() },
105-
indication = rememberRipple(
105+
indication = ripple(
106106
bounded = false,
107107
radius = Dp.Unspecified,
108108
color = Color.Unspecified

0 commit comments

Comments
 (0)