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
1
vote
1 answer

ItemTouchHelper onMove Update items positions

When using the itemTouchHelper onMove method. How can you while using a numbered list based on the position in the list. For example, item 1, item 2, item 3, etc. all based on the actual position in the list the item is in. How can you then when…
wesley franks
  • 6,765
  • 4
  • 16
  • 29
1
vote
0 answers

RecyclerView items list empty in ItemTouchHelper.SimpleCallback

The RecyclerView is supposed to show some users working hours and allow him to edit/delete them. To enable editing and deleting, I attached an ItemTouchHelper.SimpleCallback to the RecyclerView in order to have swipe-to-delete and swipe-to-edit. At…
1
vote
1 answer

Android ScrollView inside RecyclerView.ViewHolder: prevent ItemTouchHelper from getting touch event?

Setup: I have a RecyclerView with a vertical LinearLayoutManager. Each ViewHolder has 2 TextViews (green and red in the picture), which can be very long. RED can be scrolled horizontally thanks to a HorizontalScrollView. GREEN can be scrolled…
mrj
  • 589
  • 1
  • 7
  • 17
1
vote
0 answers

Disable Swipe in RecyclerView

I have implemented a swipeable recyclerview for editing purpose. Since the cardview contains a seekbar, it conflicts with the swipe. I overcame this problem using a button in toolbar menu, pressing the button once attaches the itemtouchhelper to the…
1
vote
0 answers

Hiding a small line in a RecyclerView ItemTouchHelper

I'm new on Android studio. I made a RecyclerView with a list of data, and I implemented the event on Swiped with an ItemTouchHelper. When I swipe a child from the right to the left I see a small line like in the photo I would hide this small line.…
1
vote
1 answer

How can I send text value from ViewHolder to ItemTouchHelper class?

I've been learning Java and Android Development for about a month. Maybe, I don't know some features... But I can't find any advise for a week. I need to send value from one of my fields in ViewHolder (created by onBindViewHolder) to overrided…
1
vote
1 answer

how to restore recycler view item after swipe

I have a recyclerview and I've add swipe to it with itemtouchhelper class and it works fine, there is 2 views in layout that foreground view moves on swipe over bacjground layer, problem is I want to foreground view get the previous location after…
saber javadi
  • 473
  • 1
  • 7
  • 17
1
vote
1 answer

Using ItemTouchHelper.Callback for creating a swipe left menu in a RecyclerView

I have been trying to implement a "swipe menu" for my items in a RecyclerView using the "ItemTouchHelper.Callback". What I am trying to do at first, is to make the item stop at a certain position, instead of sliding all the way back to (X)position…
Langkiller
  • 3,377
  • 13
  • 43
  • 72
1
vote
1 answer

disable few cells in recycleView from swipe or hide delete while swiping

I have a custom recycleView with swipe to delete option. I am able to display custom recycleView and also delete the item by swipping it. Swipe to delete is implement by using a separate class which implements SimpleCallback. Now, i want to disable…
user2269164
  • 1,095
  • 2
  • 15
  • 31
1
vote
1 answer

ItemtouchHelper causing an index out of bounds Exception

I have a private ItemTouchHelper that delete a row from a room database however currently it's cause an ArrayIndexOutOfBounds exception when I swiping to delete: FATAL EXCEPTION: main Process: xxx.xxx.xxx.xxx, PID:…
Adrian Coutsoftides
  • 1,203
  • 1
  • 16
  • 38
1
vote
1 answer

Gap between recyclerview items after dismissing an item

I was experimenting with the recyclerview trying to learn how to allow a swipe dismiss with an item in the view. Whenever I dismiss an item, the space the item used to take up is still there with an empty space. The items won't move up to populate…
1
vote
2 answers

Hover event in RecyclerView using ItemTouchHelper

I have a RecyclerView and implemented drag and drop functionality using the ItemTouchHelper and ItemTouchHelper.Callback. In ItemTouchHelper.Callback I have the callback method onMove() which gets called after the dragged view was dragged over the…
1
vote
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…
1
vote
0 answers

RecyclerView swipe and move item not working with BottomSheetDialog in Android

I want to swipe and drag & drop items in RecyclerView using ItemTouchHelper class. The RecyclerView is placed inside BottomSheetDialog. Following is the code for setting up RecyclerView musicAdapterRecyclerView = new MusicAdapterRecyclerView(this,…
1
vote
1 answer

Android - RecyclerView: Remove items with swiping

I have a RecyclerView and the items should be removed after swiping them. I solved it with the ItemTouchHelper class. In the onChildDraw method I set up a red background which appears while swiping behind the list item. On top of that there is a…
Nono
  • 1,073
  • 4
  • 23
  • 46