Status Update
Comments
sg...@google.com <sg...@google.com>
gk...@ramp.com <gk...@ramp.com> #2
Branch: androidx-master-dev
commit 815efc4dea3c65634090fd272b5bf9d9cf68d70b
Author: Matvei Malkov <malkov@google.com>
Date: Tue Aug 04 13:35:42 2020
Drawer API polish
Added few paramerets for better customization, refactored samples to make them copyable
Change-Id: I236555ff68b57685c4709ba24a6464e7fba0c10a
Relnote: modifier, backgroundColor, contentColor and scrimColor customization params has been added to Drawers
Fixes: 161804378
Test: should pass
M ui/ui-material/api/current.txt
M ui/ui-material/api/public_plus_experimental_current.txt
M ui/ui-material/api/restricted_current.txt
M ui/ui-material/samples/src/main/java/androidx/compose/material/samples/DrawerSamples.kt
M ui/ui-material/src/androidAndroidTest/kotlin/androidx/compose/material/DrawerTest.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Drawer.kt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/Scaffold.kt
sg...@google.com <sg...@google.com> #3
Thanks for this!
For the second issue - This is actually following our design spec at
If you can please file a separate issue that would be great, so we can refer it to the design team. In the meantime, as you've noticed, the API provides enough flexibility to overcome that issue and provide your own title
and headline
, so I hope that helped.
For the original issue, I'll try to push a fix into the DatePickerDialog
internals to handle this asap.
gk...@ramp.com <gk...@ramp.com> #4
Thank you. I think the second issue is actually not following the design spec given that the left padding is 64.dp for the title / headline and the design spec linked seems to show 16.dp left padding. I will make a second ticket. Indeed since the API provides title
and headline
and other such customization I am able to work around all of this for now, it was just confusing to see the component looking / behaving so weird at first and having deduce what was wrong with it. And thank you for addressing the first issue!
ap...@google.com <ap...@google.com> #5
Branch: androidx-main
commit f09ae412b90caf84bc36b55b0d4ef75b6b6503a8
Author: Shalom Gibly <sgibly@google.com>
Date: Wed Feb 14 17:03:33 2024
Ensure buttons visibility at the DatePickerDialog
Wrap the content with a Box and Modifier.weight = 1 to ensure any
confirm or dismiss buttons are visible when the dialog wraps a
DateRangePicker, or when large fonts are displayed on smaller screens.
Bug: 325107799
Bug: 277768544
Test: Verified screenshot tests and manual tests
Relnote: "Ensure that the DatePickerDialog displays its buttons when
nesting a DateRangePicker or when displaying any type of date picker on
small screens with larger fonts."
Change-Id: Ie4758e82b94eb2d5e448a973c550302ff1601f3f
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/DatePickerDialog.android.kt
sg...@google.com <sg...@google.com> #6
Thanks. I believe that the design intent was to have the Date-Range-Picker in a full screen, and not in a dialog. But since we still allow placing it in a dialog (makes sense to me:)), there may be some adjustments that will need to be done to better support it visually.
Also, just pushed a fix for the main issue here and it should be available at the next 1.3.0 alpha release.
gk...@ramp.com <gk...@ramp.com> #7
Thanks so much for fixing! I wasn't aware that DateRangePicker was intended to be used in a full screen, as it doesn't included confirm / cancel buttons by default it made sense to me to wrap it in a DatePickerDialog which does provide those. Appreciate your help here!
na...@google.com <na...@google.com> #8
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material3:material3:1.3.0-alpha02
androidx.compose.material3:material3-android:1.3.0-alpha02
androidx.compose.material3:material3-desktop:1.3.0-alpha02
Description
Jetpack Compose component used: DateRangePicker
Android Studio Build: Android Studio Build: Android Studio Hedgehog | 2023.1.1
Build #AI-231.9392.1.2311.11076708, built on November 9, 2023
Kotlin version: 1.7.20
Material3 version: androidx.compose.material3:material3:1.2.0
If you put a DateRangePicker within a DatePickerDialog, the Confirm button seems to be hidden by default, I think being overlapped / pushed off by the DateRangePicker content. Manually adding a Modifier.weight(1f) to the DateRangePicker seems to fix this. Probably this Modifier should be included by default within the SDK to avoid this problem.
Sample Code:
```
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
ComposeTestV2Theme {
// A surface container using the 'background' color from the theme
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
DatePickerTest()
}
}
}
}
}
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun DatePickerTest() {
val state = rememberDateRangePickerState()
Column {
DatePickerDialog(
onDismissRequest = {},
confirmButton = {
TextButton(onClick = { Log.d("DatePicker", "Confirm button clicked") }) {
Text("Confirm")
}
},
) {
DateRangePicker(
// modifier = Modifier.weight(1f),
state = state,
)
}
}
}
```