WheelPickerCompose
Add Wheel Picker in Android Jetpack Compose.
Usage
Picker |
Usage |
|
WheelDateTimePicker { snappedDate, snappedTime -> } |
|
WheelDatePicker { snappedDate -> } |
|
WheelTimePicker { snappedTime -> } |
|
WheelTextPicker(texts = (1..6).map { it.toString() }) |
|
WheelPicker(count = 6) { index, snappedIndex -> Card(Modifier.size(128.dp).padding(8.dp)) {} } |
Setup
- Open the file
settings.gradle
(it looks like that)
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
// add jitpack here ??
maven { url 'https://jitpack.io' }
...
}
}
...
- Sync the project
- Add dependency
dependencies {
implementation 'com.github.commandiron:WheelPickerCompose:1.0.2'
}
Features
WheelDateTimePicker(
size = DpSize(200.dp, 100.dp),
textStyle = MaterialTheme.typography.titleSmall,
textColor = Color(0xFFffc300),
infiniteLoopEnabled = true,
selectorEnabled = true,
selectorShape = RoundedCornerShape(0.dp),
selectorColor = Color(0xFFf1faee).copy(alpha = 0.2f),
selectorBorder = BorderStroke(2.dp, Color(0xFFf1faee))
) { snappedDate, snappedTime -> }
|
|
GitHub
View Github