How to set custom Interpolator programatically in MotionLayout

28 views Asked by At

I have created some animations with MotionLyout using the Android Studio design tool, so everything is under the layout xml and the scene xml files. In one transition I used the motion:motionInterpolator="bounce" configuration but I don't like the way it bounces (4 times bouncing). So I am considering creating my custom bounce Interpolator but I cannot find a way to set this interpolator programatically, like we can do with the AnimationUtils lib:

AnimationUtils.loadAnimation(this, R.anim.scale).apply {
    interpolator = CustomBounceInterpolator()
    viewToAnimate.startAnimation(this)
}

Is there a way to set this custom interpolator programatically in MotionLayout?

0

There are 0 answers