Status Update
Comments
se...@google.com <se...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
Author: Louis Pullen-Freilich <
Link:
Adds OverscrollEffect#withoutDrawing and OverscrollEffect#withoutEventHandling
Expand for full commit details
Adds OverscrollEffect#withoutDrawing and OverscrollEffect#withoutEventHandling
These APIs allow overscroll to have events dispatched to it by one component, and rendered in a separate component.
Fixes: b/266550551
Fixes: b/204650733
Fixes: b/255554340
Fixes: b/229537244
Test: OverscrollTest
Relnote: "Adds OverscrollEffect#withoutDrawing and OverscrollEffect#withoutEventHandling APIs - these APIs create a wrapped instance of the provided overscroll effect that doesn't draw / handle events respectively, which allows for rendering overscroll in a separate component from the component that is dispatching events. For example, disabling drawing the overscroll inside a lazy list, and then drawing the overscroll separately on top / elsewhere."
Change-Id: Idbb3d91546b49c1987a041f959bce4b2b09a9f61
Files:
- M
compose/foundation/foundation/api/current.txt
- M
compose/foundation/foundation/api/restricted_current.txt
- M
compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/OverscrollDemo.kt
- M
compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/OverscrollSample.kt
- M
compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/OverscrollTest.kt
- M
compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Overscroll.kt
Hash: f64e25b7a473c757d080521e7dd97b3f6670f60d
Date: Fri Nov 01 18:43:56 2024
an...@microsoft.com <an...@microsoft.com> #3
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.8.0-alpha06
androidx.compose.foundation:foundation-android:1.8.0-alpha06
androidx.compose.foundation:foundation-jvmstubs:1.8.0-alpha06
androidx.compose.foundation:foundation-linuxx64stubs:1.8.0-alpha06
se...@google.com <se...@google.com>
se...@google.com <se...@google.com>
se...@outlook.de <se...@outlook.de> #4
This is really a big problem. So unfortunately we cannot use the ModalBottomSheet productively yet.
When can we expect a correction?
pr...@oodles.io <pr...@oodles.io> #5
ki...@protonmail.com <ki...@protonmail.com> #6
Any updates on this?
bo...@gmail.com <bo...@gmail.com> #7
ra...@gmail.com <ra...@gmail.com> #8
Some news about that?
ri...@gmail.com <ri...@gmail.com> #9
si...@gmail.com <si...@gmail.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
ty...@gmail.com <ty...@gmail.com> #11
di...@gmail.com <di...@gmail.com> #12
Yes, I still see the issue as well even with edge to edge enabled.
he...@gmail.com <he...@gmail.com> #13
se...@google.com <se...@google.com>
ma...@gmail.com <ma...@gmail.com> #14
he...@gmail.com <he...@gmail.com> #15
za...@gmail.com <za...@gmail.com> #16
sh...@zohocorp.com <sh...@zohocorp.com> #17
Any update on this?
se...@google.com <se...@google.com> #18
We are working on moving the underlying logic to a dialog implementation which should improve this experience in a variety of devices. Apologies for the delay on this. In the meantime, I have the first iteration of this change here:
Would appreciate any and all eyes on this, and especially any manual testing that can be done on a variety of devices/edge cases.
ap...@google.com <ap...@google.com> #19
Branch: androidx-main
commit 33c32f65dd7879954cfa7a46a76eb959c977e291
Author: Jose Figueroa <serniebanders@google.com>
Date: Tue Mar 19 17:08:01 2024
[M3][BottomSheet] Migrate bottom sheet to dialog implementation from popup.
Dialog provides access to the new window created, which allows for system bars styling, setDecorFitsSystemWindows for edge to edge functionality, and unconsumed window insets for proper content padding.
Bug: 274872542
Bug: 300280229
Bug: 290893168
Test: "Existing tests now check for dialog, toggle decorFitsSystemWindows for edge to edge. Added Unit Test for content window inset consumption. Manual testing on API 28, 31, 33, 34 on Pixel 4a, 7, 8, Tablet, and Samsung Galaxy S24"
RelNote: "ModalBottomSheet more accurately draws scrim over status bar when edge to edge is enabled. Modal bottom sheet content can now consume window insets, allowing for visible content above navigation bar. ModalBottomSheet parameter windowInsets renamed to contentWindowInsets to specify where the insets will be applied, these are no longer tied to window logic. contentWindowInsets type has been changed to a function which returns WindowInsets, to allow it to be resolved within its new window."
Change-Id: I39630f2d9a1b159ef27fa62750ffa26b00e078a0
M compose/material3/material3/api/current.txt
M compose/material3/material3/api/restricted_current.txt
M compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/ui/common/CatalogScaffold.kt
M compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/BottomSheetSamples.kt
M compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ModalBottomSheetTest.kt
M compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/ModalBottomSheet.android.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/SheetDefaults.kt
A compose/material3/material3/src/main/res/values-v30/styles.xml
A compose/material3/material3/src/main/res/values/styles.xml
bo...@gmail.com <bo...@gmail.com> #20
ab...@gmail.com <ab...@gmail.com> #21
se...@google.com <se...@google.com> #22
I believe the following change will land alongside 1.3.0-alpha06. In the meantime, going to leave this bug open to allow some soak time.
pe...@gmail.com <pe...@gmail.com> #23
se...@google.com <se...@google.com> #24
Looking into this styling issue with the status bar. Follow
se...@google.com <se...@google.com> #25
A proposed fix for this bug has been landed in our latest beta release. The bottom sheet window now extends edge to edge by default, and the content padding parameter, alongside with content tagged with system bar padding modifiers should now appropriately move content outside of the nav bar area.
ma...@olxbr.com <ma...@olxbr.com> #26
jb...@anthropic.com <jb...@anthropic.com> #27
This solution seems to work well for the nav bar area, but now bottom sheets with very long content draw behind the status bar at the top of the screen. By default, the grab bar will end up behind the status bar in this case. It isn't obvious how to apply the status bar padding here so that the bottom sheet doesn't go behind it.
As a workaround, you can apply padding to the top of the sheet, but it seems like something that should be handled by default.
ModalBottomSheet(
modifier = Modifier.windowInsetsPadding(WindowInsets.statusBars)
) {
...
}
ni...@carfax.com <ni...@carfax.com> #28
onDismissRequest = { onDismiss() },
sheetState = state,
dragHandle = { BottomSheetDefaults.DragHandle() },
modifier = Modifier.statusBarsPadding().navigationBarsPadding()
) {
//Compose Body
}
Similar issue I was facing while showing BottomSheet in full screen. I did some experiment with modifier and it worked.
My design requirement was to show full screen BottomSheet but below toolbar so I've added two properties.
Description
Jetpack Compose version: 1.4.0, material3 1.1.0-beta01 Jetpack Compose component used: material3 Android Studio Build: Kotlin version: 1.8.10
Steps to Reproduce or Code Sample to Reproduce: Use M3 ModalBottomSheet API with some text content. Finding many scenarios where the bottom of the sheet is not displayed, can't be pulled up. Some examples where cut off:
Sample code:
Some examples attached. Pixel4a working is what it should show, items 1, 2, 3 but in landsacpe its cutoff, pixel c emulator its cutoff in all orientations