From 48546c3db46f336f6aa72d07ccbe911f086c14d7 Mon Sep 17 00:00:00 2001 From: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> Date: Wed, 8 Feb 2023 21:37:12 +0700 Subject: [PATCH] Scaffold: Fix snackbar bottom inset (#9052) (cherry picked from commit 34a586ce48d6c10ac9eadb697b955ba336044bc2) --- .../java/eu/kanade/presentation/components/Scaffold.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/components/Scaffold.kt b/app/src/main/java/eu/kanade/presentation/components/Scaffold.kt index 0475444878..aa76cd92e3 100644 --- a/app/src/main/java/eu/kanade/presentation/components/Scaffold.kt +++ b/app/src/main/java/eu/kanade/presentation/components/Scaffold.kt @@ -240,13 +240,16 @@ private fun ScaffoldLayout( ) }.fastMap { it.measure(looseConstraints) } - val bottomBarHeight = bottomBarPlaceables.fastMaxBy { it.height }?.height + val bottomBarHeight = bottomBarPlaceables + .fastMaxBy { it.height } + ?.height + ?.takeIf { it != 0 } val fabOffsetFromBottom = fabPlacement?.let { max(bottomBarHeight ?: 0, bottomInset) + it.height + FabSpacing.roundToPx() } val snackbarOffsetFromBottom = if (snackbarHeight != 0) { - snackbarHeight + (fabOffsetFromBottom ?: bottomBarHeight ?: bottomInset) + snackbarHeight + (fabOffsetFromBottom ?: max(bottomBarHeight ?: 0, bottomInset)) } else { 0 }