I\'m just starting to play with MotionLayout
. I have defined an activity layout using MotionLayout
that uses a MotionScene
to hide and sh
I just used this hack: click is handled programmatically, but it triggers the hidden view, on which <OnClick>
is registered in MotionScene
:
actualVisibleView.setOnClickListener {
doSomeLogic()
hiddenView.performClick()
}
And in MotionScene
:
<Transition
android:id="@+id/hackedTransitionThanksToGoogle"
motion:constraintSetEnd="@layout/expanded"
motion:constraintSetStart="@layout/closed"
motion:duration="300"
motion:motionInterpolator="linear">
<OnClick
motion:clickAction="transitionToEnd"
motion:targetId="@+id/hiddenView" />
</Transition>