TrustedWebActivity

object TrustedWebActivity

A trusted web activity.

Based on https://developer.chrome.com/docs/android/trusted-web-activity.

Types

Link copied to clipboard
data class Request(    val context: Context,     val url: String,     val screenOrientation: Int? = null,     val splashScreen: TrustedWebActivity.SplashScreen? = null)

A trusted web activity launch request.

Link copied to clipboard
data class SplashScreen(    val imageRef: TrustedWebActivityImageRef?,     val imageScaleType: ImageView.ScaleType = ImageView.ScaleType.FIT_CENTER,     @ColorInt val backgroundColor: Int? = null,     val fadeOutTimeInMillis: Int = 300)

Holds information about the splash screen for a trusted web activity.

Functions

Link copied to clipboard
fun launch(request: TrustedWebActivity.Request)

Starts up a trusted web activity launch flow.

Link copied to clipboard
fun notifyOnCustomTabsSessionCreated(customTabsSession: CustomTabsSession)

Must be invoked each time a new custom tabs session is created.

Link copied to clipboard
fun notifyOnDestroy(ignorePending: Boolean = false)

Must be invoked each time all of the trusted web activities need to be destroyed (e.g. parent activity gets destroyed).

Link copied to clipboard
fun notifyOnEnterAnimationComplete()

Must be invoked when the parent activity finishes its "appear" animation.

Sources

Link copied to clipboard