Fixed
Status Update
Comments
ja...@blackriflecoffee.com <ja...@blackriflecoffee.com> #2
Comment has been deleted.
p....@squaregps.com <p....@squaregps.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
ma...@gmail.com <ma...@gmail.com> #4
I have the same issue. At the bottom of the ModalBottomSheet (material3) I have a TextField and when the keyboard it's open, the insets doesn't work. The content is overlapped with the keyboard. In Android versions <30.
ja...@gmail.com <ja...@gmail.com> #5
We are having the same issue, the keyboard overlaps the bottom sheet as the callback seems to not return the correct insets.
ju...@gmail.com <ju...@gmail.com> #6
For a temporary workaround, you can create a padding so that the keyboard does not overlap your text field.
val imePadding = WindowInsets.ime.asPaddingValues()
val systemBarsPadding = WindowInsets.systemBars.asPaddingValues()
ModalBottomSheet(onDismissRequest = {}) {
Column(
modifier = Modifier
.weight(1f) // <-- Very important, we need the column to resize when the keyboard is shown
) {
TextField(value = "", onValueChange = {})
}
// TODO: remove workaround when fixed https://issuetracker.google.com/issues/290893168
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
Spacer(
modifier = Modifier
.height(
imePadding.calculateBottomPadding()
.minus(systemBarsPadding.calculateBottomPadding())
)
)
}
}
rh...@gmail.com <rh...@gmail.com> #7
Any update on this? We thought it was a good idea to migrate from Material 2 to Material 3.. but we are discovering Bottom Sheets are filled with issues.
se...@google.com <se...@google.com>
se...@google.com <se...@google.com>
ap...@google.com <ap...@google.com> #9
Project: platform/frameworks/support
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
https://android-review.googlesource.com/3007166
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
Description
Jetpack Compose version & components:
implementation("androidx.core:core-ktx:1.10.1")
implementation("androidx.activity:activity-compose:1.7.2")
implementation(platform("androidx.compose:compose-bom:2023.06.01"))
implementation("androidx.compose.material3:material3:1.1.1")
Kotlin version: 1.8.10 & Compose compiler 1.4.3
Steps to Reproduce or Code Sample to Reproduce:
Steps to reproduce:
Expected result:
Current result:
Phone specs:
I've verified that any insets read inside the ModalBottomSheet's content slot does not work, outside of it, it works ok. E.g. using the default windowInsets arg "works" in a way it puts the bottom sheet above the nav bar.
Screenshots attached.