From 9e876ebc44fa6c5688b84e7d2ef661cfea5d2cc9 Mon Sep 17 00:00:00 2001 From: ekager Date: Fri, 18 Sep 2020 12:47:52 -0700 Subject: [PATCH] For #14982 - Show snackbars with padding with static bottom toolbar --- .../main/java/org/mozilla/fenix/components/FenixSnackbar.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/mozilla/fenix/components/FenixSnackbar.kt b/app/src/main/java/org/mozilla/fenix/components/FenixSnackbar.kt index 8083a2b17..0cf872a25 100644 --- a/app/src/main/java/org/mozilla/fenix/components/FenixSnackbar.kt +++ b/app/src/main/java/org/mozilla/fenix/components/FenixSnackbar.kt @@ -120,6 +120,7 @@ class FenixSnackbar private constructor( val callback = FenixSnackbarCallback(content) val shouldUseBottomToolbar = view.context.settings().shouldUseBottomToolbar val toolbarHeight = view.resources.getDimensionPixelSize(R.dimen.browser_toolbar_height) + val dynamicToolbarEnabled = view.context.settings().isDynamicToolbarEnabled return FenixSnackbar(parent, content, callback, isError).also { it.duration = durationOrAccessibleDuration @@ -133,7 +134,7 @@ class FenixSnackbar private constructor( // can't intelligently position the snackbar on the upper most view. // Ideally we should not pass ContentFrameLayout in, but it's the only // way to display snackbars through a fragment transition. - view is ContentFrameLayout + (view is ContentFrameLayout || !dynamicToolbarEnabled) ) { toolbarHeight } else {