Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 76627d4fa38dfeb93252e1bdbcb0b43712f437f7
Author: Shalom Gibly <sgibly@google.com>
Date: Tue Mar 07 14:13:28 2023
Adds support for headless date pickers
- Allow null headline composable at the DatePicker and the
DateRangePicker.
- Draw a Divider between the header part and the calendar/date-input
part only when the title and the headline were null, and when the
showModeToggle was false.
- Since the title part is setting the top padding for the DatePicker,
note that when removing it, the resposibility for setting a reasonable
top padding is on the developer.
Bug: 266132421
Bug: 267194809
Test: updated screenshot tests in the topic
Relnote: "Added support for displaying the date pickers without the
header part. API changes to allow passing a null headline when creating
a date picker. You can now pass null headline, title, and showToggleMode
= false in order to display a headless picker."
Change-Id: Id3f3a800c84c12f7c96a3654e59258933da0ec0b
M compose/material3/material3/api/public_plus_experimental_current.txt
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/2475017
Branch: androidx-main
commit 76627d4fa38dfeb93252e1bdbcb0b43712f437f7
Author: Shalom Gibly <sgibly@google.com>
Date: Tue Mar 07 14:13:28 2023
Adds support for headless date pickers
- Allow null headline composable at the DatePicker and the
DateRangePicker.
- Draw a Divider between the header part and the calendar/date-input
part only when the title and the headline were null, and when the
showModeToggle was false.
- Since the title part is setting the top padding for the DatePicker,
note that when removing it, the resposibility for setting a reasonable
top padding is on the developer.
Bug: 266132421
Bug: 267194809
Test: updated screenshot tests in the topic
Relnote: "Added support for displaying the date pickers without the
header part. API changes to allow passing a null headline when creating
a date picker. You can now pass null headline, title, and showToggleMode
= false in order to display a headless picker."
Change-Id: Id3f3a800c84c12f7c96a3654e59258933da0ec0b
M compose/material3/material3/api/public_plus_experimental_current.txt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/DatePicker.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/DateRangePicker.kt
il...@google.com <il...@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-beta01
Description
Component used: lifecycle-viewmodel-savedstate Version used: 2.3.0-alpha01
SavedStateHandle
is currently the only mechanism for accessing saved instance state from aViewModel
. However, it currently forces you to only use objects that can be put in a Bundle sinceset()
verifies the type of object immediately.It would be nice if
SavedStateHandle
could also support lazy serialization of objects - namely, having some equivalent to being able to register aonSaveInstanceState()
like callback.It seems like this is precisely what something like
SavedStateProvider
could fill. You couldregisterSavedStateProvider()
with aString key
and aSavedStateProvider
and theSavedStateHandle
would be responsible for callingsaveState()
on each provider to fill in theBundle
for that key.It would be the responsibility of the
ViewModel
for maintaining the non-bundable object outside ofSavedStateHandle
(i.e., having its ownMutableLiveData
) as well as in implementing theSavedStateProvider
.There'd need be some way to access the previously saved state - perhaps the underlying
get()
method would return aBundle?
indicating the previously saved state and/orregisterSavedStateProvider()
could return that sameBundle?
.