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


class WebAppHideToolbarFeature : Observer, 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.


toolbar - Toolbar to show or hide.

sessionId - ID of the custom tab session.

trustedScopes - Scopes to hide the toolbar at. Scopes correspond to WebAppManifest.scope. They can be a path (PWA) or just an origin (TWA).

onToolbarVisibilityChange - Called when the toolbar is changed to be visible or hidden.


Name Summary
<init> WebAppHideToolbarFeature(sessionManager: SessionManager, toolbar: <ERROR CLASS>, sessionId: String, trustedScopes: List<<ERROR CLASS>>, onToolbarVisibilityChange: (visible: Boolean) -> Unit = {})
Hides a custom tab toolbar for Progressive Web Apps and Trusted Web Activities.


Name Summary
onTrustedScopesChange fun onTrustedScopesChange(trustedScopes: List<<ERROR CLASS>>): Unit
Hides or reveals the toolbar when the list of trusted scopes is changed.
onUrlChanged fun onUrlChanged(session: Session, url: String): Unit
Hides or reveals the toolbar when the session navigates to a new URL.
start fun start(): Unit
stop fun stop(): Unit

Inherited Functions

Name Summary
onAppPermissionRequested open fun onAppPermissionRequested(session: Session, permissionRequest: PermissionRequest): Boolean
onContentPermissionRequested open fun onContentPermissionRequested(session: Session, permissionRequest: PermissionRequest): Boolean
onCrashStateChanged open fun onCrashStateChanged(session: Session, crashed: Boolean): Unit
onCustomTabConfigChanged open fun onCustomTabConfigChanged(session: Session, customTabConfig: CustomTabConfig?): Unit
onDesktopModeChanged open fun onDesktopModeChanged(session: Session, enabled: Boolean): Unit
onFindResult open fun onFindResult(session: Session, result: FindResult): Unit
onFullScreenChanged open fun onFullScreenChanged(session: Session, enabled: Boolean): Unit
onIconChanged open fun onIconChanged(session: Session, icon: <ERROR CLASS>?): Unit
onLaunchIntentRequest open fun onLaunchIntentRequest(session: Session, url: String, appIntent: <ERROR CLASS>?): Unit
onLoadRequest open fun onLoadRequest(session: Session, url: String, triggeredByRedirect: Boolean, triggeredByWebContent: Boolean): Unit
onLoadingStateChanged open fun onLoadingStateChanged(session: Session, loading: Boolean): Unit
onLongPress open fun onLongPress(session: Session, hitResult: HitResult): Boolean
onMediaAdded open fun onMediaAdded(session: Session, media: List<Media>, added: Media): Unit
onMediaRemoved open fun onMediaRemoved(session: Session, media: List<Media>, removed: Media): Unit
onNavigationStateChanged open fun onNavigationStateChanged(session: Session, canGoBack: Boolean, canGoForward: Boolean): Unit
onProgress open fun onProgress(session: Session, progress: Int): Unit
onReaderModeChanged open fun onReaderModeChanged(session: Session, enabled: Boolean): Unit
onReaderableStateUpdated open fun onReaderableStateUpdated(session: Session, readerable: Boolean): Unit
onRecordingDevicesChanged open fun onRecordingDevicesChanged(session: Session, devices: List<RecordingDevice>): Unit
onSearch open fun onSearch(session: Session, searchTerms: String): Unit
onSecurityChanged open fun onSecurityChanged(session: Session, securityInfo: SecurityInfo): Unit
onThumbnailChanged open fun onThumbnailChanged(session: Session, bitmap: <ERROR CLASS>?): Unit
onTitleChanged open fun onTitleChanged(session: Session, title: String): Unit
onTrackerBlocked open fun onTrackerBlocked(session: Session, tracker: Tracker, all: List<Tracker>): Unit
onTrackerBlockingEnabledChanged open fun onTrackerBlockingEnabledChanged(session: Session, blockingEnabled: Boolean): Unit
onTrackerLoaded open fun onTrackerLoaded(session: Session, tracker: Tracker, all: List<Tracker>): Unit
onWebAppManifestChanged open fun onWebAppManifestChanged(session: Session, manifest: WebAppManifest?): 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.