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.

176 questions
45
votes
11 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,164
  • 3
  • 15
  • 30
23
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,732
  • 13
  • 17
14
votes
2 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…
11
votes
1 answer

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
  • 730
  • 10
  • 27
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…
CodeCameo
  • 3,208
  • 4
  • 18
  • 24
9
votes
2 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
  • 4,628
  • 4
  • 35
  • 59
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
  • 11
7
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
  • 487
  • 3
  • 13
6
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…
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,504
  • 1
  • 17
  • 40
6
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
  • 141
  • 1
  • 12
6
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
  • 18,516
  • 11
  • 84
  • 147
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
1 answer

How to cancel dragging of items in RecyclerView when using ItemTouchHelper, as you drag?

Background I'm trying to have a RecyclerView that has different view types, and yet has the ability for drag&drop, together with single click and long click operations. It's similar to what you have on Phone app, where you can change the order of…
android developer
  • 106,412
  • 122
  • 641
  • 1,128
5
votes
0 answers

How to draw three buttons for swipe menu with itemTouchHelper RecyclerView?

I would like to create smth like that with using ItemTouchHelper: This picture was taken from my current project but it was created with SwipeRevealLayout and it is too difficult for me to customise it.Some days ago, I saw this question and…
Andrew
  • 1,416
  • 10
  • 35
1
2 3
11 12