AuthTabIntent.Builder
class AuthTabIntent.Builder
Builder class for AuthTabIntent objects.
Summary
Public constructors |
|---|
Builder() |
Public functions |
|
|---|---|
AuthTabIntent |
build()Combines all the options that have been set and returns a new |
AuthTabIntent.Builder |
setCloseButtonIcon(icon: Bitmap)Sets the close button icon for the Auth Tab. |
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(Sets |
AuthTabIntent.Builder |
Sets the default |
AuthTabIntent.Builder |
setEphemeralBrowsingEnabled(enabled: Boolean)Sets whether to enable ephemeral browsing within the Auth Tab. |
AuthTabIntent.Builder |
Associates the |
AuthTabIntent.Builder |
setSession(session: AuthTabSession)Associates the |
Public functions
build
fun build(): AuthTabIntent
Combines all the options that have been set and returns a new AuthTabIntent object.
setCloseButtonIcon
fun setCloseButtonIcon(icon: Bitmap): AuthTabIntent.Builder
Sets the close button icon for the Auth Tab. A 24x24dp icon is recommended, though it may be scaled to fit the toolbar. The icon will be tinted according to the toolbar's color scheme; its original color is ignored, but the alpha channel is preserved.
setColorScheme
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.
setColorSchemeParams
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 |
params: AuthTabColorSchemeParams |
An instance of |
setDefaultColorSchemeParams
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 |
setEphemeralBrowsingEnabled
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. |
| See also | |
|---|---|
EXTRA_ENABLE_EPHEMERAL_BROWSING |
setPendingSession
@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 |
setSession
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 |