Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Left Swipe and right Swipe on Button Click #20

Open
MyCodlab opened this issue Nov 27, 2018 · 2 comments
Open

How to Left Swipe and right Swipe on Button Click #20

MyCodlab opened this issue Nov 27, 2018 · 2 comments

Comments

@MyCodlab
Copy link

Hello Sir,
thanks for code, I am using this code and i am swiping this card on button click .Please help me .

@MaCls98
Copy link

MaCls98 commented Nov 6, 2019

I know it's a little late to answer this but if someone else will use something, all you have to do is call the item swipeTouchHelper, just like this

itemTouchHelper.swipe(rvInGame.findViewHolderForAdapterPosition(position), ItemTouchHelper.RIGHT);

In this case rvInGame is my RecyclerView and position is the current position of the RecyclerView adapter, I get the position from a method I call in a listener of my adapter, as in any RecyclerView with an OnItemClickListener.

@privateminiproject
Copy link

I know it's a little late to answer this but if someone else will use something, all you have to do is call the item swipeTouchHelper, just like this

itemTouchHelper.swipe(rvInGame.findViewHolderForAdapterPosition(position), ItemTouchHelper.RIGHT);

In this case rvInGame is my RecyclerView and position is the current position of the RecyclerView adapter, I get the position from a method I call in a listener of my adapter, as in any RecyclerView with an OnItemClickListener.

thank you.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants