Wheelview is the picker library developed on top of Jetpack Compose.
WheelView(
modifier = Modifier,
itemSize = DpSize(/*width*/, /*height*/),
selection = /*selection*/,
itemCount = /*itemCount*/,
selectorOption = SelectorOptions(),
rowOffset = /*offset*/,
onFocusItem = { index ->
},
content = {
//Your composable (Height must not bigger than itemSize!!!)
})
Parameter | Type | Description |
---|---|---|
itemSize | DpSize | Size of each composable that we set to content |
selection | Int | Default selected item of wheel |
itemCount | Int | Size of elements we set to wheelview |
rowOffset | Int | Count of items to be shown |
isEndless | Boolean | Uses to enable or disable infinite scroll |
userScrollEnabled | Boolean | ses to enable or disable user scroll |
selectorOption | SelectorOptions | Whether the scrolling via the user gestures or accessibility actions is allowed. You can still scroll programmatically using the state even when it is disabled |
onFocusItem | Called when the values in the wheelview are updated | |
content | composable of item |
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.ozcanalasalvar.picker:wheelview:2.0.5'
}