Fixed
Status Update
Comments
ma...@google.com <ma...@google.com>
sg...@google.com <sg...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit d10eb89f40576babbedadf4830b52345cc58bd91
Author: Shalom Gibly <sgibly@google.com>
Date: Mon Feb 27 16:53:19 2023
Adds API for setting dates at the DatePicker state
This change adds functionality to the DatePickerState and the
DateRangePickerState to allow setting dates after the initial creation
of the state, as well as reset the selections by setting null values.
Note that setting dates should be make with caution. The new
`setSelection` function will throw an exception in case the provided
dates fail some preconditions (see documentation).
Fixes: 268609314
Fixes: 270427389
Test: DatePickerTest, DateRangePickerTest
Relnote: "Added functionality to the DatePickerState and the
DateRangePickerState to allow setting dates after the initial creation
of the state, as well as resetting selections by setting null
timestamps. Setting dates manually should be made with caution, and
the new `setSelection` function will throw an exception in case a
provided date fails a precondition (see documentation)."
Change-Id: Ifa6451a9e32ad031ac3223cb8b5fea132a2d0191
M compose/material3/material3/api/public_plus_experimental_current.txt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/DatePickerTest.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/DateRangePickerTest.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/DatePicker.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/DateRangePicker.kt
https://android-review.googlesource.com/2459549
Branch: androidx-main
commit d10eb89f40576babbedadf4830b52345cc58bd91
Author: Shalom Gibly <sgibly@google.com>
Date: Mon Feb 27 16:53:19 2023
Adds API for setting dates at the DatePicker state
This change adds functionality to the DatePickerState and the
DateRangePickerState to allow setting dates after the initial creation
of the state, as well as reset the selections by setting null values.
Note that setting dates should be make with caution. The new
`setSelection` function will throw an exception in case the provided
dates fail some preconditions (see documentation).
Fixes: 268609314
Fixes: 270427389
Test: DatePickerTest, DateRangePickerTest
Relnote: "Added functionality to the DatePickerState and the
DateRangePickerState to allow setting dates after the initial creation
of the state, as well as resetting selections by setting null
timestamps. Setting dates manually should be made with caution, and
the new `setSelection` function will throw an exception in case a
provided date fails a precondition (see documentation)."
Change-Id: Ifa6451a9e32ad031ac3223cb8b5fea132a2d0191
M compose/material3/material3/api/public_plus_experimental_current.txt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/DatePickerTest.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/DateRangePickerTest.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/DatePicker.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/DateRangePicker.kt
na...@google.com <na...@google.com> #3
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material3:material3:1.1.0-alpha08
Description
The selectedDateMillis setter is internal. So it isn't possible to overrite the selected date.
More info (my message on issue 231704914 ):
Why is it only possible to set a timestamp initially and not overwrite it afterwards? If I use a date picker dialoge and have a cancel button there, then I do not use the selected date, but as soon as the user opens the picker again, the discarded date is still selected. Or should I always recreate the entire pickerstate, but that can't be it...?