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