Search code examples
androidchrome-custom-tabs

Chrome custom tab secondary color


I'm using Chrome custom tab in my app. There an intent extra to set the secondary toolbar color called EXTRA_SECONDARY_TOOLBAR_COLOR, however I can't see where this color is actually used in Chrome tab. The only color I see is the primary color.


Solution

  • This is used to set the color for the secondary toolbar, also known as the bottom toolbar (see CustomTabsIntent.Builder#addToolbarItem).

    Since API level 24.1.0, this method of adding items for adding items to the bottom toolbar has been deprecated in favor of using RemoteViews, where you define the style in your app. Check CustomTabsIntent.Builder#setSecondaryToolbarViews for more information. There's an example on how to use it on the Github sample as well.