Git Product home page Git Product logo

revealswipe's Introduction

RevealSwipe

Current Compose Version: 2023.04.00

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'
}

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.

revealswipe's People

Contributors

ch4rl3x avatar dolzerpa avatar kalinjul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

revealswipe's Issues

Update to Material3

Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs in Material3. Are there any plans on changing to material3?

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.

Is there exist any way how to make it enable and disable ?

Hey,

Many thanks for the code it's really working great.

I have a problem I wanna use it as a wrapper for the item and this item is used with multiple lists so not all of the list will have it, so I was asking if there exists a way of making it enable or disable it.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.