Add a swipe-left delete button to each row in an Android list without building gesture handling from scratch.
Let users long-press and drag list items to a new position, updating the data model via a callback.
Add a sticky header and footer around a RecyclerView, such as a search bar at top and a load-more button at bottom.
Automatically fetch the next page of data when a user scrolls to the bottom, with a built-in loading indicator.
Grid layout drag-and-drop requires a different item-swapping algorithm than list layout, example code is included in the README.
SwipeRecyclerView is an Android library written in Java that extends the standard scrollable list component, called RecyclerView, with several interaction features that the built-in version does not include. The README is written in Chinese, so this explanation is based on what the code and documentation describe. The main additions are swipe menus on list items, drag-to-reorder, swipe-to-delete, and the ability to add fixed header and footer views above and below the list content. When a user swipes left or right on a row, a menu can appear on either side with buttons like delete, edit, or any custom action. The library supports both horizontal and vertical list layouts as well as grid layouts for this feature. Drag-to-reorder lets a user long-press a row and move it to a different position in the list. Swipe-to-delete lets a user flick a row off the screen to remove it. Both behaviors are disabled by default and must be turned on explicitly. The library provides callbacks so the app can update its data when items are moved or deleted. Header and footer views are plain Android views that sit outside the normal list items, at the top and bottom. They can be added or removed at any time without needing to rebuild the list adapter. A load-more feature is also included. As a user scrolls to the bottom, the library can automatically trigger a callback to fetch additional data and display a loading indicator. A default indicator view is provided, or a custom one can be substituted. The library is available through Gradle and supports both the older Android support library and AndroidX. Grid layout drag-and-drop requires a slightly different data-swapping algorithm than list layout, which the README documents with example code.
← yanzhenjie on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.