explaingit

mcxtzhang/swipedelmenulayout

3,793JavaAudience · developerComplexity · 2/5Setup · easy

TLDR

An Android library that adds swipe-to-reveal action buttons to list items, like the delete or archive menus in WeChat. Works with any Android layout container, not just RecyclerView.

Mindmap

mindmap
  root((SwipeDelMenuLayout))
    What it does
      Swipe to reveal menu
      Left or right swipe
      Any layout container
    Interaction modes
      iOS blocking style
      Android permissive style
      Per-item disable
    Setup
      Two Gradle lines
      Wrap XML layout
      JitPack dependency
    Use cases
      Delete buttons
      Archive actions
      Chat list menus
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add swipe-to-delete and swipe-to-archive buttons to a chat message list in an Android app, matching the WeChat interaction style.

USE CASE 2

Use the iOS-style blocking mode so opening a swipe menu on one list item prevents interaction with everything else until it is closed.

USE CASE 3

Disable swipe actions on specific list items while keeping them enabled on others, useful when some rows should not have swipe menus.

USE CASE 4

Wrap any custom Android list item layout in the swipe container without changing your existing RecyclerView or ListView setup.

Tech stack

JavaAndroidJitPack

Getting it running

Difficulty · easy Time to first run · 30min

Requires adding the JitPack repository to your Android project's build config before the dependency resolves.

License terms not mentioned in the explanation.

In plain English

SwipeDelMenuLayout is an Android library that adds swipe-to-reveal menus to list items. When a user swipes left or right on an item in a list, a set of buttons appears on the side, commonly used for actions like delete, mark as unread, or pin to top. This pattern is familiar from apps like WeChat and is also similar to how iOS list menus behave. The key design point of this library is that it works with any Android layout container, not just specific list types. Most similar libraries only support RecyclerView or ListView, but this one wraps around whatever you put inside it. You define the main content of your list item and the menu buttons in the same XML layout file, and the library handles the swipe gesture and animation. The library supports two interaction modes. One mimics the iOS blocking style, where opening a swipe menu on one item blocks interaction with everything else until that menu is closed. The other is a more permissive Android style where menus on different items can be opened without blocking each other. You can also configure which direction the swipe goes, left or right, and whether swiping is enabled at all for a given item, which is useful when some items in a list should not have swipe actions. Adding it to an Android project involves two lines in the build configuration file and then wrapping your list item layout in the library's custom view. The README includes XML and Java code examples showing how to set it up. The library is available through JitPack, which is a service that lets you add GitHub projects as Android dependencies directly. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Show me how to add SwipeDelMenuLayout to my Android project via JitPack and wrap a RecyclerView item layout so it shows a Delete button on swipe.
Prompt 2
How do I configure SwipeDelMenuLayout to use iOS-style blocking mode where swiping one item closes all other open menus automatically?
Prompt 3
I want to disable swipe actions on certain items in my list, show me how to programmatically enable or disable SwipeDelMenuLayout on a per-item basis.
Prompt 4
Walk me through setting up left-swipe and right-swipe menus with different buttons on the same list item using SwipeDelMenuLayout.
Open on GitHub → Explain another repo

← mcxtzhang on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.