A simple utility Compose to add customizable buttons when swiping the card in an easy way.

Overview

Swipeable-Card

A simple utility Compose to add customizable buttons when swiping the card in an easy way.

Import:

This library is available as a gradle dependency via JitPack.io. Just add the following code:

  1. Add Jitpack.io to your root build.gradle:
allprojects {
     repositories {
     	...
     	maven { url "https://jitpack.io" }
     }
}

Note: if you faced an issue with the first step check this out

  1. Add dependency: implementation 'com.github.Amrjyniat:Swipeable-Card:1.0.0'

Features

  • Customize the background, text color and icon of the button.
  • Add unlimited buttons to the card by passing a list of SwipeableAction.
  • Work with both LTR and RTL layout directions.
  • You don't need to edit your card to make it swipeable, just add your card compose to the SwipeableCard.

Alt Text

How to use:

SwipeableCard(
	actions = listOf(
	  Action(R.drawable.ic_share, Orange, "Share", Color.White, 85.dp){},
	),
	isRevealed = revealIds.contains(task.taskId),
	paddingValues = PaddingValues(16.dp),
	animationDuration = 500,
	onExpand = {},
	onCollapse = {}
) { 
	Card() 
}

You have three customizable areas in SwipeableCard composable fun:

  1. Your original card.

  2. The buttons that will show when swiping the card, pass a list of Action which has multiple attributes:

    • iconRes: Drawable resource icon.
    • color: Background of the button.
    • text: Text of the button.
    • textColor: Text color of the button.
    • withInDp: Specify button width in DB, otherwise will wrap the content.
    • onAction: Lambda triggered when button clicked.
  3. Attributes:

    • isRevealed: Boolean value that Reveals the card to show the buttons when being true.
    • paddingValues: Set card padding.
    • animationDuration: Specify the Reveal speed by passing duration in milliseconds.
    • onExpand: Lambda triggered when revealing the card.
    • onCollpase: Lambda triggered when collapsing the card.

Sample:

You can check out the sample app in the project to take a closer look of how to use it in real work.

References:

This library inspired from here, Thanks Skyyo!

You might also like...
A nicer-looking, more intuitive and highly customizable alternative for radio buttons and dropdowns for Android.
A nicer-looking, more intuitive and highly customizable alternative for radio buttons and dropdowns for Android.

SwipeSelector Undergoing for some API changes for a 2.0 major version, see example usage in the sample module! What and why? Bored of dull looking rad

A nicer-looking, more intuitive and highly customizable alternative for radio buttons and dropdowns for Android.
A nicer-looking, more intuitive and highly customizable alternative for radio buttons and dropdowns for Android.

SwipeSelector Undergoing for some API changes for a 2.0 major version, see example usage in the sample module! What and why? Bored of dull looking rad

Custom font library for android | Library to change/add font of Entire Android Application at once without wasting your time - TextViews, EditText, Buttons, Views etc.,

AppFontChanger In a Single shot change font of Entire Android Application - TextViews, EditText, Buttons, Views etc., Kindly use the following links t

Rn-scratch-card - React Native Scratch Card which temporarily hides content from user
Rn-scratch-card - React Native Scratch Card which temporarily hides content from user

rn-scratch-card React Native Scratch Card which temporarily hides content from a

