Status Update
Comments
va...@google.com <va...@google.com> #2
The internal systemBarsForVisualComponents
right now only uses systemBars
, which doesn't include the display cutout:
Updating to systemBars.union(displayCutout)
should fix this, if that's a change we can make.
ci...@google.com <ci...@google.com> #3
Thank you for looking into this! It would be crucial to get this right soon as the edge2edge project depends on handling this properly :)
va...@google.com <va...@google.com> #4
Not taking the display cutout into account will impact cars heavily, since some have very large display cutouts:
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
Author: Alex Vanyo <
Link:
Add displayCutout to default Material insets
Expand for full commit details
Add displayCutout to default Material insets
Relnote: "Adds displayCutout to the group of insets that Material
components take into account by default, to avoid content overlapping
with the display cutout.
This is a behavior change that will impact how inset-aware
components behave around a display cutout. This includes the default
value of the WindowInsets parameter for inset-aware Material 3
components, and the WindowInsets values provided in the component
Defaults objects for both Material 2 and Material 3.
If this change causes undesirable behavior,
manually specify the WindowInsets parameter on a per-component basis."
Fixes: 362508045
Change-Id: I43ee9ad12db0450ebb9c65ce10d5c39d12628b6c
Files:
- M
compose/material/material/src/androidMain/kotlin/androidx/compose/material/SystemBarsDefaultInsets.android.kt
- M
compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/MaterialComponentsInsetSupportTest.kt
- M
compose/material3/material3/src/androidMain/kotlin/androidx/compose/material3/internal/SystemBarsDefaultInsets.android.kt
Hash: 692b440ac97b1831d5b35aafff241a98aeeacb93
Date: Wed Dec 18 19:49:15 2024
va...@google.com <va...@google.com>
pr...@google.com <pr...@google.com> #6
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material:material:1.8.0-alpha08
androidx.compose.material:material-android:1.8.0-alpha08
androidx.compose.material:material-jvmstubs:1.8.0-alpha08
androidx.compose.material:material-linuxx64stubs:1.8.0-alpha08
androidx.compose.material3:material3:1.4.0-alpha06
androidx.compose.material3:material3-android:1.4.0-alpha06
androidx.compose.material3:material3-jvmstubs:1.4.0-alpha06
androidx.compose.material3:material3-linuxx64stubs:1.4.0-alpha06
Description
Jetpack Compose version:
Material Library Version (M2, M3 or Both?):
Material Compose component used:
androidx.compose.material3.Scaffold
Steps to Reproduce:
MainActivity.kt
, (a)enableEdgeToEdge
is called and (b)Scaffold's PaddingValues
(calledinnerPadding
here) is applied to the entire content.See attached image (
Scaffold_DisplayCutout.png
). I've modified the sample code to make the issue more apparent. Notice the Composable, which is usinginnerPadding
, avoids the system bars region but does not avoid the display cutout region.Severity: To ensure Scaffold's edge-to-edge is enforced in Android 15.
PaddingValues
makes going edge-to-edge easy, it should account for display cutouts. Otherwise, developers shouldn't use Scaffold'sPaddingValues
and should instead use alternatives likeWindowInsets.safeDrawing
,WindowInsets.safeGestures
, orWindowInsets.safeContent
. This is especially important as