Closed wiryadev closed 1 year ago
Change onSwipe to:
<OnSwipe
app:dragDirection="dragStart"
app:touchAnchorId="@id/rvPoster"
app:touchAnchorSide="start"
app:onTouchUp="stop"/>
comment out:
// setOnTouchListener { v, event ->
// Log.d("OnTouchListener", "event: $event")
// binding.motionLayoutHorizontal.onTouchEvent(event)
//// v.performClick()
// return@setOnTouchListener false
// }
Thank you for the help, it works smoothly
Im creating horizontal recyclerview inside motionlayout. I have intercept the OnTouch but the transition only working after first ACTION_UP. So first time the screen is opened, animation not working. After i touch it and lift my fingers up which triggers ACTION_UP, then it is working now.
So the flow is like this: opened the screen -> swipe -> ACTION_MOVE happened, but animation not working -> lift fingers up -> ACTION_UP happened -> swipe again, now animation working.
GIF can be seen here.
The project for reproduce is in here.
Why is it happening and how to solve it?
My onTouchListener
My motionscene: