Kazemihabib1996
04/29/2020, 4:48 PMfling animation
fun AnimatedFloat.fling(
startVelocity: Float,
decay: DecayAnimation = ExponentialDecay(),
adjustTarget: (Float) -> TargetAnimation?,
onEnd: OnAnimationEnd? = null
)
it accepts a startVelocity and decay so far it makes sence.
but it also accepts an adjustTarget that's the what I can't understand, setting new target with new animation inside fling animation?matvei
04/29/2020, 4:55 PMdecay . For example, imagine you have some bounds and want to nicely fling to the bound, not at the random point where decay stopped it. That's when you can adjust target so fling will end where you need it tomatvei
04/29/2020, 4:57 PMKazemihabib1996
04/29/2020, 5:23 PMadjustTarget if the targetAnimation is not null.matvei
04/29/2020, 5:24 PMnull will just work fine 🙂