AuthTabIntent.Builder
public final class AuthTabIntent.Builder
Builder class for AuthTabIntent objects.
Summary
Public constructors |
|---|
Builder() |
Public methods |
|
|---|---|
@NonNull AuthTabIntent |
build()Combines all the options that have been set and returns a new |
@NonNull AuthTabIntent.Builder |
setCloseButtonIcon(@NonNull Bitmap icon)Sets the close button icon for the Auth Tab. |
@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(Sets |
@NonNull AuthTabIntent.Builder |
Sets the default |
@NonNull AuthTabIntent.Builder |
setEphemeralBrowsingEnabled(boolean enabled)Sets whether to enable ephemeral browsing within the Auth Tab. |
@NonNull AuthTabIntent.Builder |
Associates the |
@NonNull AuthTabIntent.Builder |
setSession(@NonNull AuthTabSession session)Associates the |
Public methods
build
public @NonNull AuthTabIntent build()
Combines all the options that have been set and returns a new AuthTabIntent object.
setCloseButtonIcon
public @NonNull AuthTabIntent.Builder setCloseButtonIcon(@NonNull Bitmap icon)
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
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
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 |
@NonNull AuthTabColorSchemeParams params |
An instance of |
setDefaultColorSchemeParams
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 |
setEphemeralBrowsingEnabled
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. |
| See also | |
|---|---|
EXTRA_ENABLE_EPHEMERAL_BROWSING |
setPendingSession
@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 |
setSession
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 |