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

How to use ItemTouchHelper.SimpleCallback with ViewPager2?

I have created a image slider using ViewPager2, I need a functionality that when I swipe up the image should be removed. I already worked with RecyclerView. So I remember I can use ItemTouchHelper.SimpleCallback for swipe to remove functionality.…
3
votes
1 answer

RecyclerView - Drag and Drop - move item over another item. (placeholder)

I have an Adapter, Recyclerview and ItemTouchHelper. I want to make placeholders on which, as a result of moving, it will be possible to place items. Placeholders are now made as empty elements. But I don't know how I can put the element directly on…
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
4 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
  • 926
  • 1
  • 10
  • 20
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
  • 297
  • 1
  • 8
3
votes
1 answer

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
2 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
  • 125
  • 2
  • 8
3
votes
1 answer

android limit item dragging in a range itemtouchhelper

I have show a list of Items with RecyclerView and I have items of different types (headers and items), like the following Header 1 Item 1 Item 2 Header 2 Item 3 Item 4 Item 5 Item 6 Header 3 Item 7 .... I would like to limit swapping the position…
AndrewBloom
  • 2,171
  • 20
  • 30
3
votes
1 answer

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
  • 333
  • 1
  • 4
  • 12
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…
Skaldebane
  • 95
  • 2
  • 11
3
votes
3 answers

How to disable pull refresh, When swipe recycler view item?

I'm using a recyclerview inside a SwipeRefreshLayout and when I start to swipe to delete my recycler view item it will active pull to refresh. I want to disable pull refresh when I start swipe and it enable completed swipe. And I used…
3
votes
1 answer

Revert the swipe in Android Recycler view ItemTouchHelper with animation

I have implemented swipe with ItemTouchHelper and it works properly. In some cases I want to keep the swiped item back in the recycler view and not remove it, this part is also working fine but just makes the item to reappear. I want to bring back…
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
  • 331
  • 3
  • 16
1 2
3
12 13