Compose utility to create a view swipeable

Compose utility to create a swipeable view

Implementation

Go to Settings.gradle, inside repositories block ->

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

Module level build.gradle

com.github.pseudoankit:SwipeableView:1.0.0

Implementation

SwipeableCard(
    config = SwipeableCardConfig(
        direction = direction,
        maxOffsetToReveal = 200f,
        revealThreshold = 50f
    ),
    modifier = Modifier
        .fillMaxWidth()
        .height(50.dp),
    color = Color.Blue,
    shape = RoundedCornerShape(12.dp)
) {
    Box(
        modifier = Modifier.fillMaxSize(),
        contentAlignment = Alignment.Center
    ) {
        Text(text = "Swipe card to reveal", color = Color.White)
    }
}

DEMO

Screen.Recording.2023-04-25.at.9.03.07.AM.mov

GitHub

View Github

Leave a Reply

Your email address will not be published. Required fields are marked *