Skip to content

A CRED like DragDownSlider library for Android Jetpack Compose

Notifications You must be signed in to change notification settings

madhurgupta10/DragDownSlider

Repository files navigation

DragDownSlider

A CRED like DragDownSlider library for Android Jetpack Compose.

Sample App

A Sample App built with MVVM along with tests can be found at Sample App

Installation

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

Usage

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 = {
        ...
    }
)