ComposeSwipeToReveal - A compose solution for adding swipe to reveal to a list

Overview

ComposeSwipeToReveal

A compose solution for adding swipe to reveal to a list.

A full sample is included in the :app module.

Usage

private const val ACTION_ROW_WIDTH = 500
private const val SWIPE_ANIMATION_DURATION_MS = 500

val state = viewModel.state.collectAsState()

LazyColumn {
    itemsIndexed(
        state.value.data,
        key = { _, item -> item.id }
    ) { _, item ->
        SwipeToRevealContainer(
            swipeToRevealParameters = SwipeToRevealParameters(
                swipeToRevealAnimationDurationMs = SWIPE_ANIMATION_DURATION_MS,
                cardOffset = ACTION_ROW_WIDTH.dp,
            ),
            isRevealed = viewModel.isItemRevealed(item),
            onExpand = {
                viewModel.itemExpanded(item)
            },
            onCollapse = {
                viewModel.itemCollapsed(item)
            },
            rowContent = {
                RowContent(
                    item = item,
                )
            },
            actionContent = {
                ActionRow(
                    item = item,
                    rowScope = this,
                )
            }
        )
    }
}
swipe.mov

Add it to your project

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Step 2. Add the dependency

dependencies {
        implementation 'com.github.j-roskopf:ComposeSwipeToReveal:<latest_version>'
}
You might also like...
Kotlin app that shows a list of characters using the api SWAPI
Kotlin app that shows a list of characters using the api SWAPI

StarWarsCharacters Kotlin app that shows a list of characters using the api SWAPI (https://swapi.dev) This is a clean architecture app example built w

This assignment gives you basically a post list and its detail with comments.🚀
This assignment gives you basically a post list and its detail with comments.🚀

Android Assignment 📜 Description This assignment gives you basically a post list and its detail with comments. 📱 Features Users can see random post

myMaps displays a list of maps, each of which show user-defined markers with a title, description, and location.

My Maps Trevor Carrell myMaps displays a list of maps, each of which show user-defined markers with a title, description, and location. The user can a

This prototype app provides a list of events to be held under an organization (school, college, club, etc.) and the users can manually set event reminders at their scheduled time so that they do not miss an event.

E-CELL NITS Sample App This prototype app provides a list of events to be held under E-Cell NIT Silchar (for example, Srijan 2.0) and the users can ma

An application to follow popular movies and tv series and create watch list

MoviesAndTV MoviesAndTV is an application to follow popular movies and tv series and create watch list from your favorite tv series and movies. Also y

Display scrollable list of repositories of square organization in GitHub
Display scrollable list of repositories of square organization in GitHub

Display scrollable list of repositories of “square” organization in GitHub. The app should consist of only one screen (Repositories Screen). Each list

A TODO list app with location reminders that remind the user to do something when the user is at a specific location

Project Title Location Reminder Getting Started A TODO list app with location reminders that remind the user to do something when the user is at a spe

An Android app consuming Pixabay API to search and display list of images, built with MVVM pattern
An Android app consuming Pixabay API to search and display list of images, built with MVVM pattern

Images An Android app consuming Pixabay API to search and display list of images, built with MVVM pattern as well as Architecture Components. Min Api

(National Service Scheme) displays a list of activities organised by a committee
(National Service Scheme) displays a list of activities organised by a committee

NSS NSS (National Service Scheme) displays a list of activities organised by a c

Releases(1.1)
Owner
Staff Android Engineer @ Honor
null
Map-vs-list-comparator - The project compares the time needed to find a given element in a map vs the time needed to find a given element in a list.

Map vs List Comparator The project compares the time needed to find a given element in a map vs the time needed to find a given element in a list. To

null 0 Jan 4, 2022
To-Do-List - Create a To Do List-style App from scratch and drive the entire development process using Kotlin

To-Do-List! Crie um App no estilo "To Do List" do zero e conduza todo o processo

River Diniz 0 Feb 14, 2022
Add Ios Swipe Search TextField Component in Android Jetpack Compose.

IosSwipeSearchCompose Add Ios Swipe Search TextField Component in Android Jetpack Compose. How it looks Usage val text = remember { mutableStateOf("")

Emir Demirli 11 Jan 9, 2023
Boru is a pipeline solution

boru boru is a pipeline implementation in kotlin with native coroutine support and custom dsl. Supports chaining pipeline steps with conditions and br

Trendyol Open Source 33 Nov 11, 2022
From 8-10 October 2021 there was VTB MORE tech 3.0, where the DUCK team presented their solution.

InvestmentGuideVTB Ссылка на репозиторий с бэкендом приложения: https://github.com/disarrik/vtbBackend Процесс сегментация происходит в отдельном окне

Denis 1 Nov 8, 2021
Solution for task 5 on Spring Boot https://t.me/try2py/197

IouRestService (Spring Boot Application) Решение задачи 5 https://t.me/try2py/197 Условие задачи: Четверо соседей по комнате имеют привычку занимать д

Fomin Sergei 1 Nov 22, 2021
BOJ PS - Solution of BOJ Problem

BOJ_1009 분산처리 https://www.acmicpc.net/problem/1009 10개의 컴퓨터 그리고 N개의 데이터가 있을 경우 1

hyungmin 0 Jan 5, 2022
Solution code for Android Kotlin Fundamentals Codelab 8.1 Getting data from the internet

MarsRealEstateNetwork - Solution Code Solution code for Android Kotlin Fundamentals Codelab 8.1 Getting data from the internet Introduction MarsRealEs

DavidHieselmayr 1 Apr 7, 2022
This project aims to provide a solution for finding the right product for a given EAN (European Article Number)

This project aims to provide a solution for finding the right product for a given EAN (European Article Number)

MJ 1 Apr 18, 2022
A simple store project that includes a list of products, search on products, details of the product, and review submission.

AdidasTest A simple store project that includes a list of products, search on products, details of the product, and review submission. Summary Technol

Mohammad 5 May 8, 2021