From 660f0609cbc5a1cdca65a3461240a189a723cd46 Mon Sep 17 00:00:00 2001 From: Mugurell Date: Tue, 30 Mar 2021 12:47:35 +0300 Subject: [PATCH] For #18122 - Update browser layout for find in page bar with bottom toolbar With a dynamic bottom toolbar the browser extends all the way to the bottom of the screen and so when the find in page bar is shown it will be so above the bottom part of the browser which may contain exactly the searched for items. To fix the browser must effectively be placed at the top of the newly shown find in page bar. --- .../org/mozilla/fenix/components/FindInPageIntegration.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/org/mozilla/fenix/components/FindInPageIntegration.kt b/app/src/main/java/org/mozilla/fenix/components/FindInPageIntegration.kt index bf3f6cab5a51..642e65a41f9b 100644 --- a/app/src/main/java/org/mozilla/fenix/components/FindInPageIntegration.kt +++ b/app/src/main/java/org/mozilla/fenix/components/FindInPageIntegration.kt @@ -67,6 +67,10 @@ class FindInPageIntegration( } else { engineViewParent.translationY = 0f } + } else { + if (toolbarInfo.isToolbarDynamic) { + engineViewParentParams.bottomMargin = 0 + } } } @@ -86,6 +90,10 @@ class FindInPageIntegration( // With a fixed toolbar the EngineView is anchored below the toolbar with 0 Y translation. engineViewParent.translationY = -toolbarInfo.toolbar.height.toFloat() } + } else { + // With a bottom toolbar the EngineView is already anchored to the top of the screen. + // Need just to ensure space for the find in page bar under the engineView. + engineViewParentParams.bottomMargin = toolbarInfo.toolbar.height } }