Browser support

Patrick Kettner
Patrick Kettner

Custom Tabs are a great option for creating a customized browser experience directly within your app, but they are not a singular thing. Built on top of the Intent system, Custom Tabs are a collection of configurable option requests that are sent to the end user's preferred browser. It is up to each browser to implement the various options. The availability of Custom Tabs features can vary between Android browsers due to implementation differences.

What follows is a comparison of some browsers in the Android ecosystem. A vast majority of browsers on Android have some level of support. The tables are not not meant to be exhaustive, but illustrative of the level of support you are likely to see. You should research the default browsers of the people using your app, and make sure you are coding defensively.

CustomTabsIntent.Builder

CustomTabsIntent.Builder creates Custom Tabs. You have a number of ways to configure your custom tab to help it blend as seamlessly as possible with your app via a collection of built in methods, which are listed below.

addDefaultShareMenuItem()

addDefaultShareMenuItem() adds a default share button to the Custom Tabs toolbar, allowing the user to share the current web page via various apps on their device.

addMenuItem()

Adds a menu item.

On the left, a phone showing an app using addMenuItem(), and on the right a separate phone without the API

addToolbarItem()

Adds an action button to the custom tab. Multiple buttons can be added via this method.

enableUrlBarHiding()

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

setActionButton()

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

On the left, a phone showing an app using setActionButton()(), and on the right a separate phone without the API

setCloseButtonIcon()

Sets custom close button that is displayed in the toolbar.

On the left, a phone showing an app using setCloseButtonIcon(), and on the right a separate phone without the API

setCloseButtonPosition()

Sets the Close button icon for the custom tab.

On the left, a phone showing an app using setCloseButtonPosition(), and on the right a separate phone without the API

setColorScheme()

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

On the left, a phone showing an app using setColorScheme(), and on the right a separate phone without the API

setColorSchemeParams()

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

On the left, a phone showing an app using setColorSchemeParams(), and on the right a separate phone without the API

setDefaultColorSchemeParams()

Sets CustomTabColorSchemeParams() for the given color scheme. This allows specifying two different toolbar colors for light and dark schemes.

On the left, a phone showing an app using setDefaultColorSchemeParams(), and on the right a separate phone without the API

setDefaultShareMenuItemEnabled()

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

setExitAnimations()

Sets any exit animations.

setInitialActivityHeightPx()

Sets the Custom Tab Activity's initial height in pixels with default resize behavior. The Custom Tab will behave as a bottom sheet. This is often referred to as a partial Custom Tab.

On the left, a phone showing an app using setInitialActivityHeightPx(), and on the right a separate phone without the API

setNavigationBarColor()

Sets the navigation bar color. Has no effect on API versions below L.

setNavigationBarDividerColor()

setSecondaryToolbarColor()

Sets the color of the secondary toolbar.

setShareState()

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

On the left, a phone showing an app using setShareState(), and on the right a separate phone without the API

setShowTitle()

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

On the left, a phone showing an app using setShowTitle(), and on the right a separate phone without the API

setStartAnimations()

Sets the start animations.

setToolbarColor()

Sets the toolbar color. On Android L and above, this color is also applied to the status bar.

setToolbarCornerRadiusDp()

Sets the toolbar's top corner radii in dp.

setUrlBarHidingEnabled()

Set whether the url bar should hide as the user scrolls down on the page.

CustomTabsClient

CustomTabsClient is an optional class to communicate with a CustomTabsService and create CustomTabsSession from it.

warmup()

Warm up the browser process.

CustomTabsSession

CustomTabsSession is an optional class you can provide to an instance of CustomTabsIntent.Builder(). When used, you can use this class to handle any communication with the Custom Tab.

setEngagementSignalsCallback()

Sets an EngagementSignalsCallback to receive callbacks for events related to the user's engagement with webpage within the tab.

isEngagementSignalsApiAvailable()

Returns whether the Engagement Signals API is available. The availability of the Engagement Signals API may change at runtime.

mayLaunchUrl()

Tells the browser of a likely future navigation to a URL. The most likely URL has to be specified first. Optionally, a list of other likely URLs can be provided. They are treated as less likely than the first one, and have to be sorted in decreasing priority order. These additional URLs may be ignored. All previous calls to this method will be deprioritized.