Compose Multiplatform implementation of WheelPickerCompose.
Picker | Usage |
---|---|
WheelDateTimePicker { snappedDateTime -> } |
|
WheelDatePicker { snappedDate -> } |
|
WheelTimePicker { snappedTime -> } |
|
WheelTimePicker(timeFormat = TimeFormat.AM_PM) { snappedTime -> } |
datetime-wheel-picker has multiple active versions. The higher one uses the latest versions for Compose, while the others use only stable versions. Choose the one that matches your Compose version, considering this table:
Compose Version | datetime-wheel-picker Version |
---|---|
Compose 1.3 - 1.6 | |
Compose 1.7 |
- Add the Maven Central repository if it is not already there:
repositories {
mavenCentral()
}
- In Compose multiplatform projects, add a dependency to the commonMain source set dependencies:
kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation("io.github.darkokoa:datetime-wheel-picker:<version>")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.1")
}
}
}
}
- To use the library in a single-platform project (such as Android project), add a dependency to the dependencies block:
dependencies {
implementation("io.github.darkokoa:datetime-wheel-picker:<version>")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.1")
}
- If your minimum Android platform's API level (minSdk) < 26, please enable Desugaring like this:
compileOptions {
isCoreLibraryDesugaringEnabled = true
}
//...
dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
}
Released under the Apache License, Version 2.0.