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
0
votes
1 answer

RecyclerView ItemTouchHelper getAdapterPosition() returns wrong value on fast swipe

I have a problem regarding RecyclerView + Swipe to delete + undo with the help of a snackbar. Whenever I try to fast swipe 3+ items to delete them, viewHolder.getAdapterPosition(); returns a wrong value. Seems like it can't react that…
0
votes
0 answers

How to swap items in Firebase-database using FirebaseRecyclerAdapter?

General task: I want to implement “drag & drop” and “swipe-to-dismiss” functionalyty to FirebaseRecyclerAdapter. It should work something like this: Drag and swipe .gif expample. First I’ll created an interface that allows to pass event…
0
votes
1 answer

Restore a swiped view on pressing back button in RecyclerView?

Hi i was following this tutorial here about drag and swipe on a RecyclerView using itemtouchhelper.callback Everything works fine but what if want to restore the view that was swiped out by pressing the backbutton. how it can be done ?
Misterrai
  • 77
  • 1
  • 8
0
votes
1 answer

ItemTouchHelper: How to prevent "fling" swipes until finger passes swipe threshold?

Context: I'm implementing ItemTouchHelper with swipe actions (Date, Complete, Delete, Settings). I have getSwipeThreshold() return .2f. This means I need to drag horizontally 2/10 of the way to swipe. I made it so that passing that threshold would…
Serpentos
  • 33
  • 5
0
votes
1 answer

correct way to implement item touch helper on recyclerview in android

i followed a tutorial here on how to implement onItemTouchHelper and callback methods when i run my code it works to the point that i can long press and pick up the item but the moment i move it past one of the other items in the list my app will…
Martin Seal
  • 566
  • 1
  • 12
  • 29
0
votes
0 answers

Android Drag and Drop - Create a Folder on dropping an item over another using Recycler view

I have implemented Drag and Drop functionality using ItemTouchHelper in GridView. I used the idea from Paul Burke I am able to re order and swap the items but i need to add another functionality to create a folder on dropping one file/item over…
Sujiz
  • 1,660
  • 1
  • 20
  • 30
0
votes
2 answers

RecyclerView drag highlight

How to change/remove item drag highlight? I'm using ItemTouchHelper and I know I need to do something with onChildDraw method but I don't want to override the whole ACTION_STATE_DRAG event, only need to affect that gray frame that appears when…
Hahaido
  • 83
  • 1
  • 11
0
votes
1 answer

RecyclerView with ItemTouchHelper only part swipeable

I have a recyclerview list with items like this: The red square only can we swiped (drag and drop out) to the left, and the green only can we swiped to the right. When the element is swiped, appear and image with a option like this: -swipe…
RoberV
  • 568
  • 4
  • 20
-1
votes
1 answer

How to add Snackbar where View Class is not directly accessible

I am facing a problem while adding a Snackbar in my code. Actually I want to show a Snackbar in ItemTouchHelper Object. I am using ItemTouchHelper to remove items on swipe and then show a Snackbar that item is removed. How to add a Snakbar where I…
-1
votes
1 answer

What is the best way to use startSwipe function of ItemTouchHelper

I created a custom LayoutManager and TouchHelper.Callback to have a tinder-like card stack. I want my layout manager to allow only the first item to have a touch event. Firstly I override the isItemViewSwipeEnabled() of ItemTouchHelper.Callback to…
-1
votes
1 answer

How to attach the swiped view back to a recyclerview list sequentially?

i Have a recyclerview list with 4 elements the swiping will be done sequentially how the swiped views get back to their i.e on top of list on pressing undo button every time one by one? MyAdapter public class RecyclerListAdapter extends…
1 2 3
11
12