janishar / PlaceHolderView

This library provides advance views for lists and stacks. Some of the views are build on top of RecyclerView and others are written in their own. Annotations are compiled by annotation processor to generate bind classes. DOCS -->
http://janishar.com/PlaceHolderView
Apache License 2.0
2.11k stars 369 forks source link

Disable swiping for SwipePlaceHolderView #15

Closed rsaksida closed 8 years ago

rsaksida commented 8 years ago

Hey, I was wondering if the library allows us to disable swiping somehow for SwipePlaceHolderView? Meaning cards could only be swiped programatically.

If it doesn't, this would be a cool feature to have - something like swipePHView.setSwipeEnabled(false).

Let me know if a pull request for this would be desirable :smiley: Thanks!

janishar commented 8 years ago

@rmsaksida Thanks for the nice suggestion. Could you help me out with use cases where this can be a requirement.

I am writing a putback mechanism for the cards. So if a card has not to be removed it could be put back and further cards can only be removed if putback is not intended. This will provide a mechanism of card swipe control like Tinder. Tinder cards let you swipe and then put it back if the heart is over. If the swipe disable feature can be used in more versatile cases please let me know.

Thanks

rsaksida commented 8 years ago

Hey, I can think of a few use cases:

So I think this feature is actually pretty different from a "card putback". The card putback is triggered after swiping the card, in this case the swiping won't happen at all.

I suspect the use case for disabling swiping is actually more common than a card putback... the latter looks more niche in my opinion.

janishar commented 8 years ago

@rmsaksida Okay You do it and push your changes Also I have changed the project structure so do take a fresh clone

rsaksida commented 8 years ago

Okay, I'll try to implement this and create a pull request. :+1:

ramseth001 commented 5 years ago

@janishar I am looking for this feature. I was wondering whether this is implemented?

ramseth001 commented 5 years ago

Sorry. Just found out swipeView.disableTouchSwipe();