From e5a93116135ba5fb3589a7c1a9bf68ab2c2d5af9 Mon Sep 17 00:00:00 2001 From: mcarare Date: Thu, 17 Sep 2020 13:54:28 +0300 Subject: [PATCH] For #15116: Also do not expand or set bottom toolbar behavior on TWA tabs. --- .../fenix/components/toolbar/BrowserToolbarView.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarView.kt b/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarView.kt index 89532e2a06..45af4648aa 100644 --- a/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarView.kt +++ b/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarView.kt @@ -78,8 +78,9 @@ class BrowserToolbarView( val toolbarIntegration: ToolbarIntegration - private val isPwaTab: Boolean - get() = customTabSession?.customTabConfig?.externalAppType == ExternalAppType.PROGRESSIVE_WEB_APP + private val isPwaTabOrTwaTab: Boolean + get() = customTabSession?.customTabConfig?.externalAppType == ExternalAppType.PROGRESSIVE_WEB_APP || + customTabSession?.customTabConfig?.externalAppType == ExternalAppType.TRUSTED_WEB_ACTIVITY init { val isCustomTabSession = customTabSession != null @@ -212,8 +213,8 @@ class BrowserToolbarView( } fun expand() { - // expand only for normal tabs and custom tabs not for PWA - if (isPwaTab) { + // expand only for normal tabs and custom tabs not for PWA or TWA + if (isPwaTabOrTwaTab) { return } when (settings.toolbarPosition) { @@ -237,7 +238,7 @@ class BrowserToolbarView( fun setScrollFlags(shouldDisableScroll: Boolean = false) { when (settings.toolbarPosition) { ToolbarPosition.BOTTOM -> { - if (settings.isDynamicToolbarEnabled && !isPwaTab) { + if (settings.isDynamicToolbarEnabled && !isPwaTabOrTwaTab) { (view.layoutParams as? CoordinatorLayout.LayoutParams)?.apply { behavior = BrowserToolbarBottomBehavior(view.context, null) }