+472
−0
+157
−0
Loading
Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more
This function simplifies the creation of complex motion specifications. It allows you to define a series of motion segments, each with its own behavior, separated by breakpoints. See: https://kotlinlang.org/docs/type-safe-builders.html Example Usage: ```kotlin val motionSpec = buildDirectionalMotionSpec( defaultSpring = materialSpatial, // Start as a constant transition, always 0. initialMapping = Mapping.Zero ) { // At breakpoint 10: Linear transition from 0 to 50. target(breakpoint = 10f, from = 0f, to = 50f) // At breakpoint 20: Jump +5, and constant value 55. constantValueFromCurrent(breakpoint = 20f, delta = 5f) // At breakpoint 30: Jump to 40. Linear mapping using: // progress_since_breakpoint * fraction. fractionalInput(breakpoint = 30f, from = 40f, fraction = 2f) } Test: atest KotlinTypeSafeSpecBuilderTest Bug: 392535934 Flag: com.android.systemui.scene_container Change-Id: If0fc6bf34c5bf282725095ee63af5ced7eac64bf