TrustedWebActivityIntentBuilder

public class TrustedWebActivityIntentBuilder
extends Object

java.lang.Object
   ↳ androidx.browser.trusted.TrustedWebActivityIntentBuilder


Constructs instances of TrustedWebActivityIntent that can be used to start Trusted Web Activities (see TrustedWebUtils for more details).

Summary

Constants

String EXTRA_ADDITIONAL_TRUSTED_ORIGINS

Extra for the Trusted Web Activity launch Intent to specify a list of origins for the browser to treat as trusted, in addition to the origin of the launching URL.

String EXTRA_DISPLAY_MODE

Extra for the TrustedWebActivityDisplayMode, see setDisplayMode(TrustedWebActivityDisplayMode).

String EXTRA_SCREEN_ORIENTATION

Extra for the screenOrientation, see setScreenOrientation(int).

String EXTRA_SHARE_DATA

Extra for the share data, see setShareParams(ShareTarget, ShareData).

String EXTRA_SHARE_TARGET

Extra for the share target, see setShareParams(ShareTarget, ShareData).

String EXTRA_SPLASH_SCREEN_PARAMS

Extra for the Trusted Web Activity launch Intent to specify a Bundle of parameters for the browser to use in constructing a splash screen.

Public constructors

TrustedWebActivityIntentBuilder(Uri uri)

Creates a Builder given the required parameters.

Public methods

TrustedWebActivityIntent build(CustomTabsSession session)

Builds an instance of TrustedWebActivityIntent.

CustomTabsIntent buildCustomTabsIntent()

Builds a CustomTabsIntent based on provided parameters.

TrustedWebActivityDisplayMode getDisplayMode()

Returns TrustedWebActivityDisplayMode set on this Builder.

Uri getUri()

Returns the Uri to be launched with this Builder.

TrustedWebActivityIntentBuilder setAdditionalTrustedOrigins(List<String> origins)

Sets a list of additional trusted origins that the user may navigate or be redirected to from the starting uri.

TrustedWebActivityIntentBuilder setColorScheme(int colorScheme)

Sets the color scheme, see CustomTabsIntent.Builder.setColorScheme(int).

TrustedWebActivityIntentBuilder setColorSchemeParams(int colorScheme, CustomTabColorSchemeParams params)

Sets CustomTabColorSchemeParams for the given color scheme.

TrustedWebActivityIntentBuilder setDefaultColorSchemeParams(CustomTabColorSchemeParams params)

Sets the default CustomTabColorSchemeParams.

TrustedWebActivityIntentBuilder setDisplayMode(TrustedWebActivityDisplayMode displayMode)

Sets a TrustedWebActivityDisplayMode.

TrustedWebActivityIntentBuilder setNavigationBarColor(int color)

This method is deprecated. Use setDefaultColorSchemeParams(CustomTabColorSchemeParams) instead.

TrustedWebActivityIntentBuilder setNavigationBarDividerColor(int color)

This method is deprecated. Use setDefaultColorSchemeParams(CustomTabColorSchemeParams) instead.

TrustedWebActivityIntentBuilder setScreenOrientation(int orientation)

Sets a screenOrientation.

TrustedWebActivityIntentBuilder setShareParams(ShareTarget shareTarget, ShareData shareData)

Sets the parameters for delivering data to a Web Share Target via a Trusted Web Activity.

TrustedWebActivityIntentBuilder setSplashScreenParams(Bundle splashScreenParams)

Sets the parameters of a splash screen shown while the web page is loading, such as background color.

TrustedWebActivityIntentBuilder setToolbarColor(int color)

This method is deprecated. Use setDefaultColorSchemeParams(CustomTabColorSchemeParams) instead.

Inherited methods

Constants

EXTRA_ADDITIONAL_TRUSTED_ORIGINS

public static final String EXTRA_ADDITIONAL_TRUSTED_ORIGINS

Extra for the Trusted Web Activity launch Int