Google 致力于为黑人社区推动种族平等。查看具体举措

Builder

class Builder
kotlin.Any
   ↳ androidx.browser.customtabs.CustomTabsIntent.Builder

Builder class for CustomTabsIntent objects.

Summary

Public constructors

Creates a CustomTabsIntent.Builder object associated with no CustomTabsSession.

<init>(@Nullable session: CustomTabsSession?)

Creates a CustomTabsIntent.Builder object associated with a given CustomTabsSession.

Public methods
CustomTabsIntent.Builder

Adds a default share item to the menu.

CustomTabsIntent.Builder
addMenuItem(@NonNull label: String, @NonNull pendingIntent: PendingIntent)

Adds a menu item.

CustomTabsIntent.Builder
addToolbarItem(id: Int, @NonNull icon: Bitmap, @NonNull description: String, @NonNull pendingIntent: PendingIntent)

Adds an action button to the custom tab.

CustomTabsIntent

Combines all the options that have been set and returns a new CustomTabsIntent object.

CustomTabsIntent.Builder

Enables the url bar to hide as the user scrolls down on the page.

CustomTabsIntent.Builder
setActionButton(@NonNull icon: Bitmap, @NonNull description: String, @NonNull pendingIntent: PendingIntent, shouldTint: Boolean)

Sets the action button that is displayed in the Toolbar.

CustomTabsIntent.Builder
setActionButton(@NonNull icon: Bitmap, @NonNull description: String, @NonNull pendingIntent: PendingIntent)

Sets the action button that is displayed in the Toolbar with default tinting behavior.

CustomTabsIntent.Builder
setCloseButtonIcon(@NonNull icon: Bitmap)

Sets the Close button icon for the custom tab.

CustomTabsIntent.Builder
setColorScheme(colorScheme: Int)

Sets the color scheme that should be applied to the user interface in the custom tab.

CustomTabsIntent.Builder
setColorSchemeParams(colorScheme: Int, @NonNull params: CustomTabColorSchemeParams)

Sets CustomTabColorSchemeParams for the given color scheme.

CustomTabsIntent.Builder

Sets the default CustomTabColorSchemeParams.

CustomTabsIntent.Builder

Set whether a default share item is added to the menu.

CustomTabsIntent.Builder
setExitAnimations(@NonNull context: Context, @AnimRes enterResId: Int, @AnimRes exitResId: Int)

Sets the exit animations.

CustomTabsIntent.Builder

Sets whether Instant Apps is enabled for this Custom Tab.

CustomTabsIntent.Builder
setNavigationBarColor(@ColorInt color: Int)

Sets the navigation bar color.

CustomTabsIntent.Builder

Sets the navigation bar divider color.

CustomTabsIntent.Builder
setSecondaryToolbarColor(@ColorInt color: Int)

Sets the color of the secondary toolbar.

CustomTabsIntent.Builder
setSecondaryToolbarViews(@NonNull remoteViews: RemoteViews, @Nullable clickableIDs: IntArray?, @Nullable pendingIntent: PendingIntent?)

Sets the remote views displayed in the secondary toolbar in a custom tab.

CustomTabsIntent.Builder
setSession(@NonNull session: CustomTabsSession)

Associates the Intent<