🔥 Yet another Tinder like swipeable cards, built for Jetpack Compose

Overview

twyper

buildStatus latestVersion Twitter: theapache64

Yet another Tinder like swipeable card library, built for Jetpack Compose

Demo

Screen.Recording.2022-02-20.at.10.46.59.PM.mov

⌨️ Usage

latestVersion

1. Add dependency

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

dependencies {
  implementation 'com.github.theapache64:twyper:<latest.version>'
}

2. Use Twyper composable

val items = remember { mutableStateListOf(*('A'..'Z').toList().toTypedArray()) }

//  twyperController to swipe cards programmatically
val twyperController = rememberTwyperController() 
Twyper(
    items = items,
    twyperController = twyperController, // optional
    onItemRemoved = { item, direction ->
        println("Item removed: $item -> $direction")
        items.remove(item)
    },
    onEmpty = { // invoked when the stack is empty
        println("End reached")
    }
) { item ->
    // card content goes here
}
  • See full source code here

🧪 More Samples

Screen.Recording.2022-02-20.at.9.36.10.PM.mov

✍️ Author

👤 theapache64

Feel free to ping me 😉

🤝 Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Open an issue first to discuss what you would like to change.
  2. Fork the Project
  3. Create your feature branch (git checkout -b feature/amazing-feature)
  4. Commit your changes (git commit -m 'Add some amazing feature')
  5. Push to the branch (git push origin feature/amazing-feature)
  6. Open a pull request

Please make sure to update tests as appropriate.

Show your support

Give a ⭐️ if this project helped you!

Patron Link Buy Me A Coffee

☑️ TODO

  • Add UI tests and unit tests

📝 License

Copyright © 2022 - theapache64

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.

This README was generated by readgen

You might also like...
a set of Settings like composable items to help android Jetpack Compose developers build complex settings screens
a set of Settings like composable items to help android Jetpack Compose developers build complex settings screens

This library provides a set of Settings like composable items to help android Jetpack Compose developers build complex settings screens without all the boilerplate

Example Jetpack Compose Android App, that uses the newest mechanisms, like StateFlow, SharedFlow, etc. to manage states and handle events. ViewModel, UI and Screenshot tests included :)
Example Jetpack Compose Android App, that uses the newest mechanisms, like StateFlow, SharedFlow, etc. to manage states and handle events. ViewModel, UI and Screenshot tests included :)

AndroidMVIExample Example Jetpack Compose Android App, that uses the newest mechanisms, like StateFlow, SharedFlow, etc. to manage states and handle e

A Coordinator Layout-like component in Jetpack Compose.
A Coordinator Layout-like component in Jetpack Compose.

CollapsingToolbarInCompose Branches master: Initial code. column_version: Resulting code using a Column. 🚧 lazycolumn_version: Resulting code using a

Jetpack Compose is like Android XML

Jetpack Compose is like Android XML

🔖 A Quotes Application built to Demonstrate the Jetpack Compose UI
🔖 A Quotes Application built to Demonstrate the Jetpack Compose UI

🔖 A Quotes Application built to Demonstrate the Jetpack Compose UI

JetFlix - A clone of Android NetFlix app in Android built using Jetpack compose.
JetFlix - A clone of Android NetFlix app in Android built using Jetpack compose.

