AuthTabIntent.Builder


class AuthTabIntent.Builder


Builder class for AuthTabIntent objects.

Summary

Public constructors

Public functions

AuthTabIntent

Combines all the options that have been set and returns a new AuthTabIntent object.

AuthTabIntent.Builder
setColorScheme(colorScheme: @IntRange(from = 0, to = 2) Int)

Sets the color scheme that should be applied to the user interface in the Auth Tab.

AuthTabIntent.Builder
setColorSchemeParams(
    colorScheme: @IntRange(from = 1, to = 2) Int,
    params: AuthTabColorSchemeParams
)

Sets AuthTabColorSchemeParams for the given color scheme.

AuthTabIntent.Builder

Sets the default AuthTabColorSchemeParams.

AuthTabIntent.Builder

Sets whether to enable ephemeral browsing within the Auth Tab.

AuthTabIntent.Builder

Associates the Intent with the given AuthTabSession.PendingSession.

AuthTabIntent.Builder

Associates the Intent with the given AuthTabSession.

Public constructors

Builder

Added in 1.9.0-alpha01
Builder()

Public functions

build

Added in 1.9.0-alpha01
fun build(): AuthTabIntent

Combines all the options that have been set and returns a new AuthTabIntent object.

setColorScheme

Added in 1.9.0-alpha01
fun setColorScheme(colorScheme: @IntRange(from = 0, to = 2) Int): AuthTabIntent.Builder

Sets the color scheme that should be applied to the user interface in the Auth Tab.

Parameters
colorScheme: @IntRange(from = 0, to = 2) Int

Desired color scheme.

setColorSchemeParams

Added in 1.9.0-alpha01
fun setColorSchemeParams(
    colorScheme: @IntRange(from = 1, to = 2) Int,
    params: AuthTabColorSchemeParams
): AuthTabIntent.Builder

Sets AuthTabColorSchemeParams for the given color scheme. This allows specifying two different toolbar colors for light and dark schemes. It can be useful if COLOR_SCHEME_SYSTEM is set: the Auth Tab will follow the system settings and apply the corresponding AuthTabColorSchemeParams "on the fly" when the settings change. If there is no AuthTabColorSchemeParams for the current scheme, or a particular field of it is null, the Auth Tab will fall back to the defaults provided via setDefaultColorSchemeParams. Example:

    AuthTabColorSchemeParams darkParams = new AuthTabColorSchemeParams.Builder()
            .setToolbarColor(darkColor)
            .build();
    AuthTabColorSchemeParams otherParams = new AuthTabColorSchemeParams.Builder()
            .setNavigationBarColor(otherColor)
            .build();
    AuthTabIntent intent = new AuthTabIntent.Builder()
            .setColorScheme(COLOR_SCHEME_SYSTEM)
            .setColorSchemeParams(COLOR_SCHEME_DARK, darkParams)
            .setDefaultColorSchemeParams(otherParams)
            .build();

    // Setting colors independently of color scheme
    AuthTabColorSchemeParams params = new AuthTabColorSchemeParams.Builder()
            .setToolbarColor(color)
            .setNavigationBarColor(color)
            .build();
    AuthTabIntent intent = new AuthTabIntent.Builder()
            .setDefaultColorSchemeParams(params)
            .build();
Parameters
colorScheme: @IntRange(from = 1, to = 2) Int

A constant representing a color scheme (see setColorScheme). It should not be COLOR_SCHEME_SYSTEM, because that represents a behavior rather than a particular color scheme.

params: AuthTabColorSchemeParams

An instance of AuthTabColorSchemeParams.

setDefaultColorSchemeParams

Added in 1.9.0-alpha01
fun setDefaultColorSchemeParams(params: AuthTabColorSchemeParams): AuthTabIntent.Builder

Sets the default AuthTabColorSchemeParams. This will set a default color scheme that applies when no AuthTabColorSchemeParams specified for current color scheme via setColorSchemeParams.

Parameters
params: AuthTabColorSchemeParams

An instance of AuthTabColorSchemeParams.

setEphemeralBrowsingEnabled

Added in 1.9.0-alpha01
@ExperimentalEphemeralBrowsing
fun setEphemeralBrowsingEnabled(enabled: Boolean): AuthTabIntent.Builder

Sets whether to enable ephemeral browsing within the Auth Tab. If ephemeral browsing is enabled, and the browser supports it, the Auth Tab does not share cookies or other data with the browser that handles the auth session.

Parameters
enabled: Boolean

Whether ephemeral browsing is enabled.

setPendingSession

Added in 1.9.0-alpha01
@ExperimentalPendingSession
fun setPendingSession(session: AuthTabSession.PendingSession): AuthTabIntent.Builder

Associates the Intent with the given AuthTabSession.PendingSession. Overrides the effect of setSession.

Parameters
session: AuthTabSession.PendingSession

The AuthTabSession.PendingSession to associate the intent with.

setSession

Added in 1.9.0-alpha01
fun setSession(session: AuthTabSession): AuthTabIntent.Builder

Associates the Intent with the given AuthTabSession. Guarantees that the Intent will be sent to the same component as the one the session is associated with.

Parameters
session: AuthTabSession

The AuthTabSession to associate the intent with.