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
0
votes
0 answers

Can't delete data from database after removing from RecyclerView

I have a list of elements (rv) and a function which deletes elements from adapter on swipe gesture. I also have an undo action. How to delete data from database? It deletes the wrong data. MainActivity: val onSwipe = object : OnSwipe(this) { …
0
votes
1 answer

How to learn whether a Snackbar button was pressed?

I have a Snackbar which is being opened when a user swipes on a RecyclerView element to delete it. And this Snackbar allows a user to undo his action. I know how to get an element of the RecyclerView back. But I also have a database(SQLite). It…
0
votes
1 answer

How to pass data from adapter to fragment using ItemTouchHelper.SimpleCallback

I have a RecyclerView where I display my data and I have an ItemTouchHelper to swipe to delete my data. All works good with this but what I'm to do is to pass a variable from adapter to use it in onSwiped method of ItemTouchHelper.SimpleCallback in…
0
votes
0 answers

ItemTouchHelper Action Drag Not Get Called While Dragging

I want to create an indicator to show when user want to grouping item in recyclerview, i already create the code to handle the grouping and indicator, and the code to handle indicator show i place in ItemTouchHelper ActionStateDrag, the problem is…
0
votes
1 answer

RecyclerView Reorder Items with ItemTouchHelper.SimpleCallback and call notifyDataSetChanged() on Gesture start

I Have a RecyclerView that lets the user reorder its items when long taping using ItemTouchHelper.SimpleCallback, the problem is that UX wants to hide a handle on all item views BUT the dragged one, to provide some kind of feedback when the long tap…
Andres
  • 51
  • 7
0
votes
1 answer

How Can I delete an entry from realtime database using onSwipe on a recyclerview

I am looking to delete an entry using onSwipe, I have this code below that works to swipe but it does not delete from firebase, when I swipe the app crashes. see my code below and the logcat error. @Override public void onSwiped(@NonNull…
0
votes
1 answer

ItemTouchHelper - Can't scroll RecyclerView, Swipe doesn't work

Well, at the beginning of the Implementation of ItemTouchHelper, I chose to use only the Swipe function from it. Everything worked - with the help of Swipe I could delete items in RecyclerView etc. But then I thought I'd add up-down movement so that…
0
votes
1 answer

Android ItemTouchHelper for two recyclerviews

I am creating a launcher app and I am using RecyclerView and ItemTouchHelper for reorder icons and it works well. But I want to drag and drop my items into another recycler view (folders, bottom icons, other pages) Is it possible with…
0
votes
1 answer

swiping to delete row in recyclerview

i have a created an android app with a recyclerview. each row in the recyclerview has 3 textviews and an edittext. the data is added to the recyclerview from a dialogfragment list that i created. i liked to implement a delete when swiped method to…
0
votes
1 answer

ItemToucherHelper not swipe in recyclerView with vertical LinearLayoutManager

I am trying to attach an ItemTouchHelper to my recyclerView to implement swipe-to-read functionality, I have this code for ItemTouchHelper.Callback: public class MessageCommentSwipeCallback extends ItemTouchHelper.Callback { private static final…
shopkeeper
  • 189
  • 1
  • 9
0
votes
1 answer

How to restore swiped item from RecyclerView after dialog show?

I am using ItemTouchHelper with AlertDialog. The problem is when user swipe the element to the right side. AlertDialog with EditText is show at the screen. Now I want to do something like that: When user press "save" button the element disappears…
0
votes
0 answers

How to stop dragging when ViewHolder reaches top or bottom of RecyclerView

I have a recyclerView that supports drag and drop. When I drag a viewHolder to the end of the list it keeps dragging past the last index. What is the proper way to make it stop dragging when it reaches the end? Right now, when "dropped" it snaps…
gig6
  • 307
  • 5
  • 16
0
votes
1 answer

When deleting the last position from ItemToucjHelper , the first one is deleted

Good afternoon! What day I rack my brains I can't understand why this is happening :( When you delete the last position with a swipe, the first one is deleted, this happens only with the last position. private NotesAdapter notesAdapter; private…
0
votes
1 answer

Android ItemTouchHelper onChildDraw make itemView return to its original position

I override in SimpleItemTouchHelper class the method onChildDraw the following way: @Override public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean…
0
votes
1 answer

Dragging in recyclerview is not working but swiping is?

I'm trying to get the dragging function to work on my recyclerView but only the swiping works at the moment. I only have the basic code which as far as I understand should enable the action ItemTouchHelper helper = new ItemTouchHelper(new…