Android 12 Developer Preview is here! Try it out, and give us your feedback!

TrustedWebActivityIntentBuilder

open class TrustedWebActivityIntentBuilder
kotlin.Any
   ↳ androidx.browser.trusted.TrustedWebActivityIntentBuilder

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

Summary

Constants
static String

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.

static String

Extra for the TrustedWebActivityDisplayMode, see setDisplayMode.

static String

Extra for the screenOrientation, see setScreenOrientation.

static String

Extra for the share data, see setShareParams.

static String

Extra for the share target, see setShareParams.

static String

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
<init>(@NonNull uri: Uri)

Creates a Builder given the required parameters.

Public methods
open TrustedWebActivityIntent
build(@NonNull session: CustomTabsSession)

Builds an instance of session

open CustomTabsIntent

Builds a CustomTabsIntent based on provided parameters.

open TrustedWebActivityDisplayMode

Returns TrustedWebActivityDisplayMode set on this Builder.

open Uri

Returns the Uri to be launched with this Builder.

open TrustedWebActivityIntentBuilder

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

open TrustedWebActivityIntentBuilder
setColorScheme(colorScheme: Int)

Sets the color scheme, see CustomTabsIntent.Builder#setColorScheme.

open TrustedWebActivityIntentBuilder
setColorSchemeParams(colorScheme: Int, @NonNull params: CustomTabColorSchemeParams)

Sets CustomTabColorSchemeParams for the given color scheme.

open TrustedWebActivityIntentBuilder

Sets the default CustomTabColorSchemeParams.

open TrustedWebActivityIntentBuilder

Sets a TrustedWebActivityDisplayMode.

open TrustedWebActivityIntentBuilder
setNavigationBarColor(@ColorInt color: Int)

Sets the navigation bar color, see CustomTabsIntent.Builder#setNavigationBarColor.

open TrustedWebActivityIntentBuilder

Sets the navigation bar divider color, see CustomTabsIntent.Builder#setNavigationBarDividerColor.

open TrustedWebActivityIntentBuilder
setScreenOrientation(orientation: Int)

Sets a screenOrientation.

open TrustedWebActivityIntentBuilder
setShareParams(@NonNull shareTarget: ShareTarget, @NonNull shareData: ShareData)

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

open TrustedWebActivityIntentBuilder
setSplashScreenParams(@NonNull splashScreenParams: Bundle)

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

open TrustedWebActivityIntentBuilder
setToolbarColor(@ColorInt color: Int)

Sets the color applied to the toolbar and the status bar, see CustomTabsIntent.Builder#setToolbarColor.

Constants

EXTRA_ADDITIONAL_TRUSTED_ORIGINS

static val EXTRA_ADDITIONAL_TRUSTED_ORIGINS: String

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. It is recommended to use TrustedWebActivityIntentBuilder instead of manually piecing the Intent together.

Value: "android.support.customtabs.extra.ADDITIONAL_TRUSTED_ORIGINS"

EXTRA_DISPLAY_MODE

static val EXTRA_DISPLAY_MODE: String

Extra for the TrustedWebActivityDisplayMode, see setDisplayMode.

Value: "androidx.browser.trusted.extra.DISPLAY_MODE"

EXTRA_SCREEN_ORIENTATION

static val EXTRA_SCREEN_ORIENTATION: String

Extra for the screenOrientation, see setScreenOrientation.

Value: "androidx.browser.trusted.extra.SCREEN_ORIENTATION"