Summary
rowCountis replaced byrows: WheelRows.WheelRows.Count(n)is the previous behavior; the newWheelRows.Height(h)fixes the row height and shows as many rows as fit, like a native iOS picker.- Wheel rows are now laid out on a cylinder ("barrel projection") in all pickers, configurable through the new
barrelPropertiesparameter. - Wheel callbacks no longer fire on first composition, and
onScrollFinishedno longer fires twice for one scroll gesture. - Source- and binary-breaking against 1.4.x — recompile anything built against 1.4.x. Code compiled against 1.3.x that calls the pickers still links through the hidden compatibility overloads.
- Docs: restructured README, a Chinese README, a
docs/folder, a migration guide, and a live Wasm demo.
⚠️ Breaking changes
rowCount: Intis replaced byrows: WheelRowsonWheelDatePicker,WheelTimePicker,WheelDateTimePickerandWheelTextPicker.WheelRows.Count(n)is the previous behavior (defaultCount(3)).- Even counts are laid out as the next odd number so the selected row is centered:
Count(4)shows the same five rows asCount(5), whileCount(4).countstays4. The extra row also counts toward the default height. Before, an evenrowCountrendered half a row cut off at each rim. - Not binary compatible with 1.4.x. The 1.4.x signatures of the four pickers (the ones with
rowCount) no longer exist in the binary, so code compiled against 1.4.x, including libraries that depend on this one, must be recompiled against 1.5.0. - The look changes. Rows sit on a barrel instead of the previous per-row tilt and fade. With
WheelRows.Countthey span the drum from rim to rim; for odd counts (including the default 3) the centered row is slightly taller thanheight / countand picker sizes are unchanged.
🔧 Migration
// Before
WheelDatePicker(rowCount = 5) { }
// After
WheelDatePicker(rows = WheelRows.Count(5)) { }
// Flatter wheel; 0f means no projection at all
WheelDatePicker(
barrelProperties = WheelPickerDefaults.barrelProperties(rimAngle = 0f),
) { }- Full guide, including the iOS look and fade settings: MIGRATION.md.
✨ Added
WheelRows.Height(h)fixes the row and selector height instead of the row count. Its intrinsic picker height is seven rows and its default rim angle is 90°.barrelPropertiesparameter, created withWheelPickerDefaults.barrelProperties(rimAngle, fadeStrength).rimAngleis0to90;fadeStrengthis any non-negative finite value (default1;0fkeeps every row opaque).- Without
barrelProperties, the rim angle followsrows: forWheelRows.Countit is 13° × (rows − 1), capped at 70° (26° for the default 3 rows, the 70° cap from 7 rows on); forWheelRows.Heightit is the full 90°. - Rows fade by their on-screen distance from the center, so the fade looks the same at any angle and also applies to a flat wheel.
WheelTextPickernow defaults torows = WheelRows.Count(3), like the other pickers.- The barrel projection is based on the contribution by @bnrdk in #150.
🐛 Fixed
- Wheel callbacks no longer fire on first composition: positioning the wheels at
startDate/startTimeno longer triggersonScrollChanged/onSnappedDateChanged(#71). onScrollFinishedno longer fires twice for one scroll gesture (#71).startDate/startTimeoutside theminDate/maxDate(minTime/maxTime) bounds is now coerced into range.- Date pickers deduplicate consecutive
onSnappedDateChangednotifications that resolve to the same date. - Rows more than four positions from the center no longer render mirrored.
📦 Installation
implementation("io.github.darkokoa:datetime-wheel-picker:1.5.0")- Built with Kotlin 2.4.20, Compose Multiplatform 1.12.1, kotlinx-datetime 0.8.0, AGP 9.3.1, KSP 2.3.10.
- Targets: Android (minSdk 21), JVM/Desktop, iOS (
iosArm64,iosSimulatorArm64), JS, Wasm/JS.
What's Changed
- chore(sample): log picker callbacks via Kermit by @darkokoa in #143
- fix(core): prevent duplicate and initial-composition wheel callbacks by @darkokoa in #144
- chore(build): modernize gradle build configuration by @darkokoa in #145
- chore(deps): update agp to v9.3.1 by @renovate[bot] in #140
- chore(deps): update kotlin monorepo to v2.4.10 by @renovate[bot] in #139
- fix(deps): update compose to v1.12.0 by @renovate[bot] in #152
- chore(deps): update lyricist to v1.9.0 by @darkokoa in #153
- feat!: project wheel rows onto a barrel by @darkokoa in #157
- feat!: replace rowCount with WheelRows by @darkokoa in #158
- feat(barrel)!: fade wheel rows by on-screen position by @darkokoa in #160
- fix(deps): update compose to v1.12.1 by @renovate[bot] in #159
- fix(deps): update dependency co.touchlab:kermit to v2.2.0 by @renovate[bot] in #156
- chore(deps): update kotlin monorepo to v2.4.20 by @renovate[bot] in #155
- ci: fix the Wasm sample build and deploy it to GitHub Pages by @darkokoa in #161
- docs: restructure README, add docs/, MIGRATION.md and a zh-CN translation by @darkokoa in #162
- chore(release): bump to 1.5.0 by @darkokoa in #163
Full Changelog: v1.4.0...v1.5.0