idanatz / OneAdapter

A Viewholderless Adapter for RecyclerView, who supports builtin diffing, states (paging, empty...), events (clicking, swiping...), and more.
MIT License
470 stars 45 forks source link

Stop swipe on left or on right #11

Closed elghamry closed 4 years ago

elghamry commented 4 years ago

i tried to stop the swipe on left or right and it couldn't be done thanks for amazing library

idanatz commented 4 years ago

Hi, thanks for the kind words What do you mean by stop the swipe? Once the user swipe has passed a certain threshold it cannot be stopped as the RecyclerView has registered it as a swipe intent. What exactly are you trying to achieve?

elghamry commented 4 years ago

Your are welcome i mean that when you use swipe functionality in the adapter by default swipe left and right work i wanna make one of them off

idanatz commented 4 years ago

look at the SwipeEventHook class: SwipeEventHook(supportedSwipeDirections: SwipeDirection = SwipeDirection.values())

you can pass the direction of the supported swipe you wish, for example: for right swipe: SwipeEventHook(SwipeDirection.Right) for left swipe: SwipeEventHook(SwipeDirection.Left)

if none is specified then both Right and Left are supported.

Maybe in the next version, i will add a function to specify the supported direction to make this more clear, so keep an eye for a future version.

elghamry commented 4 years ago

okay i got the idea ... iam waiting for the amazing coming version :D thanks for your efforts