ChromeCustomTab

Last Updated On 2021-07-16

Version 1MinSDK 15Tutorial Video

Chrome Custom Tabs give apps more control over their web experience, and make transitions between native and web content more seamless without having to resort to a WebView.


Properties

You can set the below properties in the UI part of the builder.

  • DefaultShareMenuItem - it's a boolean value which is set to false by default.
  • ShowTitle - it's a boolean value which is set to false by default.
  • ToolbarColor - it's a color value which is set to &h00ffffff by default.
  • Url - it's a string value which is set to https://niotron.com by default.

Block Properties

You can set the below blocks properties in the blocks section of the builder.

DefaultShareMenuItem

Enable or Disable Share Menu Item


ShowTitle

Enable or Disable the Title On Top of the CustomTab


ToolbarColor

Color of the Toolbar on top


Url

Set the Url For Chrome Custom Tab



Methods

You can set the below method blocks in the blocks section of the builder.

AddMenuItem

Adds a Menu Item to the Custom Tab. Set the Title and pass the intent as a Url or a package Name. Example : https://niotron.com or package:com.niotron.package When User Clicks on the Item the Intent Will be Called

LaunchCustomTab

Calls the Custom Tab and Displays it to the User

SetActionButton

The Action Button is represented as a Bundle with an icon of the action button and a pendingIntent that will be called by Chrome when your user hits the action button. The icon is currently 24dp in height and 24-48 dp in width. 'intent' should be a url or a package name starting with package:


Events

You can set the below event blocks in the blocks section of the builder.

AddMenuItemErrorOccurred

Event Called When There is an Error in the Intent You Provided

ErrorOccurred

Event Called When Some Error Occurs