@@ -69,7 +69,7 @@ private class PredictiveBackAnimation<C : Any, T : Any>(
69
69
val activeConfigurations = remember { HashSet <C >() }
70
70
val handler = rememberHandler(stack = stack, isGestureEnabled = { activeConfigurations.size == 1 })
71
71
val animationProvider = LocalStackAnimationProvider .current
72
- val fallBackAnimation = animation ? : remember(animationProvider, animationProvider::provide) ? : emptyStackAnimation()
72
+ val anim = animation ? : remember(animationProvider, animationProvider::provide) ? : emptyStackAnimation()
73
73
74
74
val childContent =
75
75
remember(content) {
@@ -88,9 +88,9 @@ private class PredictiveBackAnimation<C : Any, T : Any>(
88
88
Box (modifier = modifier) {
89
89
handler.items.forEach { item ->
90
90
key(item.key) {
91
- fallBackAnimation (
91
+ anim (
92
92
stack = item.stack,
93
- modifier = Modifier .fillMaxSize().then(item.modifier),
93
+ modifier = Modifier .fillMaxSize().then(item.modifier() ),
94
94
content = childContent,
95
95
)
96
96
}
@@ -134,7 +134,7 @@ private class PredictiveBackAnimation<C : Any, T : Any>(
134
134
private data class Item <out C : Any , out T : Any >(
135
135
val stack : ChildStack <C , T >,
136
136
val key : Int ,
137
- val modifier : Modifier ,
137
+ val modifier : () -> Modifier = { Modifier } ,
138
138
)
139
139
140
140
private class Handler <C : Any , T : Any >(
@@ -145,7 +145,7 @@ private class PredictiveBackAnimation<C : Any, T : Any>(
145
145
private val selector : (BackEvent , exitChild: Child .Created <C , T >, enterChild: Child .Created <C , T >) -> PredictiveBackAnimatable ,
146
146
private val onBack : () -> Unit ,
147
147
) : BackCallback() {
148
- var items: List <Item <C , T >> by mutableStateOf(listOf (Item (stack = stack, key = key, modifier = Modifier )))
148
+ var items: List <Item <C , T >> by mutableStateOf(listOf (Item (stack = stack, key = key)))
149
149
private set
150
150
151
151
private var animatable: PredictiveBackAnimatable ? = null
@@ -164,8 +164,8 @@ private class PredictiveBackAnimation<C : Any, T : Any>(
164
164
165
165
items =
166
166
listOf (
167
- Item (stack = stack.dropLast(), key = key + 1 , modifier = animatable. enterModifier),
168
- Item (stack = stack, key = key, modifier = animatable. exitModifier),
167
+ Item (stack = stack.dropLast(), key = key + 1 , modifier = animatable:: enterModifier),
168
+ Item (stack = stack, key = key, modifier = animatable:: exitModifier),
169
169
)
170
170
}
171
171
@@ -191,7 +191,7 @@ private class PredictiveBackAnimation<C : Any, T : Any>(
191
191
scope.launch {
192
192
animatable?.cancel()
193
193
animatable = null
194
- items = listOf (Item (stack = stack, key = key, modifier = Modifier ))
194
+ items = listOf (Item (stack = stack, key = key))
195
195
}
196
196
}
197
197
}
0 commit comments