Android APIs
public static final class

CustomTabsIntent.Builder

extends Object
java.lang.Object
   ↳ android.support.customtabs.CustomTabsIntent.Builder

Class Overview

Builder class for CustomTabsIntent objects.

Summary

Public Constructors
CustomTabsIntent.Builder()
Creates a CustomTabsIntent.Builder object associated with no CustomTabsSession.
CustomTabsIntent.Builder(CustomTabsSession session)
Creates a CustomTabsIntent.Builder object associated with a given CustomTabsSession.
Public Methods
CustomTabsIntent.Builder addMenuItem(String label, PendingIntent pendingIntent)
Adds a menu item.
CustomTabsIntent build()
Combines all the options that have been set and returns a new CustomTabsIntent object.
CustomTabsIntent.Builder setActionButton(Bitmap icon, String description, PendingIntent pendingIntent)
Set the action button.
CustomTabsIntent.Builder setCloseButtonIcon(Bitmap icon)
Sets the Close button icon for the custom tab.
CustomTabsIntent.Builder setExitAnimations(Context context, int enterResId, int exitResId)
Sets the exit animations,
CustomTabsIntent.Builder setShowTitle(boolean showTitle)
Sets whether the title should be shown in the custom tab.
CustomTabsIntent.Builder setStartAnimations(Context context, int enterResId, int exitResId)
Sets the start animations,
CustomTabsIntent.Builder setToolbarColor(int color)
Sets the toolbar color.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CustomTabsIntent.Builder ()

Creates a CustomTabsIntent.Builder object associated with no CustomTabsSession.

public CustomTabsIntent.Builder (CustomTabsSession session)

Creates a CustomTabsIntent.Builder object associated with a given CustomTabsSession. Guarantees that the Intent will be sent to the same component as the one the session is associated with.

Parameters
session The session to associate this Builder with.

Public Methods

public CustomTabsIntent.Builder addMenuItem (String label, PendingIntent pendingIntent)

Adds a menu item.

Parameters
label Menu label.
pendingIntent Pending intent delivered when the menu item is clicked.

public CustomTabsIntent build ()

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

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

Set the action button.

Parameters
icon The icon.
description The description for the button. To be used for accessibility.
pendingIntent pending intent delivered when the button is clicked.

public CustomTabsIntent.Builder setCloseButtonIcon (Bitmap icon)

Sets the Close button icon for the custom tab.

Parameters
icon The icon Bitmap

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

Sets the exit animations,

Parameters
context Application context.
enterResId Resource ID of the "enter" animation for the application.
exitResId Resource ID of the "exit" animation for the browser.

public CustomTabsIntent.Builder setShowTitle (boolean showTitle)

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

Parameters
showTitle Whether the title should be shown.

public CustomTabsIntent.Builder setStartAnimations (Context context, int enterResId, int exitResId)

Sets the start animations,

Parameters
context Application context.
enterResId Resource ID of the "enter" animation for the browser.
exitResId Resource ID of the "exit" animation for the application.

public CustomTabsIntent.Builder setToolbarColor (int color)

Sets the toolbar color.

Parameters
color Color