Compose RevealSwipe

Overview

RevealSwipe

Current Compose Version: 1.0.0-beta09

Compose RevealSwipe

Swipable in both directions

Lint Ktlint

CodeFactor Maven Central

Add to your project

Add actual RevealSwipe library:

dependencies {
    implementation 'de.charlex.compose:revealswipe:1.0.0-beta05'
}

How does it work?

Surround your content with the RevealSwipe

RevealSwipe(
    modifier = Modifier.padding(vertical = 5.dp),
    directions = setOf(
//        RevealDirection.StartToEnd,
        RevealDirection.EndToStart
    ),
    hiddenContentStart = {
        Icon(
            modifier = Modifier.padding(horizontal = 25.dp),
            imageVector = Icons.Outlined.Star,
            contentDescription = null,
            tint = Color.White
        )
    },
    hiddenContentEnd = {
        Icon(
            modifier = Modifier.padding(horizontal = 25.dp),
            imageVector = Icons.Outlined.Delete,
            contentDescription = null
        )
    }
) {
    Card(
        modifier = Modifier.fillMaxSize().requiredHeight(80.dp),
        backgroundColor = Color(item.second),
        shape = it,
    ){
        Text(
            modifier = Modifier.padding(start = 20.dp, top = 20.dp),
            text = item.first
        )
    }
}

Preview

RevealSwipe

That's it!

License

Copyright 2021 Alexander Karkossa

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
A Jetpack Compose library with blur, pixelate, and other effects to keep your designer happy. Inspired by iOS UIVisualEffectView.
A Jetpack Compose library with blur, pixelate, and other effects to keep your designer happy. Inspired by iOS UIVisualEffectView.

A Jetpack Compose library with blur, pixelate, and other effects to keep your designer happy. Inspired by iOS UIVisualEffectView.

A color picker for Jetpack compose 🎨
A color picker for Jetpack compose 🎨

