A CRED like DragDownSlider library for Android Jetpack Compose.
A Sample App built with MVVM along with tests can be found at Sample App
Step 1. Add the JitPack repository to your build file Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation 'com.github.madhurgupta10:DragDownSlider:1.0.1'
}
val sliderState = rememberSwipeableState(SliderState.Start)
val isDragEnabled by remember { mutableStateOf(true) }
val responseState by remember { mutableStateOf(OnSlideCompleteState.Loading) }
DragDownSlider(
compactCardSize = 400.dp,
sliderState = sliderState,
onSlideCompleteState = responseState,
isDragEnabled = isDragEnabled,
onSlideComplete = {
...
}
)