From 4a29c49fb782a25e603bd40c9e5d168b045848ad Mon Sep 17 00:00:00 2001 From: mcarare Date: Thu, 17 Sep 2020 13:54:28 +0300 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/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) }