From 8ba12ce1076c09e3112a9ff8f9d36391ad198444 Mon Sep 17 00:00:00 2001 From: MM20 <15646950+MM2-0@users.noreply.github.com> Date: Tue, 27 May 2025 17:54:29 +0200 Subject: [PATCH] Fix bottom search insets --- .../launcher2/ui/launcher/scaffold/LauncherScaffold.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/launcher/scaffold/LauncherScaffold.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/launcher/scaffold/LauncherScaffold.kt index 2b310e68..60b832dc 100644 --- a/app/ui/src/main/java/de/mm20/launcher2/ui/launcher/scaffold/LauncherScaffold.kt +++ b/app/ui/src/main/java/de/mm20/launcher2/ui/launcher/scaffold/LauncherScaffold.kt @@ -1389,16 +1389,13 @@ internal fun LauncherScaffold( ) { val searchBarInsets = WindowInsets( top = if (config.searchBarPosition == SearchBarPosition.Top) searchBarHeight + 8.dp else 8.dp, - bottom = (if (config.searchBarPosition == SearchBarPosition.Bottom) searchBarHeight + 8.dp else 8.dp) + - filterBarHeight + bottom = if (config.searchBarPosition == SearchBarPosition.Bottom) searchBarHeight + 8.dp else 8.dp ) val filterBarInsets = WindowInsets( bottom = filterBarHeight ) - val insets = systemBarInsets.add(searchBarInsets).add(filterBarInsets) - config.homeComponent.Component( Modifier .fillMaxSize() @@ -1424,12 +1421,12 @@ internal fun LauncherScaffold( } ), insets = systemBarInsets + .let { if (config.homeComponent.hasIme) it.union(WindowInsets.ime) else it } .let { if (config.searchBarStyle == SearchBarStyle.Hidden) it else it.add( searchBarInsets ) } - .let { if (config.homeComponent.hasIme) it.union(WindowInsets.ime) else it } .asPaddingValues(), state ) @@ -1439,8 +1436,9 @@ internal fun LauncherScaffold( config = config, modifier = Modifier .fillMaxSize(), - insets = insets + insets = systemBarInsets .let { if (state.currentComponent?.hasIme == true) it.union(WindowInsets.ime) else it } + .add(searchBarInsets).add(filterBarInsets) .asPaddingValues(), )