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
5
votes
2 answers

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
  • 114,585
  • 152
  • 739
  • 1,270
5
votes
1 answer

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,947
  • 2
  • 23
  • 61
5
votes
2 answers

Recyclerview Drag and Drop ontouch

I have used ItemTouchHelper to implement drag and drop in recyclerview. It works fine. But it is working only on long press. I need to do it with onTouch ItemTouchHelper.Callback itemTouchHelperCallback = new ItemTouchHelper.Callback() { public…
Jyoti JK
  • 2,141
  • 1
  • 17
  • 40
5
votes
4 answers

Confirm dialog before swipe delete using itemtouchhelper

How can I show confirm dialog before deleting Recyclerview Item using ItemTouchHelper. I have create RecyclerView and implemented basic ItemTouchHelper.Callback class. But, I don't know what to do next. I have created below class and attached it to…
Yesudass Moses
  • 1,841
  • 3
  • 27
  • 63
5
votes
0 answers

ItemTouchHelper startSwipe not working

I tried to use startSwipe within adapter, it seems not working. Strangely, when I tried swipe it with finger manually, it worked. Just that startSwipe does not work when i clicked on of the button inside holder. Need help on this~ This is where i…
kkl
  • 73
  • 5
5
votes
2 answers

How to restrict ItemtouchHelper to swipe only left to right

Hi I am using recycler view and apply ITEMTOUCHHELPER its working. I apply Logic (direction == ItemTouchHelper.LEFT) then delete item. All of these things work correctly. But when I swipe right side and then swipe left side. It give dX value…
Syed Qasim Ahmed
  • 1,352
  • 13
  • 24
4
votes
3 answers

How to know when user is done moving a RecyclerView item?

I need to execute something when the user drops an item. The ItemTouchHelper seems to only have calls for onMove and onMoved which happen regardless of whether the user is actually done moving the item. How do I know when the user has finished…
Ben Mora
  • 279
  • 3
  • 16
4
votes
1 answer

Unwanted animation due to conflict between ItemTouchHelper and DiffUtil

I am implementing a RecyclerView with drag and drop support. When an item is dropped, the index column of that item will be updated in the Room database to store the updated sorting. The problem I am facing is, when I call the Room database update…
4
votes
0 answers

Itemtouchhelper & ActionMode: How to combine multi-selection & rearranging items

I am trying to build a recyclerview with the same functionality like f.ex. wunderlist. LongClick should activate action mode with the long-clicked item selected, and further items added to the selection by normal clicking them in action mode. BUT I…
4
votes
1 answer

notifyItemMoved() not working when migrated to ListAdapter Android

We have this feature in our App where we can drag recycler view Items up and down. Inside onMove() of ItemTouchHelper.Callback() we call adapter.onItemMove(source.adapterPosition, target.adapterPosition) and the adapter code goes like this override…
4
votes
2 answers

how to create RecyclerView drag and drop (swap 2 item positions version)

I have ItemTouchHelper class that uses swiping and drag and drop for performing actions. But i want to change drag and drop behavior. It should swap positions of 2 elements, the first one I dragged and the other one where it is dropped on. i want to…
Kratos
  • 681
  • 1
  • 13
  • 30
4
votes
1 answer

How to use item touch helper with heterogeneous view types?

I am following this tutorial Item touch helper example (well actually just the item touch helper part and that too because I want the red background with the delete icon seen when swiping). But I have two different view types in my recyclerview. How…
BVB09
  • 805
  • 9
  • 19
4
votes
2 answers

Android ItemTouchHelper Partial Swipe

When we swipe from the end, I am able to display red colour background and a delete icon. I am trying to achieve partial swipe functionality, where on partial swipe, the swipe stops before the delete icon. I tried following these solutions. But, it…
4
votes
0 answers

ItemTouchHelper for ExpandableListview

I have been working on expandablelistview. And its working fine with many adjustments. I am happy to use it and it is working like charm so far. But now I have new requirements where user can able to perform the several things. and that is as…
4
votes
1 answer

Android RecyclerView with Multiple View Types and ItemTouchHelper

I'm trying to get ItemTouchHelper to work with a RecyclerView that has multiple view types. I've seen a few answers that say that in order to get this to work the recyclerView adapter has to have setHasStableIds(true) and overrider getItemId(int…
drod
  • 359
  • 5
  • 17
1
2
3
12 13