[go: nahoru, domu]

Adjust material inset logic to account for ime and to allow for scaffold opt-out.

This change makes sure scaffold is handling the insets well. Allows for opt-outs and doesn't interfere with the IME paddings.

While we are at it, this change adjusts other components to never account for IME padding as well, making it an opt-in behavior.

Fixes: 243713323
Test: added new for new API + adjusted existing
Relnote: Default components insets introduced in m3 components in beta01 version are no longer account for IME insets.
Relnote: material3 Scaffold component now has a contentWindowInsets parameter, allowing to specify the amount of insets to handle for the content slot.
Change-Id: Icf11a4169c801d2670d88066984328205f48bb4f
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationBar.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationBar.kt
index bf42087..0844cfd 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationBar.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationBar.kt
@@ -270,7 +270,7 @@
      */
     val windowInsets: WindowInsets
         @Composable
-        get() = WindowInsets.safeDrawingForVisualComponents
+        get() = WindowInsets.systemBarsForVisualComponents
             .only(WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom)
 }