Package-level declarations
Types
Link copied to clipboard
Link copied to clipboard
data class KwikYearsData(val minYear: Int = 1965, val maxYear: Int = Calendar.getInstance().get(Calendar.YEAR))
Functions
Link copied to clipboard
fun KwikDateField(modifier: Modifier = Modifier, value: LocalDate? = null, onValidDate: (LocalDate) -> Unit, isError: Boolean = false, error: String = "", shape: Shape = MaterialTheme.shapes.small, colors: TextFieldColors = kwikTextFieldColors(), onKeyboardDone: () -> Unit = {})
Link copied to clipboard
fun KwikDateFieldButton(modifier: Modifier = Modifier, label: String? = null, placeholder: String = "", displayFormat: String = "d MMM yyyy", selected: (LocalDate) -> Unit, border: BorderStroke? = null, shape: Shape = MaterialTheme.shapes.medium, mode: KwikDatePickerMode = KwikDatePickerMode.Hybrid, leadingIcon: @Composable () -> Unit? = {
Icon(
painter = painterResource(id = R.drawable.calendar),
tint = MaterialTheme.colorScheme.onSurface,
contentDescription = null,
)
}, trailingIcon: @Composable () -> Unit? = {
Icon(
imageVector = Icons.Default.KeyboardArrowDown,
tint = MaterialTheme.colorScheme.onSurface,
contentDescription = null,
)
})
A hybrid date field that supports picking a date from a date picker dialog or editing the date manually.
Link copied to clipboard
Link copied to clipboard
fun KwikDatePickerDialog(title: String = "Select date", confirmText: String = "Confirm", cancelText: String = "Cancel", minSelectableDate: Long? = null, maxSelectableDate: Long? = null, onDateSelected: (LocalDate) -> Unit, showModeToggle: Boolean = false, confirmOnSelection: Boolean = true, colors: DatePickerColors = kwikDatePickerColors(), shape: Shape = MaterialTheme.shapes.medium, onDismiss: () -> Unit)
A date picker dialog that allows the user to select a date range.
Link copied to clipboard
fun KwikDateRangeButton(modifier: Modifier = Modifier, label: String? = null, onDateRangeSelected: (Pair<LocalDate, LocalDate>) -> Unit, minSelectableDate: Long? = null, maxSelectableDate: Long? = null, showModeToggle: Boolean = false, dialogShape: Shape = MaterialTheme.shapes.medium, colors: DatePickerColors = kwikDatePickerColors(), onClick: () -> Unit = {}, border: BorderStroke? = null, shape: Shape = MaterialTheme.shapes.medium, datePlaceholder: String = "Select dates", leadingIcon: @Composable () -> Unit? = {
Icon(
painter = painterResource(id = R.drawable.calendar),
tint = MaterialTheme.colorScheme.onSurface,
contentDescription = null,
)
}, trailingIcon: @Composable () -> Unit? = {
Icon(
imageVector = Icons.Default.KeyboardArrowDown,
tint = MaterialTheme.colorScheme.onSurface,
contentDescription = null,
)
})
A date button with a label and a date. When clicked, a date range picker dialog will be shown.
Link copied to clipboard
fun KwikDateRangePickerDialog(title: String = "Select date range", confirmText: String = "Confirm", cancelText: String = "Cancel", minSelectableDate: Long? = null, maxSelectableDate: Long? = null, onDateRangeSelected: (Pair<LocalDate, LocalDate>) -> Unit, showModeToggle: Boolean = false, colors: DatePickerColors = kwikDatePickerColors(), shape: Shape = MaterialTheme.shapes.medium, onDismiss: () -> Unit)
A date range picker dialog that allows the user to select a date range.
Link copied to clipboard
fun KwikYearsRangeSelector(title: String = "Year Range", fromYearText: String = "From Year", toYearText: String = "To Year", kwikYearsData: KwikYearsData = KwikYearsData(), onYearRangeChanged: (Int, Int) -> Unit)
A composable that displays a year range selector.