I’m using RecyclerView and ItemTouchHelpter to detect swipe gestures. In some applications, I have seen the user swipes the item (and it won’t go further than almost 50 % of the screen), and a background animation starts playing. When the user releases the item, there is a smooth vibration, and the foreground item will back ..
Category : itemtouchhelper
I am using object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.UP) to swipe a horizontal RecyclerView up (there is only one item in the list per screen width) in theory, user drags the view partially up, and it does something. Up until here everything is fine. However, if the user drops the view instead of dragging it back down, ..
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 String TAG="MessageSwipeCallback"; private final MessageCommentAdapter adapter; public MessageCommentSwipeCallback(MessageCommentAdapter adapter) { this.adapter = adapter; Log.i(TAG, "MessageCommentSwipeCallback: "); } @Override public int getMovementFlags(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder) ..
Here is my SwipeHelper code where I can swipe the list from Right to Left as of now. public abstract class SwipeHelper extends ItemTouchHelper.SimpleCallback { int BUTTON_WIDTH = 200; private RecyclerView recyclerView; private List<UnderlayButton> buttonList; private GestureDetector gestureDetector; private int swipedPos = -1; private float swipeThreshold = 0.5f; private Map<Integer, List<UnderlayButton>> buttonsBuffer; private Queue<Integer> recoverQueue; ..

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 this one. My adapter: public class DateTimeAdapter extends RecyclerView.Adapter<MainHolder> implements ..
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 not removed, only "go out" from whole RecyclerView list. -When "cancel" button is ..
1.itemTouchHelper works well at first. Kotlin code as followed val itemTouchHelper = ItemTouchHelper(object: ItemTouchHelper.Callback(){ override fun getMovementFlags(recyclerView: RecyclerView, viewHolder:RecyclerView.ViewHolder): Int{ val dragFlag = ItemTouchHelper.UP | ItemTouchHelper.Down val swipeFlags = 0 return makeMovementFlags(dragFlags, swipeFlags) } override fun onMove(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder){ val fromPosition = viewHolder.adapterPosition val toPosition = target.adapterPosition Collections.swap(mList, fromPosition, toPosition) mAdapter.notifyItemMoved(fromPosition, toPosition) ..
Following this question RecyclerView ItemTouchHelper Buttons on Swipe (NOT THE SAME). I would like to add buttons on each side. The official answer from that link is for ONE side only. What I have tried: public abstract class SwipeHelper extends ItemTouchHelper.SimpleCallback { public static final int BUTTON_WIDTH = 125; private RecyclerView recyclerView; private List<UnderlayButton> buttons; ..
So I am trying to make a swipeable list in my recyclerview where if I swipe right an Undo button shows on the left side and if I swipe left then a delete button shows to the right. I am able to get one button show up for both left and right swipe. If I ..
I have two RecyclerViews, placed one above the other like so: How can I drag options to the top RecyclerView with ItemTouchHelper animations like this but between the two RecyclerViews? Source: Android..
Recent Comments