I am currenlty exploring a somewhat complex UI similar to the BottomSheetBehaviour
used in Google Maps, where one can animate an item from a collapsed state into an expanded state. The transition between those 2 states are Scene Transitions using the TransitionManager
framework and work rather nicely.
I am now exploring a way to drag the expanded view again into the collapsed state and vice versa, but I did not find any obvious way to manually progress a scene transition.
What I would need would be something like: Transition.setAnimatedFraction(0.5f)
based on the percentage the user has dragged between the 2 states.
Does anyone here have any idea on how to achieve that?
Migrating your parent ViewGroup
(whatever is ConstraintLayout
, RelativeLayout
or anything else) to MotionLayout
you can achieve this using MotionLayout.progress (setProgress(float)
) and loadLayoutDescription which give you power to process manually progress of a scene transition described in a motion scene.
Please see examples here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With