explaingit

daimajia/androidswipelayout

12,370JavaAudience · developerComplexity · 2/5Setup · easy

TLDR

An Android library that adds swipe-to-reveal hidden buttons or content to any part of your screen, works in lists, grids, and any other layout type, not just standard list views.

Mindmap

mindmap
  root((AndroidSwipeLayout))
    What it does
      Swipe to reveal
      Hidden actions
      Any layout type
    Supported layouts
      ListView
      GridView
      Nested containers
    Integration
      Gradle
      Maven
      XML layout wrap
    Events
      Open callback
      Close callback
      Update callback
    Audience
      Android developers
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 or swipe-to-archive buttons to a list of messages or items in an Android app.

USE CASE 2

Reveal hidden action buttons on a card or grid item when a user swipes it, in any layout container.

USE CASE 3

Listen to swipe open and close events to trigger app logic like marking an item as read when it is swiped.

USE CASE 4

Replace an existing swipe solution that only worked in ListView with one that works across GridView and nested containers.

Tech stack

JavaAndroidGradleMaven

Getting it running

Difficulty · easy Time to first run · 30min
License not specified in the explanation, check the repository directly before using in a project.

In plain English

AndroidSwipeLayout is a Java library for Android app developers that adds swipe-to-reveal behavior to any part of a screen. When a user swipes a row or card, hidden buttons or content slide into view, similar to how messaging apps show Delete or Archive options when you swipe a conversation. The library was built because the author needed this effect for a personal app and found that existing solutions only worked in one specific type of list view (ListView) and had reliability issues. This library is designed to work in any layout type, including grid views and nested containers, making it more flexible for different screen designs. As an Android developer, you add it to your project via Gradle or Maven, wrap the parts of your layout you want to be swipeable in the provided component, and define what hidden content should appear when swiped. The library sends callbacks when content opens, closes, or updates, so you can react to those events in your app code. The project links to a separate wiki for detailed usage instructions beyond what the README covers. It was created as an open contribution to Android development and is available to include in your own apps.

Copy-paste prompts

Prompt 1
I'm building an Android app with a RecyclerView of messages. Using AndroidSwipeLayout, show me how to add a 'Delete' button that appears when the user swipes a row.
Prompt 2
How do I wrap a card in a GridView with AndroidSwipeLayout so that swiping reveals two buttons side by side?
Prompt 3
Show me how to listen to the SwipeLayout open and close callbacks in AndroidSwipeLayout so I can mark an item as read when the user swipes it open.
Prompt 4
Walk me through adding AndroidSwipeLayout to an Android project using Gradle, and show me the minimum XML and Java needed to make one swipeable item work.
Open on GitHub → Explain another repo

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

Verify against the repo before relying on details.