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 swiping to delete in Fragment?

I'm trying to create a feature where if the user swipes LEFT on an item in the RecyclerView, the item will be deleted. My RecyclerView is inside a Fragment which is inside a FrameLayout controlled by a BottomNavigation. I have the code where it…
0
votes
0 answers

How to draw a drawable onto a canvas?

I have made a class SwipeController class which extends Callback. onChildDraw is as follows: @Override public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder…
Ashish Yadav
  • 503
  • 2
  • 7
  • 28
0
votes
0 answers

How to prevent Canvas auto clear in android?

I have a recyclerView that I added a itemTouchHelper callback that works with onTouch methods. When I swipe and click anywhere outside of the viewholder it should make the button disappear and bring the viewholder back to its original location. My…
0
votes
2 answers

RecyclerView drag sort index is wrong

I use ItemTouchHelper to achieve RecyclerView drag sorting. The problem is that ViewHolder has changed, but the index of ViewHolder has not changed. What's wrong? Thanks!!! ItemTouchHelperCallback: @Override public boolean onMove(RecyclerView…
Liu Silong
  • 2,614
  • 2
  • 16
  • 21
0
votes
1 answer

RecyclerView - items get recycled when dragging

I have RecyclerView which is HORIZONTAL. Width of each item in it nearly equals the total width of recycler. Only up to 3 ViewHolders are visible. Here's some mockup for better understanding of how the result looks. I want to add ability to…
mroczis
  • 1,699
  • 2
  • 14
  • 16
0
votes
1 answer

StartIntent from ItemTouchHelper onSwiped()

I want to open an Intent on swiping a recyclerview item. I have the below class with error in onSwiped event. import android.support.v7.widget.helper.ItemTouchHelper.Callback; import static android.support.v7.widget.helper.ItemTouchHelper.*; class…
0
votes
2 answers

How to know the direction in which recyclerview cell is being swiped?

To my recyclerview I have attached ItemTouchHelper. User can swipe in both direction i.e. left and right. I would like to know is it possible to know as soon as user starts to drag a cell towards left or right and not after user have swiped the cell…
Pritish
  • 9,093
  • 6
  • 32
  • 68
0
votes
1 answer

Disable swipe of recyclerview cell for particular amount of time

I have a recyclerview. Each cell of recyclerview has an associated file. I am using ItemTouchHelper for swiping. When a user swipes a cell, i want to disable the swipe of other cells as long as the the file associated with swiped cell does not get…
Pritish
  • 9,093
  • 6
  • 32
  • 68
0
votes
1 answer

ItemTouchHelper not being applied to every View in Adapter

In implementing swipe-to-delete functionality I accidentally made my forground view of the viewholder transparent. In doing so I've uncovered a bug with my ItemTouchHandler not changing the background or hiding the text when it is supposed to. It…
0
votes
1 answer

Changing color of view depending on Swipe direction

I'm trying to change the color of a view depending on the direction of a swipe getsure using ItemTouchHelper's onChildDraw() method but its not working: @Override public void onChildDraw(Canvas c, RecyclerView recyclerView, ViewHolder…
0
votes
1 answer

I swipe to dismiss in adapter but I cannot delete in Firebase

Without swiping item, I delete with this method: public void deleteItem(int index) { Toast.makeText(this, ""+ index, Toast.LENGTH_SHORT).show(); firebaseFirestore.collection("ToDoList").document(mAuth.getCurrentUser().getUid()) …
0
votes
1 answer

Swipe in RecyclerView (icon size)

When the item is swiped the background is colored by another color and an icon is displayed. All works well, but I do not like the fact that the icon changes size depending on the height of the item. Please, tell me how to make the icon always…
0
votes
2 answers

How show custom layout under swiped RecyclerView item?

I want after swiped RecyclerView item to get my custom layout on the background. And I found a solution to which leads a lot of links. But I have problems using it. Reference to the solution - https://stackoverflow.com/a/35667044/8013212 If you do…
0
votes
2 answers

RecyclerView item removal behaves aberrantly

I am using this tutorial to build an itemTouchListener for my RecyclerView. The recyclerview is filled with more items than the screen fits (more than 10), so recycling gets into action. The itemtouchHelper handles both up-down and left-right…
oupoup
  • 55
  • 6
0
votes
1 answer

ItemTouchHelper Class is not known by my Android studio

i wanted to use the ItemTouchHelper Class, which should be available in the standard installation of android studio (so i wrote in the internet). Anyhow i get an error message, when i try to use this class. You can see in picture. Error helper…
1 2 3
11
12