An iOS-style scrolling time picker for Jetpack Compose.
Two snapping wheels (hour and minute) with a highlighted center selection band, a subtle alpha falloff and a 3D drum tilt away from center.
:timewheel— the reusable Compose library exposing theTimeWheelcomposable.:app— a demo app that hostsTimeWheelinMainActivity.
Published to Maven Central.
Ensure mavenCentral() is in your repositories (settings.gradle.kts):
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
}
}Add the dependency (module build.gradle.kts):
dependencies {
implementation("com.ozansan:timewheel:0.1.0")
}TimeWheel(
initialHour = 9,
initialMinute = 41,
is24Hour = true,
) { hour, minute ->
// called whenever the selection settles
}| Parameter | Type | Default | Description |
|---|---|---|---|
modifier |
Modifier |
Modifier |
Layout modifier. |
initialHour |
Int |
0 |
Starting hour. |
initialMinute |
Int |
0 |
Starting minute. |
is24Hour |
Boolean |
true |
24-hour (0–23) vs 12-hour wheel. |
visibleCount |
Int |
5 |
Rows visible at once (center + falloff). |
itemHeight |
Dp |
40.dp |
Height of each row. |
onTimeChange |
(hour, minute) -> Unit |
no-op | Fires when a wheel snaps to a value. |
./gradlew :app:assembleDebugRequires the Android SDK; minSdk 24.
