android-components / mozilla.components.feature.pwa.feature / WebAppHideToolbarFeature

WebAppHideToolbarFeature

class WebAppHideToolbarFeature : LifecycleAwareFeature (source)

Hides a custom tab toolbar for Progressive Web Apps and Trusted Web Activities.

When the Session is inside a trusted scope, the toolbar will be hidden. Once the Session navigates to another scope, the toolbar will be revealed. The toolbar is also hidden in fullscreen mode or picture in picture mode.

In standard custom tabs, no scopes are trusted. As a result the URL has no impact on toolbar visibility.

Parameters

store - Reference to the browser store where tab state is located.

customTabsStore - Reference to the store that communicates with the custom tabs service.

tabId - ID of the tab session, or null if the selected session should be used.

manifest - Reference to the cached WebAppManifest for the current PWA. Null if this feature is not used in a PWA context.

setToolbarVisibility - Callback to show or hide the toolbar.

Constructors

Name Summary
<init> WebAppHideToolbarFeature(store: BrowserStore, customTabsStore: CustomTabsServiceStore, tabId: String? = null, manifest: WebAppManifest? = null, setToolbarVisibility: (Boolean) -> Unit)
Hides a custom tab toolbar for Progressive Web Apps and Trusted Web Activities.

Functions

Name Summary
start fun start(): Unit
stop fun stop(): Unit

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.