AuthTabIntent.Builder


public final class AuthTabIntent.Builder


Builder class for AuthTabIntent objects.

Summary

Public constructors

Public methods

@NonNull AuthTabIntent

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

@NonNull AuthTabIntent.Builder
setColorScheme(@IntRange(from = 0, to = 2) int colorScheme)

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

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

Sets AuthTabColorSchemeParams for the given color scheme.

@NonNull AuthTabIntent.Builder

Sets the default AuthTabColorSchemeParams.

@NonNull AuthTabIntent.Builder

Sets whether to enable ephemeral browsing within the Auth Tab.

@NonNull AuthTabIntent.Builder

Associates the Intent with the given AuthTabSession.PendingSession.

@NonNull AuthTabIntent.Builder

Associates the Intent with the given AuthTabSession.

Public constructors

Builder

Added in 1.9.0-alpha01
public Builder()

Public methods

build

Added in 1.9.0-alpha01
public @NonNull AuthTabIntent build()

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

setColorScheme

Added in 1.9.0-alpha01
public @NonNull AuthTabIntent.Builder setColorScheme(@IntRange(from = 0, to = 2) int colorScheme)

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

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

Desired color scheme.

setColorSchemeParams

Added in 1.9.0-alpha01
public @NonNull AuthTabIntent.Builder setColorSchemeParams(
    @IntRange(from = 1, to = 2) int colorScheme,
    @NonNull AuthTabColorSchemeParams params
)

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
@IntRange(from = 1, to = 2) int colorScheme

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.

@NonNull AuthTabColorSchemeParams params

An instance of AuthTabColorSchemeParams.

setDefaultColorSchemeParams

Added in 1.9.0-alpha01
public @NonNull AuthTabIntent.Builder setDefaultColorSchemeParams(@NonNull AuthTabColorSchemeParams params)

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

Parameters
@NonNull AuthTabColorSchemeParams params

An instance of AuthTabColorSchemeParams.

setEphemeralBrowsingEnabled

Added in 1.9.0-alpha01
@ExperimentalEphemeralBrowsing
public @NonNull AuthTabIntent.Builder setEphemeralBrowsingEnabled(boolean enabled)

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
boolean enabled

Whether ephemeral browsing is enabled.

setPendingSession

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

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

Parameters
@NonNull AuthTabSession.PendingSession session

The AuthTabSession.PendingSession to associate the intent with.

setSession

Added in 1.9.0-alpha01
public @NonNull AuthTabIntent.Builder setSession(@NonNull AuthTabSession session)

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
@NonNull AuthTabSession session

The AuthTabSession to associate the intent with.