Compose Color Picker 🎨 Color Picker for Jetpack compose A color picker for Jetpack compose 🎨 Download 🚧 Working on it 🚧 Usage ColorPicker { co

MVVM + Kotlin + Jetpack Compose +Navigation Compose + Hilt + Retrofit + Unit Testing + Compose Testing + Coroutines + Kotlin Flow + Io mockK
MVVM + Kotlin + Jetpack Compose +Navigation Compose + Hilt + Retrofit + Unit Testing + Compose Testing + Coroutines + Kotlin Flow + Io mockK

MvvmKotlinJetpackCompose Why do we need an architecture even when you can make an app without it? let's say you created a project without any architec

Funstuff - Minimal Kotlin Multiplatform project with SwiftUI, Jetpack Compose, Compose for Wear OS, Compose for Desktop
Funstuff - Minimal Kotlin Multiplatform project with SwiftUI, Jetpack Compose, Compose for Wear OS, Compose for Desktop

PeopleInSpace Minimal Kotlin Multiplatform project with SwiftUI, Jetpack Compose

Jetpack Compose Boids | Flocking Insect 🐜. bird or Fish simulation using Jetpack Compose Desktop 🚀, using Canvas API 🎨
Jetpack Compose Boids | Flocking Insect 🐜. bird or Fish simulation using Jetpack Compose Desktop 🚀, using Canvas API 🎨

🐜 🐜 🐜 Compose flocking Ants(boids) 🐜 🐜 🐜 Jetpack compose Boids | Flocking Insect. bird or Fish simulation using Jetpack Compose Desktop 🚀 , usi

🔥🔥🔥Android Compose Banner!!! 安卓 Compose 版本的 Banner
🔥🔥🔥Android Compose Banner!!! 安卓 Compose 版本的 Banner

Banner 打造 Compose 版本的 Banner 没有 ViewPager ? 之前写安卓的时候这都不是事,不管是自己使用 ViewPager 实现又或者是直接使用三方库,都不是什么难事;特别是使用三方库,添加一行依赖基本就没啥事了,但。。。现在使用 Compose 该怎么搞? 本来想着 C

Compose icons is a pack of libraries that provide well known Icon Packs to use in Jetpack Compose Multiplatform.
Compose icons is a pack of libraries that provide well known Icon Packs to use in Jetpack Compose Multiplatform.

Compose icons is a pack of libraries that provide well known Icon Packs to use in Jetpack Compose Multiplatform. The library usage is inspired by Compose Material Icons.

A collection of animations, compositions, UIs using Jetpack Compose. You can say Jetpack Compose cookbook or play-ground if you want!
A collection of animations, compositions, UIs using Jetpack Compose. You can say Jetpack Compose cookbook or play-ground if you want!

Why Not Compose! A collection of animations, compositions, UIs using Jetpack Compose. You can say Jetpack Compose cookbook or play-ground if you want!

Android interval timer app using compose + compose navigation, dagger hilt,  room, kotlin coroutines + flow and mvvm design pattern.
Android interval timer app using compose + compose navigation, dagger hilt, room, kotlin coroutines + flow and mvvm design pattern.

What's InTime? ⏳ InTime is an interval timer application using android jetpack components and a long running service. The purpose of this project is t

Learn Jetpack Compose for Android by Examples. Learn how to use Jetpack Compose for Android App Development. Android’s modern toolkit for building native UI.
Learn Jetpack Compose for Android by Examples. Learn how to use Jetpack Compose for Android App Development. Android’s modern toolkit for building native UI.

Learn Jetpack Compose for Android by Examples. Learn how to use Jetpack Compose for Android App Development. Android’s modern toolkit for building native UI.

A Kotlin library to use Jetpack Compose in Android and iOS. Allow to write UI for both in Kotin. Still experimental as many compose features are not yet available.
A Kotlin library to use Jetpack Compose in Android and iOS. Allow to write UI for both in Kotin. Still experimental as many compose features are not yet available.

Multiplatform Compose A Kotlin library to use Jetpack Compose in Android and iOS. Allow to write UI for both in Kotin. Still experimental as many comp

K5-compose is a sketchy port of p5.js for Jetpack Compose
K5-compose is a sketchy port of p5.js for Jetpack Compose

k5-compose k5-compose is a sketchy port of P5.js for Jetpack Compose Desktop. This library provides you a playground to play with your sketches so you

Jetpack Compose based project, used to stress-testing compose features / integrations and explore non-trivial functionality

Project containing Jetpack Compose samples For pagination & network images it uses CATAAS. Known issues Navigation-Compose Issue with fast tapping on

Pokedex Compose is an independent re-write of a demo application by the name of Pokedex, but written in jetpack compose.
Pokedex Compose is an independent re-write of a demo application by the name of Pokedex, but written in jetpack compose.

Pokedex Compose Pokedex Compose is an independent re-write of a similar project by the name of Pokedex. I am recreating the UI but I am doing it using

A minimal notes application in Jetpack Compose with MVVM architecture. Built with components like DataStore, Coroutines, ViewModel, LiveData, Room, Navigation-Compose, Coil, koin etc.
A minimal notes application in Jetpack Compose with MVVM architecture. Built with components like DataStore, Coroutines, ViewModel, LiveData, Room, Navigation-Compose, Coil, koin etc.

Paper - A Minimal Notes App A minimal notes application in Jetpack Compose with MVVM architecture. Built with components like DataStore, Coroutines, V

Country-code-picker-compose - An android library Jetpack Compose which provides an easy way to search and select country or country phone code Compose-actors - Android app built with jetpack compose follows new revamped guide to app architecture
Compose-actors - Android app built with jetpack compose follows new revamped guide to app architecture

Compose Actors 💃 Inspired from JetCaster JetNews JetSnack More compose content

This is a sample app(For beginners - App #2) built using Jetpack Compose. It demonstrates the concept of State Hoisting in Jetpack Compose.
This is a sample app(For beginners - App #2) built using Jetpack Compose. It demonstrates the concept of State Hoisting in Jetpack Compose.

JetBMICalculator This is a sample app(For beginners - App #2) built using Jetpack Compose. It demonstrates the concept of State Hoisting in Jetpack Co

Jetpack-Compose-Demo - Instagram Profile UI using Jetpack Compose
Jetpack-Compose-Demo - Instagram Profile UI using Jetpack Compose

Jetpack-Compose-Demo Instagram Profile UI using Jetpack Compose

Comments
  • How to revert the state of the previous item when swiping a new item?

    How to revert the state of the previous item when swiping a new item?

    Hi, thank you for your library, it's perfect but could you give me the solution to revert the state of the previous item?

    Ex: The List has 4 items: A, B, C, D. 1/ Swipe item A EndToStart. 2/ Swipe item B & revert the state of item A. 3/ Swipe item C & revert the state of item B.

    Thanks.

    enhancement help wanted 
    opened by TamND87 1
  • Reveal size

    Reveal size

    Hello, congratulations for the excellent work. Would it be possible to make sure that the uncovered area after the swipe is automatically calculated dinamically based on the revealed part size, both left and right? Currently i use "maxRevealDp = x.dp" but a fixed size doesn't fit all situations. Thank you.

    opened by nicola73 2
Releases(1.1.0)
Owner
Alexander Karkossa
Alexander Karkossa
PCard Add payment card screen made using JetPack Compose

PCard Add payment card screen made using JetPack Compose Find this repository useful? ❤️ Support it by joining stargazers for this repository. ⭐ And f

Mohamed Elbehiry 61 Dec 16, 2022
Collection of Compose UI Templates

Compose UI Templates This repository contains set of Android compose ui templats which helps you to learn compose in Android. ?? Requirements To try o

Hiten chawda 29 Jan 1, 2023
Sample app to try compose and showcase principles from Composing (UI) beyond the UI

Composing clocks sample app This is a sample app to show how to build an app that follows the practices described in the series of articles Compose (U

Jordi Saumell 84 Dec 15, 2022
Compose app with dummy data which serves as a playground to try out new things in the Android world.

Music Event Manager Compose app with dummy data which serves as a playground to try out new things in the Android world. Description The app primarily

Igor Tepavac 4 Apr 4, 2022
A customizable debug screen to view and edit flags that can be used for development in Jetpack Compose applications

Tweaks A customizable debug screen to view and edit flags that can be used for development in Jetpack Compose applications To include the library add

Guillermo Merino Jiménez 4 Jan 14, 2022
Scrollbar Indicator usign compose

Carousel Carousel is a scroll indicator for ScrollableState composes. Carousel can be vertial or horizontal indicator based on the size provided using

null 58 Oct 19, 2022
A crypto currency wallet UI/UX template created using Android's jetpack compose.

CryptoWalletTemplate A crypto currency wallet UI/UX template created using Android's jetpack compose. High definition demo on youtube Youtube video de

prosper ekwerike 5 Feb 6, 2022
Sliders for compose with custom styles

Custom compose sliders This package allows you to build highly customizable sliders and tracks for compose for android Add to your project Add it in y

Vladislav Krot 52 Dec 15, 2022
Card with swipe options in Jetpack Compose

SwipeableActionCard Card with swipe options in Jetpack Compose Tutorial: Click Here Import SwipeableActionCard library Add this in project level build

Harsh Mahajan 1 Nov 23, 2021
Android jetpack compose swipe library

Swiper for Android Jetpack Compose Android Jetpack Compose swipe library. Downlo

null 32 Dec 10, 2022