java.lang.Object | |
↳ | android.support.customtabs.CustomTabsIntent |
Class holding the Intent
and start bundle for a Custom Tabs Activity.
Note: The constants below are public for the browser implementation's benefit.
You are strongly encouraged to use CustomTabsIntent.Builder
.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CustomTabsIntent.Builder |
Builder class for CustomTabsIntent objects.
|
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | EXTRA_ACTION_BUTTON_BUNDLE | Bundle used for adding a custom action button to the custom tab toolbar. | |||||||||
String | EXTRA_CLOSE_BUTTON_ICON | Extra bitmap that specifies the icon of the back button on the toolbar. | |||||||||
String | EXTRA_EXIT_ANIMATION_BUNDLE |
Bundle constructed out of ActivityOptions that will be running when the
Activity that holds the custom tab gets finished.
|
|||||||||
String | EXTRA_MENU_ITEMS |
Use an ArrayList for specifying menu related params.
|
|||||||||
String | EXTRA_SESSION | Extra used to match the session. | |||||||||
String | EXTRA_TITLE_VISIBILITY_STATE | Extra (int) that specifies state for showing the page title. | |||||||||
String | EXTRA_TOOLBAR_COLOR | Extra that changes the background color for the toolbar. | |||||||||
String | KEY_DESCRIPTION | Key that specifies the content description for the custom action button. | |||||||||
String | KEY_ICON |
Key that specifies the Bitmap to be used as the image source for the action button.
|
|||||||||
String | KEY_MENU_ITEM_TITLE | Key for specifying the title of a menu item. | |||||||||
String | KEY_PENDING_INTENT | Key that specifies the PendingIntent to launch when the action button or menu item was clicked. | |||||||||
int | NO_TITLE | Don't show any title. | |||||||||
int | SHOW_PAGE_TITLE | Shows the page title and the domain. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
intent |
An Intent used to start the Custom Tabs Activity.
|
||||||||||
startAnimationBundle |
A Bundle containing the start animation for the Custom Tabs Activity.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Convenience method to launch a Custom Tabs Activity.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Bundle used for adding a custom action button to the custom tab toolbar. The client should
provide a description, an icon Bitmap
and a PendingIntent
for the button.
All three keys must be present.
Extra bitmap that specifies the icon of the back button on the toolbar. If the client chooses not to customize it, a default close button will be used.
Bundle constructed out of ActivityOptions
that will be running when the
Activity
that holds the custom tab gets finished. A similar ActivityOptions
for creation should be constructed and given to the startActivity() call that
launches the custom tab.
Use an ArrayList
for specifying menu related params. There should be a
separate Bundle
for each custom menu item.
Extra used to match the session. This has to be included in the intent to open in a custom tab. This is the same IBinder that gets passed to ICustomTabsService#newSession. Null if there is no need to match any service side sessions with the intent.
Extra (int) that specifies state for showing the page title. Default is NO_TITLE
.
Extra that changes the background color for the toolbar. colorRes is an int that specifies a
Color
, not a resource id.
Key that specifies the content description for the custom action button.
Key that specifies the Bitmap
to be used as the image source for the action button.
The icon should't be more than 24dp in height (No padding needed. The button itself will be
48dp in height) and have a width/height ratio of less than 2.
Key for specifying the title of a menu item.
Key that specifies the PendingIntent to launch when the action button or menu item was
clicked. The custom tab will be calling send()
on clicks after adding
the url as data. The client app can call getDataString()
to get the url.
Don't show any title. Shows only the domain.
Shows the page title and the domain.
A Bundle
containing the start animation for the Custom Tabs Activity.
Convenience method to launch a Custom Tabs Activity.
context | The source Activity. |
---|---|
url | The URL to load in the Custom Tab. |