Part Two: Handles, Grids, and Custom Animations

July 22, 2015

In Part One, we looked at ItemTouchHelper, and an implementation of ItemTouchHelper.Callback that adds basic drag & drop and swipe-to-dismiss to linear RecyclerView lists. This article will expand on that example, adding support for grid layouts, “handle” initiated drags, indicating the selected view, and custom swipe animations.

Drag Handles

When designing a list that supports drag & drop, it’s common to include an affordance that initiates the drag on touch. This helps with discoverability and usability, and it’s recommended by the Material Guidelines when the list is in “edit mode”. …

Part One: Basic ItemTouchHelper Example

June 23, 2015

There are many tutorials, libraries, and examples for implementing “drag & drop” and “swipe-to-dismiss” in Android, using RecyclerView. Most are still using the old View.OnDragListener, and Roman Nurik’s SwipeToDismiss approach, even though there are newer, and better, methods available. A few use the newer APIs, but often rely on GestureDetectors and onInterceptTouchEvent, or the implementation is complex. There’s actually a really simple way to add these features to RecyclerView. It only requires one class, and it’s already part of the Android Support Library:


ItemTouchHelper is a powerful utility that takes care of everything you need to add…

Paul Burke

Android App Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store