mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-15 05:27:28 +01:00
Rework on the wheel picker (#8559)
* Rework the wheel picker doesn't need for the animation to stop to change the value * fix --------- Co-authored-by: arkon <arkon@users.noreply.github.com>
This commit is contained in:
@@ -445,6 +445,19 @@ private data class TrackDateSelectorScreen(
|
||||
} else {
|
||||
stringResource(R.string.track_finished_reading_date)
|
||||
},
|
||||
minDate = if (!start && track.started_reading_date > 0) {
|
||||
// Disallow end date to be set earlier than start date
|
||||
Instant.ofEpochMilli(track.started_reading_date).atZone(ZoneId.systemDefault()).toLocalDate()
|
||||
} else {
|
||||
null
|
||||
},
|
||||
maxDate = if (start && track.finished_reading_date > 0) {
|
||||
// Disallow start date to be set later than finish date
|
||||
Instant.ofEpochMilli(track.finished_reading_date).atZone(ZoneId.systemDefault()).toLocalDate()
|
||||
} else {
|
||||
// Disallow future dates
|
||||
LocalDate.now()
|
||||
},
|
||||
selection = state.selection,
|
||||
onSelectionChange = sm::setSelection,
|
||||
onConfirm = { sm.setDate(); navigator.pop() },
|
||||
|
||||
Reference in New Issue
Block a user