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
3
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…
3
votes
1 answer

RecyclerView ItemTouchHelper swipe action is not working in Fragment Class

I have a recyclerview inside one of a fragment class under FragmentViewPagerAdapter. Here at Recyclerview I implement ItemTouchHelper for a swipe which is not happening. Does anyone have come across this issue. Can't use itemtouchhelper swipe…
user2273146
  • 1,482
  • 2
  • 13
  • 24
3
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
  • 53
  • 5
3
votes
0 answers

get ItemTouchHelper object from RecyclerView

In my code I attach an ItemTouchHelper to RecyclerView in this way: ItemTouchHelper itemTouchHelper = new ItemTouchHelper(simpleItemTouchCallback); itemTouchHelper.attachToRecyclerView(mRecyclerView); simpleItemTouchCallbak is an…
Misagh Emamverdi
  • 3,446
  • 4
  • 26
  • 50
3
votes
0 answers

CardView halfway swipe in RecyclerView with ItemTouchHelper

I want to show user menu, under CardView, when he/she swipes it; but I want cardView to stop on half-way during swiping; I've created MyItemTocuchHelper class and overrided onChildDraw() method: public class MyItemTocuchHelper extends…
2
votes
2 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
  • 170
  • 9
2
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…
2
votes
3 answers

ItemTouchHelper.SimpleCallback onMove() is not triggered

I want to realize drag and drop in my RecyclerView. As I found out, the best way to implement this is by attaching an ItemTouchHelper to the RecyclerView. onSwiped() works fine, but onMove() is never triggered. This is what I…
Gerke
  • 437
  • 1
  • 4
  • 15
2
votes
0 answers

Android: RecyclerView item with LongClickListener and and drag and drop

So, I'm trying to figure this out. I see many posts online about having RecyclerView items with both swipe and drag-- I've got that down. But what I can't get to work is both drag and long press actions. I've got working code for both drag and…
claxtastic
  • 115
  • 6
2
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…
2
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…
2
votes
0 answers

onSwipeCompleted view dissapiers, have empty space and swipe doesnt work any more

I am using EpoxyTouchHelper. onSwipeCompleted view disappears leaving empty space. I update controller's data with updated data controller.setData(List); but it doesn't help. As well swipe stops working and I can't swipe any other item. privat…
Mantaz
  • 284
  • 1
  • 4
  • 9
2
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
  • 575
  • 5
  • 14
2
votes
1 answer

Drag & drop items with itemtouchhelper, recyclerview and Firestore like Google Tasks

I develop a todo app and would like to have a similar feature like Google Tasks has. Here my Google Tasks task list on my android app: Screenshot of Google Tasks android app When I drag an drop one of those tasks vertically then my Google Tasks…
2
votes
0 answers

ConvertToAbsoluteDirection() in ItemTouchHelper.callback

I'm trying to create a Recycler view with a swipe feature to Add to favorites. I've read about the ItemTouchHelper class and how to keep the cards from totally sliding over. I couldn't understand the function below public int…
1 2
3
11 12