JetFlix A clone of Android NetFlix app in Android built using Jetpack compose. This sample app showcases the following: MVVM Architecture (ViewModel +

A Rick and Morty app built with Jetpack Compose.
A Rick and Morty app built with Jetpack Compose.

RickAndMortyCompose A Rick and Morty app built with Jetpack Compose. 📱 Demo ✨ Features Compose UI Kotlin Coroutines Compose Navigation MVVM Architect

Experimental Graphviz code generation POC built with Jetpack Compose compiler/runtime.
Experimental Graphviz code generation POC built with Jetpack Compose compiler/runtime.

Compose Dot Experimental proof of concept to generate GraphViz dot code via Jetpack Compose's tree management. Valid dot file content can be generated

A beautiful Undo Redo animation built with Jetpack Compose
A beautiful Undo Redo animation built with Jetpack Compose

A beautiful Undo Redo animation built with Jetpack Compose

Comments
  • Update release to include latest features

    Update release to include latest features

    Problem: Missing features

    I'm trying to use the stack count and paddingBetweenCards as parameter, but this PR is not included in the built version #1

    It's also is not included in the available release on Github and jitpack.io

    opened by Sal7one 3
  • 🔀 add TwyperFlip

    🔀 add TwyperFlip

    Twyper Flip takes in three extra parameters, two composables, one for front and back and modifier for the box. Animations are added in the existing CardController.

    inline fun <reified T> TwyperFlip(
        items: List<T>,
        onItemRemoved: (T, SwipedOutDirection) -> Unit,
        onEmpty: () -> Unit = {},
        twyperController: TwyperController = rememberTwyperController(),
        stackCount: Int = 2,
        paddingBetweenCards: Float = 40f,
        modifier: Modifier = Modifier,
        cardModifier: () -> Modifier,
        crossinline front: @Composable (T) -> Unit,
        crossinline back: @Composable (T) -> Unit
    ) 
    

    https://user-images.githubusercontent.com/59912430/155768674-90167ea2-bd04-456f-a5b1-295cf814d920.mp4

    opened by yash-k9 0
  • Adding Alpha as you swipe

    Adding Alpha as you swipe

    Is it good to have alpha as well when we drag the card?

    Something like

       override val alphaValue: Float
        get() =   1 - (abs(swipeX.value)/ (screenWidth/2))
    

    and

    .graphicsLayer(alpha = cardController.alphaValue,
    
    opened by raghunandankavi2010 0
Releases(0.0.4)
Yet another ToDo app, but the UI completely written in Jetpack Compose!

Yet another ToDo app, but the UI completely written in Jetpack Compose!

Wisnu Kurniawan 134 Dec 31, 2022
Yet another awesome Intro screen library 🔥

Compose-Intro ✅ Yes, I'm too bad in naming my libraries : ) Yet another Intro Screen library made with the love of Kotlin and Jetpack compose : ) ❤️ ✨

Kapil Yadav 13 Aug 14, 2022
SSJetpackComposeSwipeableView is a small library which provides support for the swipeable views

SSJetpackComposeSwipeableView is a small library which provides support for the swipeable views. You can use this in your lazyColumns or can add a simple view which contains swipe to edit/delete functionality.

Simform Solutions 60 Nov 18, 2022
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

Clément Beffa 548 Jan 7, 2023
Glance Experimental Tools aims to supplement Jetpack Glance with features that are commonly required by developers but not yet available.

Glance Experimental Tools ?? Work in-progress: artifacts not available yet This project aims to supplement Jetpack Glance with features that are commo

Google 96 Dec 25, 2022
FullMangement - an application that helps you manage your tasks effectively. built with the latest tachs like Compose UI, Jetpack libraries, and MVVM design pattern.

Full Management is an application that helps you manage your tasks effectively. built with the latest tachs like Compose UI, Jetpack libraries and MVVM design pattern.

Amr algnyat 4 Nov 1, 2022
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

BHAVNA THACKER 3 Dec 31, 2022
Jetpack-compose-uis - A collection of some UIs using Jetpack Compose. built using Katalog

Jetpack Compose UIs This is a collection of some UIs using Jetpack Compose. It i

Mori Atsushi 3 Dec 15, 2022
📱 WhatsApp clone project demonstrates modern Android development built with Jetpack Compose and Stream Chat SDK for Compose.

This is a WhatsApp clone app built with Jetpack Compose and Stream Chat SDK for Compose. The purpose of this repository is to demonstrate below: Imple

Stream 689 Dec 25, 2022
(another?) UNOFFICIAL Steam mobile client project

Jetisteam an unofficial Steam client for Android While being based on the protobuf-based WebUI-oriented RPC/API, this app will miss a lot of features

iTaysonLab 46 Jan 4, 2023