问题
I am using MotionLayout for my page. I have two states which is toggled with OnSwipe of a view:
<Transition
motion:constraintSetStart="@+id/start"
motion:constraintSetEnd="@+id/end"
motion:duration="700"
motion:motionInterpolator="easeIn">
<OnSwipe
motion:dragDirection="dragUp"
motion:touchAnchorId="@+id/view"
motion:touchAnchorSide="bottom"
motion:touchRegionId="@+id/view" />
</Transition>
I also want to add OnClickListener to this view from code, or add new Transition in scene.xml file, which will do something different then OnSwipe Transition and will be triggered with OnClick of the same view. But both of them blocks OnSwipe. So Is there a way to have OnSwipe and OnClick on the same view?
Thank you
来源:https://stackoverflow.com/questions/58996674/motionlayout-onswipe-and-onclick-on-same-view