Package-level declarations

Top-level Kotlin extensions for AndroidX Browser.

Properties

Link copied to clipboard

The Custom Tab Activity's resize behavior.

Link copied to clipboard

Extra that, if set, allows you to set a custom breakpoint for the Custom Tab - a value, x, for which if the screen's width is higher than x, the Custom Tab will behave as a side sheet (if CustomTabsIntent.EXTRA_INITIAL_ACTIVITY_WIDTH_PX is set), otherwise it will behave as a bottom sheet (if CustomTabsIntent.EXTRA_INITIAL_ACTIVITY_HEIGHT_PX is set).

Link copied to clipboard

Extra that, if set, allows you to set how you want to distinguish the Partial Custom Tab side sheet from the rest of the display.

Link copied to clipboard

Extra that enables the maximization button on the side sheet Custom Tab toolbar.

Link copied to clipboard

Extra that specifies the position of the side sheet. By default it is set to ActivitySideSheetPosition.End, which is on the right side in left-to-right layout.

Link copied to clipboard

Extra that, if set, allows you to choose which side sheet corners should be rounded, if any at all. Options include top or none.

Link copied to clipboard

Specifies the icon bitmap of the back button on the toolbar.

Link copied to clipboard

The position of the close button as a CloseButtonPosition, or the default position if the extra is not set.

Link copied to clipboard

Specifies which color scheme should be applied to the custom tab.

Link copied to clipboard

The Custom Tab Activity's initial height, or 0 if it is not set.

Link copied to clipboard

Extra that, if set, makes the Custom Tab Activity's width to be x pixels, the Custom Tab will behave as a side sheet. A minimum width will be enforced, thus the width will be clamped as such (based on the window size classes as defined by the Android documentation):

Link copied to clipboard

Whether Instant Apps is enabled for this intent.

Link copied to clipboard

Whether the background interaction is enabled.

Link copied to clipboard

Whether the bookmarks button is enabled. This value is set to true by default.

Link copied to clipboard

Whether the download button is enabled. This value is set to true by default.

Link copied to clipboard

Whether initial URLs are to be sent to external handler apps.

Link copied to clipboard

The PendingIntent that will be sent when the user swipes up from the secondary toolbar.

Link copied to clipboard

The ShareState of this intent, or the default share state if the extra is not set.

Link copied to clipboard

Whether a browser receiving the given intent should always use browser UI and avoid using any custom tabs UI.

Link copied to clipboard

Whether the title should be shown in the custom tab.

Link copied to clipboard

The toolbar's top corner radii in dp.

Link copied to clipboard

Gets the target locale for the Translate UI.

Link copied to clipboard

Specifies whether the URL bar should be hidden as the user scrolls down the page.

Functions

Link copied to clipboard

Creates a CustomTabColorSchemeParams using DSL syntax.

fun colorSchemeParams(@ColorInt toolbarColor: Int? = null, @ColorInt secondaryToolbarColor: Int? = null, @ColorInt navigationBarColor: Int? = null, @ColorInt navigationBarDividerColor: Int? = null): CustomTabColorSchemeParams

Creates a CustomTabColorSchemeParams using the given colour integers.

Link copied to clipboard

Creates a Custom Tab Intent using DSL syntax. Optionally, an existing session may be specified.

Link copied to clipboard

Creates a CustomTabsIntent.Builder. Optionally, an existing session may be specified.

Link copied to clipboard

Retrieves the instance of androidx.browser.customtabs.CustomTabColorSchemeParams from an Intent for a given colour scheme. Uses values passed directly into CustomTabsIntent.Builder (e.g. via CustomTabsIntent.Builder.setToolbarColor) as defaults.

Link copied to clipboard

Sets the Custom Tab Activity's decoration type that will be displayed when it is acting as a side sheet.

Link copied to clipboard

Sets the Custom Tab Activity's position when acting as a side sheet.

Sets the Custom Tab Activity's rounded corners position when it is acting as a side sheet.

Link copied to clipboard

Adds the necessary flags and extras to signal any browser supporting custom tabs to use the browser UI at all times and avoid showing custom tab like UI.

Link copied to clipboard

Sets the position of the close button. This method allows for an enum CloseButtonPosition to be used.

Link copied to clipboard

Sets the colour scheme that should be applied to the user interface in the custom tab. This method allows for an enum ColorScheme to be used.

Link copied to clipboard
fun CustomTabsIntent.Builder.setColorSchemeParams(scheme: ColorScheme, @ColorInt toolbarColor: Int? = null, @ColorInt secondaryToolbarColor: Int? = null, @ColorInt navigationBarColor: Int? = null, @ColorInt navigationBarDividerColor: Int? = null): CustomTabsIntent.Builder

Sets CustomTabColorSchemeParams for the given colour scheme.

Link copied to clipboard

Sets the default colour scheme to use using DSL syntax.

fun CustomTabsIntent.Builder.setDefaultColorSchemeParams(@ColorInt toolbarColor: Int? = null, @ColorInt secondaryToolbarColor: Int? = null, @ColorInt navigationBarColor: Int? = null, @ColorInt navigationBarDividerColor: Int? = null): CustomTabsIntent.Builder

Sets the default colour scheme to use.

Link copied to clipboard

Sets the Custom Tab Activity's initial height in pixels and the desired resize behavior. The Custom Tab will behave as a bottom sheet.

Link copied to clipboard
fun CustomTabsIntent.Builder.setInitialActivitySizePx(size: Size, activityHeightResizeBehavior: ActivityHeightResizeBehavior = ActivityHeightResizeBehavior.Default): CustomTabsIntent.Builder
fun CustomTabsIntent.Builder.setInitialActivitySizePx(@Dimension(unit = 1) sizePx: Pair<Int, Int>, activityHeightResizeBehavior: ActivityHeightResizeBehavior = ActivityHeightResizeBehavior.Default): CustomTabsIntent.Builder
fun CustomTabsIntent.Builder.setInitialActivitySizePx(@Dimension(unit = 1) widthPx: Int, @Dimension(unit = 1) heightPx: Int, activityHeightResizeBehavior: ActivityHeightResizeBehavior = ActivityHeightResizeBehavior.Default): CustomTabsIntent.Builder

Sets the Custom Tab Activity's initial width/height in pixels. The Custom Tab will behave as a side sheet if the screen's width is bigger than the breakpoint value set by CustomTabsIntent.Builder.setActivitySideSheetBreakpointDp and the screen is big enough, see doc for CustomTabsIntent.EXTRA_INITIAL_ACTIVITY_WIDTH_PX.

Link copied to clipboard

Sets the share state that should be applied to the custom tab. This method allows for an enum ShareState to be used.