From 1b80b226d92983241353b3abe941e385186bd5dc Mon Sep 17 00:00:00 2001 From: Matija Nalis Date: Sat, 30 Nov 2024 13:59:57 +0100 Subject: [PATCH] move fillMaxSize to Box --- .../westnordost/streetcomplete/screens/main/MainScreen.kt | 7 ++++--- .../de/westnordost/streetcomplete/ui/util/ComposeView.kt | 2 -- .../java/de/westnordost/streetcomplete/ui/util/Fragment.kt | 1 - 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/main/MainScreen.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/main/MainScreen.kt index ac9b140009..d2ec1220bc 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/main/MainScreen.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/main/MainScreen.kt @@ -203,7 +203,10 @@ fun MainScreen( } } - Box(modifier) { + Box(modifier = Modifier + .fillMaxSize() + .windowInsetsPadding(WindowInsets.systemBars) + ) { if (isCreateNodeEnabled) { Crosshair() } @@ -218,8 +221,6 @@ fun MainScreen( } Column(Modifier - .fillMaxSize() - .windowInsetsPadding(WindowInsets.systemBars) .onGloballyPositioned { pointerPinRects["frame"] = it.boundsInRoot() } ) { Box(Modifier diff --git a/app/src/main/java/de/westnordost/streetcomplete/ui/util/ComposeView.kt b/app/src/main/java/de/westnordost/streetcomplete/ui/util/ComposeView.kt index 2d98f7c2bf..1f41e29ede 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/ui/util/ComposeView.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/ui/util/ComposeView.kt @@ -6,7 +6,5 @@ import de.westnordost.streetcomplete.ui.theme.AppTheme fun ComposeView.content(content: @Composable () -> Unit) { - consumeWindowInsets = true - setContent { AppTheme { content() } } } diff --git a/app/src/main/java/de/westnordost/streetcomplete/ui/util/Fragment.kt b/app/src/main/java/de/westnordost/streetcomplete/ui/util/Fragment.kt index 7288749c7b..5202b17df3 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/ui/util/Fragment.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/ui/util/Fragment.kt @@ -9,7 +9,6 @@ import androidx.fragment.app.Fragment fun Fragment.composableContent(content: @Composable () -> Unit): View = ComposeView(requireContext()).apply { - consumeWindowInsets = true setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnLifecycleDestroyed(lifecycle)) content { content() } }