Compose Number Picker is a library, which provides a simple to use, lightweight number picker component for Jetpack Compose. It has support for horizontal and vertical orientation.
If you want to test the library, please visit the sample app on Google Play!
If you haven't Jetpack Compose ready to go in your project, please refer to this guide to include Jetpack Compose into your project.
Then include ComposeNumberPicker to your project:
implementation 'com.chillibits:composenumberpicker:1.1.2'
As Compose Number Picker supports horizontal and vertical orientation, it provides two components for use:
- HorizontalNumberPicker view component
- VerticalNumberPicker view component
This is like a HorizontalNumberPicker
would look like in your Compose layout:
HorizontalNumberPicker(
min = 10,
max = 100,
default = 50,
modifier = Modifier.padding(10.dp),
onValueChange = { value ->
Toast.makeText(this@MainActivity, value.toString(), Toast.LENGTH_SHORT).show()
}
)
If you need an example, please look into the code of the demo app.
Here are the currently supported languages for the demo app. The library itself is language independent.
- English
- German
- French
New translations are highly appreciated. If you want to translate the lib, please open a pr.
If you want to contribute to this project, please feel free to send us a pull request.
Thanks to all contributors and translators!
© Marc Auberer 2021