Summary
- Picker size is now driven entirely by
Modifierand the parent's constraints — thesize: DpSizeparameter is gone. - The selected (centered) item can be styled independently via
selectedTextStyle/selectedTextColor. - Smoother scrolling: less recomposition per selection change and less text measurement for CJK pickers.
- Source-breaking — binaries compiled against 1.3.x still link via hidden compatibility overloads, which will be removed in the next major release.
⚠️ Breaking changes
- Removed the
size: DpSizeparameter fromWheelDatePicker,WheelTimePicker,WheelDateTimePicker, andWheelTextPicker. Size now comes fromModifierand the parent's constraints. - Defaults when an axis is unconstrained: width 256.dp (date, date-time) / 128.dp (time, text); height
(128.dp / 3) * rowCount— sorowCount = 3is still 128.dp, but a largerrowCountnow grows the wheel instead of squeezing rows. - Renamed
WheelTextPickerparameters:style→textStyle,color→textColor. - Invalid sizing input now throws
IllegalArgumentExceptioneagerly (non-positiverowCount, non-finite or non-positive viewport height).
🔧 Migration
// Before
WheelDatePicker(size = DpSize(300.dp, 160.dp)) { }
// After
WheelDatePicker(modifier = Modifier.size(300.dp, 160.dp)) { }
// Before — responsive width workaround
BoxWithConstraints(Modifier.fillMaxWidth()) {
WheelDatePicker(size = DpSize(maxWidth, 200.dp)) { }
}
// After
WheelDatePicker(modifier = Modifier.fillMaxWidth().height(200.dp)) { }
// Keep the old total height for rowCount > 3
WheelDatePicker(modifier = Modifier.height(128.dp), rowCount = 5) { }- More examples: Sizing in the README.
✨ Added
selectedTextStyle/selectedTextColorto style the selected (centered) item independently, across date, time, date-time and text pickers — including the time separator and the CJK date suffixes (年/月/日, 년/월/일).- Both default to
textStyle/textColor, so nothing changes unless you set them.
🐛 Fixed & improved
onScrollChanged/onScrollFinishedare no longer captured stale (rememberUpdatedState).- Less recomposition on selection change, less text measurement for CJK pickers, and time picker column widths now update when the container is resized.
- Partial
TextStyles are merged with the defaults, so you can override just a few attributes.
📌 Known limitation
- Sizing is resolved via subcomposition, so intrinsic-measurement parents (
IntrinsicSize.Min/Max) will throw — pass an explicitwidth/heightinstead.
📦 Installation
implementation("io.github.darkokoa:datetime-wheel-picker:1.4.0")- Built with Kotlin 2.4.0, Compose Multiplatform 1.11.1, kotlinx-datetime 0.8.0, AGP 9.2.1, KSP 2.3.10.
- Targets: Android (minSdk 21), JVM/Desktop, iOS (
iosArm64,iosSimulatorArm64), JS, Wasm/JS.
What's Changed
- fix(core): use rememberUpdatedState to avoid stale callback capture in WheelPicker by @darkokoa in #135
- perf(core): optimize WheelPicker scroll rendering and reject invalid sizing inputs by @darkokoa in #136
- feat(core)!: support distinct selected item text styling by @darkokoa in #138
- chore(deps): update dependency com.google.devtools.ksp to v2.3.10 by @renovate[bot] in #137
- feat(core)!: make picker size follow the Modifier by @darkokoa in #142
Full Changelog: v1.3.3...v1.4.0