Package-level declarations

Scroll-wheel and time entry: JengaWheelPicker, JengaDateOfBirthPicker, JengaTimeInput and JengaTimePickerDialog.

Types

Link copied to clipboard

The order of the day, month and year wheels in a JengaDateOfBirthPicker.

Link copied to clipboard

How a JengaTimeInput lets the user enter a time.

Link copied to clipboard
class JengaWheelPickerColors(val selectedContainer: Color, val selectedContent: Color, val content: Color)

Resolved colors for a JengaWheelPicker. Override via JengaWheelPickerDefaults.colors.

Link copied to clipboard

Defaults and token mappings for JengaWheelPicker.

Link copied to clipboard

Theme-wide style for every wheel, set through io.github.joelkanyi.jenga.theme.JengaComponentStyles.wheelPicker. A null value keeps Jenga's default; colors passed to a single call still win.

Functions

Link copied to clipboard
fun JengaDateOfBirthPicker(value: LocalDate, onValueChange: (LocalDate) -> Unit, monthLabel: (Month) -> String, modifier: Modifier = Modifier, minDate: LocalDate = JengaDateOfBirthPickerDefaults.MinDate, maxDate: LocalDate = remember { JengaCalendarDefaults.today() }, order: JengaDateFieldOrder = JengaDateFieldOrder.DayMonthYear, dayContentDescription: String? = null, monthContentDescription: String? = null, yearContentDescription: String? = null, visibleItemCount: Int = JengaWheelPickerDefaults.VisibleItemCount, itemHeight: Dp = JengaWheelPickerDefaults.ItemHeight, colors: JengaWheelPickerColors = JengaWheelPickerDefaults.colors())

A date-of-birth picker: day, month and year scroll wheels side by side. The day is kept valid as the month or year changes (31 March becomes 28 or 29 February), and the date never leaves minDate..maxDate.

Link copied to clipboard
fun JengaTimeInput(time: LocalTime, onTimeChange: (LocalTime) -> Unit, hourLabel: String, minuteLabel: String, amLabel: String, pmLabel: String, modifier: Modifier = Modifier, style: JengaTimeInputStyle = JengaTimeInputStyle.Wheel, is24Hour: Boolean = false, minuteStep: Int = 1)

A time input: hour and minute, plus AM / PM in 12-hour mode, as scroll wheels or typed fields. Every visible string comes from the caller.

Link copied to clipboard
fun JengaTimePickerDialog(onDismissRequest: () -> Unit, onConfirm: (LocalTime) -> Unit, title: String, confirmLabel: String, dismissLabel: String, initialTime: LocalTime, hourLabel: String, minuteLabel: String, amLabel: String, pmLabel: String, modifier: Modifier = Modifier, style: JengaTimeInputStyle = JengaTimeInputStyle.Wheel, is24Hour: Boolean = false, minuteStep: Int = 1)

A dialog holding a JengaTimeInput, with dismiss and confirm actions. The time is only reported when the confirm action is tapped.

Link copied to clipboard
fun <T> JengaWheelPicker(items: List<T>, selectedIndex: Int, onSelectedIndexChange: (Int) -> Unit, modifier: Modifier = Modifier, itemLabel: (T) -> String = { it.toString() }, contentDescription: String? = null, visibleItemCount: Int = JengaWheelPickerDefaults.VisibleItemCount, itemHeight: Dp = JengaWheelPickerDefaults.ItemHeight, selectionShape: Shape = JengaWheelPickerDefaults.selectionShape, textStyle: TextStyle = JengaWheelPickerDefaults.textStyle, colors: JengaWheelPickerColors = JengaWheelPickerDefaults.colors(), itemContent: @Composable (item: T, selected: Boolean) -> Unit = { item, selected -> JengaText( text = itemLabel(item), style = textStyle, color = if (selected) colors.selectedContent else colors.content, maxLines = 1, ) })

A scroll wheel for picking one of items: rows scroll vertically and snap so one sits in the highlighted middle band. Tapping a row scrolls it into the middle. For accessibility the wheel is a single adjustable control whose value is the selected row's label.