@@ -56,10 +56,10 @@ import kotlinx.coroutines.launch
56
56
inline fun MotionLayout (
57
57
start : ConstraintSet ,
58
58
end : ConstraintSet ,
59
+ modifier : Modifier = Modifier ,
59
60
transition : Transition ? = null,
60
61
progress : Float ,
61
62
debug : EnumSet <MotionLayoutDebugFlags > = EnumSet .of(MotionLayoutDebugFlags .NONE ),
62
- modifier : Modifier = Modifier ,
63
63
optimizationLevel : Int = Optimizer .OPTIMIZATION_STANDARD ,
64
64
crossinline content : @Composable MotionLayoutScope .() -> Unit
65
65
) {
@@ -87,8 +87,8 @@ inline fun MotionLayout(
87
87
inline fun MotionLayout (
88
88
motionScene : MotionScene ,
89
89
progress : Float ,
90
- debug : EnumSet <MotionLayoutDebugFlags > = EnumSet .of(MotionLayoutDebugFlags .NONE ),
91
90
modifier : Modifier = Modifier ,
91
+ debug : EnumSet <MotionLayoutDebugFlags > = EnumSet .of(MotionLayoutDebugFlags .NONE ),
92
92
optimizationLevel : Int = Optimizer .OPTIMIZATION_STANDARD ,
93
93
crossinline content : @Composable (MotionLayoutScope .() -> Unit ),
94
94
) {
@@ -118,10 +118,10 @@ inline fun MotionLayout(
118
118
@Composable
119
119
inline fun MotionLayout (
120
120
motionScene : MotionScene ,
121
+ modifier : Modifier = Modifier ,
121
122
constraintSetName : String? = null,
122
- animationSpec : AnimationSpec <Float > = tween< Float > (),
123
+ animationSpec : AnimationSpec <Float > = tween(),
123
124
debug : EnumSet <MotionLayoutDebugFlags > = EnumSet .of(MotionLayoutDebugFlags .NONE ),
124
- modifier : Modifier = Modifier ,
125
125
optimizationLevel : Int = Optimizer .OPTIMIZATION_STANDARD ,
126
126
noinline finishedAnimationListener : (() -> Unit )? = null,
127
127
crossinline content : @Composable (MotionLayoutScope .() -> Unit )
@@ -144,11 +144,11 @@ inline fun MotionLayout(
144
144
inline fun MotionLayout (
145
145
start : ConstraintSet ,
146
146
end : ConstraintSet ,
147
+ modifier : Modifier = Modifier ,
147
148
transition : Transition ? = null,
148
149
progress : Float ,
149
150
debug : EnumSet <MotionLayoutDebugFlags > = EnumSet .of(MotionLayoutDebugFlags .NONE ),
150
151
informationReceiver : LayoutInformationReceiver ? = null,
151
- modifier : Modifier = Modifier ,
152
152
optimizationLevel : Int = Optimizer .OPTIMIZATION_STANDARD ,
153
153
crossinline content : @Composable (MotionLayoutScope .() -> Unit )
154
154
) {
@@ -166,15 +166,15 @@ inline fun MotionLayout(
166
166
)
167
167
}
168
168
169
- @OptIn( ExperimentalMotionApi :: class )
169
+ @ExperimentalMotionApi
170
170
@PublishedApi
171
171
@Composable
172
172
internal inline fun MotionLayoutCore (
173
173
motionScene : MotionScene ,
174
+ modifier : Modifier = Modifier ,
174
175
constraintSetName : String? = null,
175
- animationSpec : AnimationSpec <Float > = tween< Float > (),
176
+ animationSpec : AnimationSpec <Float > = tween(),
176
177
debugFlag : MotionLayoutDebugFlags = MotionLayoutDebugFlags .NONE ,
177
- modifier : Modifier = Modifier ,
178
178
optimizationLevel : Int = Optimizer .OPTIMIZATION_STANDARD ,
179
179
noinline finishedAnimationListener : (() -> Unit )? = null,
180
180
crossinline content : @Composable (MotionLayoutScope .() -> Unit )
@@ -211,7 +211,8 @@ internal inline fun MotionLayoutCore(
211
211
}
212
212
213
213
val targetConstraintSet = remember(motionScene, constraintSetName) {
214
- val targetEndContent = constraintSetName?.let { motionScene.getConstraintSet(constraintSetName) }
214
+ val targetEndContent =
215
+ constraintSetName?.let { motionScene.getConstraintSet(constraintSetName) }
215
216
targetEndContent?.let { ConstraintSet (targetEndContent) }
216
217
}
217
218
@@ -270,8 +271,8 @@ internal inline fun MotionLayoutCore(
270
271
internal inline fun MotionLayoutCore (
271
272
motionScene : MotionScene ,
272
273
progress : Float ,
273
- debug : EnumSet <MotionLayoutDebugFlags > = EnumSet .of(MotionLayoutDebugFlags .NONE ),
274
274
modifier : Modifier = Modifier ,
275
+ debug : EnumSet <MotionLayoutDebugFlags > = EnumSet .of(MotionLayoutDebugFlags .NONE ),
275
276
optimizationLevel : Int = Optimizer .OPTIMIZATION_STANDARD ,
276
277
crossinline content : @Composable (MotionLayoutScope .() -> Unit ),
277
278
) {
@@ -316,11 +317,11 @@ internal inline fun MotionLayoutCore(
316
317
internal inline fun MotionLayoutCore (
317
318
start : ConstraintSet ,
318
319
end : ConstraintSet ,
320
+ modifier : Modifier = Modifier ,
319
321
transition : TransitionImpl ? = null,
320
322
motionProgress : MotionProgress ,
321
323
debugFlag : MotionLayoutDebugFlags = MotionLayoutDebugFlags .NONE ,
322
324
informationReceiver : LayoutInformationReceiver ? = null,
323
- modifier : Modifier = Modifier ,
324
325
optimizationLevel : Int = Optimizer .OPTIMIZATION_STANDARD ,
325
326
crossinline content : @Composable MotionLayoutScope .() -> Unit
326
327
) {
@@ -448,6 +449,7 @@ internal inline fun MotionLayoutCore(
448
449
)
449
450
}
450
451
452
+ @Suppress(" unused" )
451
453
@LayoutScopeMarker
452
454
class MotionLayoutScope @PublishedApi internal constructor(
453
455
measurer : MotionMeasurer ,
@@ -611,7 +613,7 @@ internal fun UpdateWithForcedIfNoUserChange(
611
613
val forcedProgress = informationReceiver.getForcedProgress()
612
614
613
615
// Save the initial progress
614
- val lastUserProgress = remember { Ref <Float >().apply { value = currentUserProgress} }
616
+ val lastUserProgress = remember { Ref <Float >().apply { value = currentUserProgress } }
615
617
616
618
if (! forcedProgress.isNaN() && lastUserProgress.value == currentUserProgress) {
617
619
// Use the forced progress if the user progress hasn't changed
0 commit comments