CustomTabsIntent.Builder

public static final class CustomTabsIntent.Builder
extends Object

java.lang.Object
   ↳ androidx.browser.customtabs.CustomTabsIntent.Builder


Builder class for CustomTabsIntent objects.

Summary

Public constructors

Builder()

Creates a CustomTabsIntent.Builder object associated with no CustomTabsSession.

Builder(CustomTabsSession session)

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

Public methods

CustomTabsIntent.Builder addDefaultShareMenuItem()

This method is deprecated. Use setShareState(int) instead. This will set the share state to CustomTabsIntent.SHARE_STATE_ON.

CustomTabsIntent.Builder addMenuItem(String label, PendingIntent pendingIntent)

Adds a menu item.

CustomTabsIntent.Builder addToolbarItem(int id, Bitmap icon, String description, PendingIntent pendingIntent)

This method is deprecated. Use CustomTabsIntent.Builder#setSecondaryToolbarViews(RemoteViews, int[], PendingIntent).

CustomTabsIntent build()

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

CustomTabsIntent.Builder enableUrlBarHiding()

This method is deprecated. Use setUrlBarHidingEnabled(boolean) instead.

CustomTabsIntent.Builder setActionButton(Bitmap icon, String description, PendingIntent pendingIntent, boolean shouldTint)

Sets the action button that is displayed in the Toolbar.

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

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

CustomTabsIntent.Builder setCloseButtonIcon(Bitmap icon)

Sets the Close button icon for the custom tab.

CustomTabsIntent.Builder setColorScheme(int colorScheme)

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

CustomTabsIntent.Builder setColorSchemeParams(int colorScheme, CustomTabColorSchemeParams params)

Sets CustomTabColorSchemeParams for the given color scheme.

CustomTabsIntent.Builder setDefaultColorSchemeParams(CustomTabColorSchemeParams params)

Sets the default CustomTabColorSchemeParams.

CustomTabsIntent.Builder setDefaultShareMenuItemEnabled(boolean enabled)

This method is deprecated. Use setShareState(int) instead. This will set the share state to CustomTabsIntent.SHARE_STATE_ON or CustomTabsIntent.SHARE_STATE_OFF based on enabled.

CustomTabsIntent.Builder setExitAnimations(Context context, int enterResId, int exitResId)

Sets the exit animations.

CustomTabsIntent.Builder setInstantAppsEnabled(boolean enabled)

Sets whether Instant Apps is enabled for this Custom Tab.

CustomTabsIntent.Builder setNavigationBarColor(int color)

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

CustomTabsIntent.Builder setNavigationBarDividerColor(int color)

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

CustomTabsIntent.Builder setSecondaryToolbarColor(int color)

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

CustomTabsIntent.Builder setSecondaryToolbarViews(RemoteViews remoteViews, int[] clickableIDs, PendingIntent pendingIntent)

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

CustomTabsIntent.Builder setSession(CustomTabsSession session)

Associates the Intent with the given CustomTabsSession.

CustomTabsIntent.Builder setShareState(int shareState)

Sets the share state that should be applied to the custom tab.

CustomTabsIntent.Builder setShowTitle(boolean showTitle)

Sets whether the title should be shown in the custom tab.