RecyclerView extension library which provides advanced features. (ex. Google's Inbox app like swiping, Play Music app like drag and drop sorting)
RecyclerView extension library which provides advanced features. (ex. Google's Inbox app like swiping, Play Music app like drag and drop sorting)

Advanced RecyclerView This RecyclerView extension library provides Google's Inbox app like swiping, Play Music app like drag-and-drop sorting and expa

Drag and drop to reorder items in a list, grid or board for Android. Based on RecyclerView. Also supports swiping items in a list.
Drag and drop to reorder items in a list, grid or board for Android. Based on RecyclerView. Also supports swiping items in a list.

DragListView DragListView can be used when you want to be able to re-order items in a list, grid or a board. It also supports horizontal swiping of it

RecyclerView extension library which provides advanced features. (ex. Google's Inbox app like swiping, Play Music app like drag and drop sorting)
RecyclerView extension library which provides advanced features. (ex. Google's Inbox app like swiping, Play Music app like drag and drop sorting)

Advanced RecyclerView This RecyclerView extension library provides Google's Inbox app like swiping, Play Music app like drag-and-drop sorting and expa

PCard  Add payment card screen made using JetPack Compose
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

*** WARNING: This library is no longer maintained *** An easy way to add a simple 'swipe-and-do-something' behavior to your `RecyclerView` items. Just like in Gmail or Inbox apps.
*** WARNING: This library is no longer maintained *** An easy way to add a simple 'swipe-and-do-something' behavior to your `RecyclerView` items. Just like in Gmail or Inbox apps.

SwipeToAction An easy way to add a simple 'swipe-and-do-something' behavior to your RecyclerView items. Just like in Gmail or Inbox apps. Integration

Library provides an easy way to a add shimmer effect in Android Compose project.
Library provides an easy way to a add shimmer effect in Android Compose project.

Add a shimmer effect to the layout in Android Compose

Easy creation and management of toggle buttons on Android from the Material Design spec.
Easy creation and management of toggle buttons on Android from the Material Design spec.

ToggleButtonLayout Easy creation and management of toggle buttons from the Material Design spec. Read more about ToggleButtonLayout in our blog post.

An easy, flexible way to add a shimmering effect to any view in an Android app.
An easy, flexible way to add a shimmering effect to any view in an Android app.

Shimmer for Android Shimmer is an Android library that provides an easy way to add a shimmer effect to any view in your Android app. It is useful as a

An easy, flexible way to add a shimmering effect to any view in an Android app.
An easy, flexible way to add a shimmering effect to any view in an Android app.

Shimmer for Android Shimmer is an Android library that provides an easy way to add a shimmer effect to any view in your Android app. It is useful as a

TourGuide is an Android library that aims to provide an easy way to add pointers with animations over a desired Android View

TourGuide TourGuide is an Android library. It lets you add pointer, overlay and tooltip easily, guiding users on how to use your app. Refer to the exa

Small utility used to add Homewizard Energy Socket tiles to Android Quick Settings
Small utility used to add Homewizard Energy Socket tiles to Android Quick Settings

TileWizard [Alpha! Unstable!] Settings Result Functionality: Add up to 5 Wi-Fi Energy Sockets to Android Quick Settings. What do you need: Android dev

A Utility to Add all of your installed steam games to the Start Launcher for Windows
A Utility to Add all of your installed steam games to the Start Launcher for Windows

Steam Start Launcher The Steam Start launcher is a small tool that will scan your computer for isntalled steam games and create a shortcut for each ga

Veneer: reactive buttons for Jetpack Compose
Veneer: reactive buttons for Jetpack Compose

veneer reactive buttons for Jetpack Compose veneer is a library for reactive buttons. The buttons react depededing upon the roll, pitch and azimuth an

An easy way to customize your log in Android,including output to console, writing log to file in high performance way and so on

EasyLog An easy way to customize your log in Android,including output to console, writing log to file in high performance way and so on. 1. Initializa

Easy-Note - Easy Note Application will help user to add and update their important notes
Easy-Note - Easy Note Application will help user to add and update their important notes

Easy-Note 🗒️ Easy Note App helps you to create your notes. You can 📝 edit and

Releases(1.0.0)
Owner
Amr algnyat
I'm an Android Developer, I've started to learn Java programming language in 2017 and Android development in 2018. In June of 2020 I've published my first app (
Amr algnyat
CircularCardsStackView is an Android library for dealing with swipeable card views.

CircularCardsStackView Overview Features Android 11 support Easy setup Endless card stack Swipe horizontally with animation Fully customized Support t

MindInventory 30 Sep 9, 2022
Business card creation and sharing built using kotlin

Business Card Aplicativo desenvolvido no bootcamp Inter Android Developer em parceria com a DIO / Órbi Academy Techboost Sobre o projeto Projeto de cr

Waldir Cavalcanti 0 Oct 26, 2021
A hobby project of mine needed Jetpack Compose Cards stacked on top of another.

A hobby project of mine needed Jetpack Compose Cards stacked on top of another. As I finished up the code, I decided to polish and release it as a library so here it is.

null 8 Jul 5, 2022
Compose-buttons - A set of Loading animations used in Buttons to convey a "loading" state after the button is clicked.

Loading Buttons A set of Loading animations used in Buttons to convey a "loading" state after the button is clicked. A simple demo application that sh

Brad Ball 16 Jul 5, 2022
Kirill Rakhman 4 Sep 15, 2022
card.io provides fast, easy credit card scanning in mobile apps

card.io SDK for Android card.io provides fast, easy credit card scanning in mobile apps. Stay up to date Please be sure to keep your app up to date wi

card.io 2k Jan 1, 2023
💳 Bank Card View is a simple and elegant card view with Flip animation.

Visualização de cartão bancário ?? Bank Card View é uma visualização de cartão simples e elegante com animação Flip. Versões Selecione a língua : Engl

Geovani Amaral 10 Dec 12, 2022
💳 Bank Card View is a simple and elegant card view with Flip animation.

Visualização de cartão bancário ?? Bank Card View é uma visualização de cartão simples e elegante com animação Flip. Versões Selecione a língua : Engl

Geovani Amaral 9 Aug 26, 2022
CreditCardHelper 🖊️ A Jetpack-Compose library providing useful credit card utilities such as card type recognition and TextField ViewTransformations

CreditCardHelper ??️ A Jetpack-Compose library providing useful credit card utilities such as card type recognition and TextField ViewTransformations

Stelios Papamichail 18 Dec 19, 2022