Status Update
Comments
ma...@wnco.com <ma...@wnco.com> #2
Branch: androidx-main
commit 46eea23c96f45f0ee1e57d8aef2f1375507b0dec
Author: José Figueroa Santos <serniebanders@google.com>
Date: Tue Apr 11 14:38:58 2023
[M3][ModalBottomSheet] Enable edge to edge functionality for ModalBottomSheet
Bug: 274872542
Bug: 272973615
Bug: 272334475
Bug: 268432129
Bug: 275849044
Bug: 275486106
Bug: 268433162
RelNote: Add window insets parameter to ModalBottomSheet.
RelNote: Scrim for ModalBottomSheet may now be drawn behind status bar with windowInsets set to zero
RelNote: Updated default ModalBottomSheet functionality to stay outside of system bars including navigation
RelNote: Status bar inset handling is provided by drag handle in edge-to-edge mode.
RelNote: BottomSheetDefaults includes window insets for BottomSheetWindow.
Test: Parameterizes existing tests to work with and without edgeToEdge enabled.
Test: Manual EdgeToEdge testing on various devices and android APIs
Change-Id: I312008e48573ebd21326f77216be0bcd0372aa78
M compose/material3/material3/api/public_plus_experimental_current.txt
M compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/BottomSheetSamples.kt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/ModalBottomSheetTest.kt
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/ModalBottomSheet.android.kt
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/Strings.android.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/SheetDefaults.kt
ma...@wnco.com <ma...@wnco.com> #3
Tested with 1.2-alpha02. There are some improvements but the cases still all have problems.
Pixel 4a landscape is not clipping the bottom of the sheet anymore, but a white box is appearing on the right side of the screen the size of the system navigation buttons when not using gesture navigation.
Pixel C API33 emulator in landscape the bottomsheet is now sized so all the items would be visible, IF it was appearing over top the system navigation bar, but the bottom is behind it still in that tablet case. On a Pixel C API29 emulator in landscape the bottomsheet appears on top of the system navigation bar, but taps are not being recognized on that are. (don't have samsung s5e tablet with android 9 to test right now)
in the sample and our usage, we are not using edge to edge mode or full scaffold infrastructure (actual app usage is with a ComposeView thats not full screen)
re...@gmail.com <re...@gmail.com> #4
This is really a big problem. So unfortunately we cannot use the ModalBottomSheet productively yet.
When can we expect a correction?
do...@gmail.com <do...@gmail.com> #5
se...@google.com <se...@google.com>
se...@google.com <se...@google.com>
ap...@google.com <ap...@google.com> #6
Any updates on this?
se...@google.com <se...@google.com> #7
pr...@google.com <pr...@google.com> #8
Some news about that?
do...@gmail.com <do...@gmail.com> #9
se...@google.com <se...@google.com>
ap...@google.com <ap...@google.com> #10
Without edge-to-edge enabled (`decorFitsSystemWindows` is true) material ModalBottomSheet works incorrect, it always overlaps navigation bar.
I tried different solutions, but the only one that works for me is very ugly:
```
@Composable
@SuppressLint("DiscouragedApi")
// todo:
private fun rememberDimensionByName(name: String): Int {
val resources = LocalContext.current.resources
return remember {
val id = resources.getIdentifier(name, "dimen", "android")
if (id == 0) 0 else resources.getDimensionPixelSize(id)
}
}
<...>
val topInsets = WindowInsets(top = rememberDimensionByName("status_bar_height"))
val bottomInsets = WindowInsets(bottom = rememberDimensionByName("navigation_bar_height"))
ModalBottomSheet(
...
windowInsets = topInsets,
content = {
Box(Modifier.padding(bottomInsets.asPaddingValues())) {
...
}
},
)
```
android plugin "8.2.2"
kotlin version "1.9.22"
kotlinCompilerExtensionVersion = "1.5.8"
androidx.activity:activity-compose:1.8.2
androidx.compose.ui:ui:1.6.0
androidx.compose.material3:material3:1.1.2
Description
Jetpack Compose version: 2024.08.00 BOM
Material Library Version: "androidx.compose.material3:material3:1.3.0-rc01
Material Compose component used: ModalBottomSheet
Android Studio Build: 2024.1.1 Patch 2
Kotlin version: 1.9.0
Steps to Reproduce or Code Sample to Reproduce:
Expected behavior:
ModalBottomSheet should not change status bar icon color unless it is expanded into the status bar. Or there should be an option to override it.