Questions tagged [itemtouchhelper]

Use this tag for questions related to the Android widgets ItemTouchHelper utility class.

ItemTouchHelper is a utility class part of Android support widgets to add swipe to dismiss and drag & drop support to RecyclerView.

191 questions
58
votes
13 answers

RecyclerView ItemTouchHelper Buttons on Swipe

I am trying to port some iOS functionality to Android. I intent to create a table where on swipe to the left shows 2 button: Edit and Delete. I have been playing with it and I know I am very close. The secret really lies on the method OnChildDraw.…
Gustavo Baiocchi Costa
  • 1,379
  • 3
  • 16
  • 34
30
votes
3 answers

Detach ItemTouchHelper from RecyclerView

I have a RecyclerView with a working ItemTouchHelper. Everything works great, but I am wondering if there is a way I can detach the ItemTouchHelper from the RecyclerView without re-creating the list? For fun, this is the code I'm using to…
nverbeek
  • 1,882
  • 17
  • 20
18
votes
4 answers

ItemTouchHelper with RecyclerView in NestedScrollView: Drag scrolling not work

I have implemented ItemTouchHelper like descriped in this articel: https://medium.com/@ipaulpro/drag-and-swipe-with-recyclerview-b9456d2b1aaf#.k7xm7amxi All works fine if the RecyclerView is a child of the CoordinatorLayout. But if the RecyclerView…
14
votes
2 answers

How to Stop Swiping the item in Recycler view after reaching some distance

I have a Recycler View in android. I have attached an ItemTouchHelper to it.I have enabled only swiping from left to right. So when i swipe any item of Recycler view , the item starts moving towards right and on the left i draw a text. This is fine…
Pardeep Kumar
  • 900
  • 1
  • 14
  • 30
10
votes
0 answers

How to drag multiple items together in Android recyclerView?

I am using simpleItemTouchHelper to enable drag and drop in recyclerview. It works well. But I want to drag multiple items(specific amount-> eg.3 or 4) by dragging one item. In my project, when I select and drag header item, I also want to move its…
Chan Myae Aung
  • 547
  • 3
  • 15
10
votes
4 answers

ItemTouchHelper - The drop is forced after the first jumped line

I am using ItemTouchHelper and ItemTouchHelper.SimpleCallback to allow the user to reorder a vertical list Recycler View. The drag and drop works but the drop is forced after the first jumped line even though I don't leave up my finger from the…
u2gilles
  • 6,888
  • 7
  • 51
  • 75
9
votes
0 answers

Scroll recyclerview on item drag using ItemTouchHelper.Callback

ItemTouchHelper.Callback call interpolateOutOfBoundsScroll by default when the item is partially out of the screen. But How can I scroll the recyclerview when the item is being gradually dragged to the bottom of the screen. public class…
S Haque
  • 6,881
  • 5
  • 29
  • 35
9
votes
2 answers

notifyItemChanged not refreshing view

First of all, I worked on this all day but could not get anything done. I have a RecyclerView with an adapter that uses RecyclerView's SortedList. I tried implementing TouchHelper with the callback class: public class TimerListTouchHelperCallback…
Aayush Subedi
  • 191
  • 1
  • 12
7
votes
1 answer

Android ItemTouchHelper.SimpleCallback get swipe direction

I have implemented swipe to dismiss into my recyclerview. It triggers 2 functions(editing of the record and deleting). If you swipe to the left, you edit it, if right, you delete it. I have such layout under the general part of the recyclerview…
Vitaly Kalenik
  • 410
  • 4
  • 12
7
votes
0 answers

RecyclerView drag and drop not working with several view types

I am trying to use a RecyclerView with a vertical LinearLayoutManager in order to display a list items. This list can contain several different item types (differents layouts), and it can be reordered by the user using drag and drop. For the item…
7
votes
1 answer

RecyclerView drag-drop - using ItemTouchHelper - How to set scrolling speed faster while dragging?

I tried this code for drag and drop : https://github.com/iPaulPro/Android-ItemTouchHelper-Demo. Here is a video : https://youtu.be/lMsv2jYpbi4 Is there a way to speed up the scrolling during drag-and-drop ?
jhegedus
  • 20,244
  • 16
  • 99
  • 167
6
votes
1 answer

How do I perform a drag and delete item functionality in a RecyclerView

I was able to implement drag and drop items in a list and reorder them. What I need to do is implement a delete functionality where one can select and hold an item and drag it to a trash icon. Once it overlaps the trash icon, the latter will change…
Bargain23
  • 1,863
  • 3
  • 29
  • 50
6
votes
2 answers

ItemTouchHelper, Swipe to delete with text in canvas

We are implementing ItemTouchHelper in a RecyclerView, we are making a Override of onChildDraw when we swipe to the left in the RV, the problem is, if I have a RecyclerView with X size, and I try to dismiss the 2, 3, 4 or 5 elements, the only one…
Dinorah Tovar
  • 311
  • 2
  • 6
5
votes
2 answers

RecyclerView ItemTouchHelper.Callback: Dragging swap condition

I want to implement dragging the cards in such a way that the rearrangement of the cards starts when the card that I am dragging does not completely overlap the element, but only 50%. Check out an example: Now, for the right card to move to the…
5
votes
0 answers

More efficient way to call ListAdapter's submitList to update RecyclerView after drag and drop

I am using the ItemTouchHelper class to support drag and drop in my RecyclerView. I have an implementation that works as intended but it seems to be very inefficient. In my onMoved method, I get the current version of the list, swap the item that is…
1
2 3
12 13