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
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,312
  • 11
  • 22
4
votes
1 answer

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

RecyclerView ItemTouchHelper swipe undo

I'm reveal the hidden view after swiping with 2 buttons "delete" and "cancel". in my xml itemrow i have 2 inner Relativelayouts
4
votes
2 answers

How to implement drag and drop with ItemTouchHelper and cursors

I've been attempting to implement drag and drop features into my notes app using ItemTouchHelper however I am struggling to figure out how to get it to work with cursors. I am currently retrieving stored note data from the database using a cursor…
user6668564
3
votes
1 answer

RecyclerView(Kotlin): Adding an swipe to delete functionality on a ToDo app with data in SQL database

I am new to kotlin and android studio and currently I am trying to build an todo list applications with my own ideas. Its mostly done but I have to add edit and delete functionality to the tasks that user adds. The tasks that user adds are stored on…
3
votes
0 answers

How to handle swipe to delete and undo correctly?

I am implementing undo to delete when swipe item from recycler view. All the logic working correctly, the problem is that I am deleting the item only if the user didn't press undo on the snackbar. Which mean there is a short time between the the…
Jonny
  • 285
  • 1
  • 6
3
votes
0 answers

NotifyItemMoved between different ViewTypes Not Working

I have been going at this problem for many days now with no end in sight, so any help would definetely be appreciated! This is the problem: I have a room database and a recycler view where I display part of that database. And generally everything…
3
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…
3
votes
0 answers

How to customize ItemTouchHelper in RecyclerView Android

I have a RecyclerView where I want to enable Swipe to Delete/Star on items. My item is a FrameLayout where a MaterialCardView is on the top and the revealed star and archive layouts are under it. I already made the swipe behavior work using onTouch…
3
votes
0 answers

RecyclerView ItemTouchHelper - how to Undo or Reset swiping? Looking at how to remove background or icon

I am trying to undo the swiping (to reset background.setbounds and xmark.setbounds to 0,0,0,0) after undo is clicked on the Snackbar. I've tried clearView or tried to introduce a boolean in onChildDraw if viewBeingCleared == true then setbounds to…
H Wong
  • 221
  • 2
  • 13
3
votes
0 answers

Swipe-to-remove on a nested RecyclerView disables scrolling

I'm sure there is a simple solution of which I'm just not aware. I have a nested RecyclerView like this. The outer RecyclerView has vertical scrolling with an attached ItemTouchHelper so that swiping left triggers swipe-to-delete behavior. The…
3
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,739
  • 2
  • 24
  • 52
3
votes
1 answer

How to use ItemTouchHelper properly

I'm trying to use a RecyclerView with ItemTouchHelper for basic “drag & drop” and “swipe-to-dismiss” implementation. Swipe works correctly, items are deleted in adapter correctly, animation is correct, but “drag & drop” behaviour is very strange.…
3
votes
0 answers

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
  • 319
  • 4
  • 15
1
2
3
11 12