CustomCredentialEntry.Builder
public final class CustomCredentialEntry.Builder
Builder for CustomCredentialEntry
| Throws | |
|---|---|
kotlin.NullPointerException |
If |
Summary
Public constructors |
|---|
Builder(constructs an instance of |
Public methods |
|
|---|---|
final @NonNull CustomCredentialEntry |
build()Builds an instance of |
final @NonNull CustomCredentialEntry.Builder |
setAutoSelectAllowed(boolean autoSelectAllowed)Sets whether the entry should be auto-selected. |
final @NonNull CustomCredentialEntry.Builder |
@RequiresApi(value = 35)Sets the biometric prompt data to optionally utilize a credential manager flow that directly handles the biometric verification for you and gives you the response; set to null by default, indicating the default behavior is to not utilize this embedded biometric prompt flow. |
final @NonNull CustomCredentialEntry.Builder |
setDefaultIconPreferredAsSingleProvider(When set to true, the UI prefers to render the default credential type icon when you are the single available provider; false by default. |
final @NonNull CustomCredentialEntry.Builder |
setEntryGroupId(@NonNull CharSequence entryGroupId)Sets an ID to uniquely mark this entry for deduplication or for grouping entries during display; if not set, will default to |
final @NonNull CustomCredentialEntry.Builder |
Sets the icon to be show on the UI. |
final @NonNull CustomCredentialEntry.Builder |
setLastUsedTime(Instant lastUsedTime)Sets the last used time of this account. |
final @NonNull CustomCredentialEntry.Builder |
setSubtitle(CharSequence subtitle)Sets a displayName to be shown on the UI with this entry. |
final @NonNull CustomCredentialEntry.Builder |
setTypeDisplayName(CharSequence typeDisplayName)Sets the display name of this credential type, to be shown on the UI with this entry. |
Public constructors
Builder
public Builder(
@NonNull Context context,
@NonNull String type,
@NonNull CharSequence title,
@NonNull PendingIntent pendingIntent,
@NonNull BeginGetCredentialOption beginGetCredentialOption
)
constructs an instance of CustomCredentialEntry.Builder
| Parameters | |
|---|---|
@NonNull Context context |
the context of the calling app, required to retrieve fallback resources |
@NonNull String type |
the type string that defines this custom credential |
@NonNull CharSequence title |
the title shown with this entry on the selector UI |
@NonNull PendingIntent pendingIntent |
the |
@NonNull BeginGetCredentialOption beginGetCredentialOption |
the option from the original |
Public methods
build
public final @NonNull CustomCredentialEntry build()
Builds an instance of CustomCredentialEntry
setAutoSelectAllowed
public final @NonNull CustomCredentialEntry.Builder setAutoSelectAllowed(boolean autoSelectAllowed)
Sets whether the entry should be auto-selected. The value is false by default.
setBiometricPromptData
@RequiresApi(value = 35)
public final @NonNull CustomCredentialEntry.Builder setBiometricPromptData(BiometricPromptData biometricPromptData)
Sets the biometric prompt data to optionally utilize a credential manager flow that directly handles the biometric verification for you and gives you the response; set to null by default, indicating the default behavior is to not utilize this embedded biometric prompt flow.
setDefaultIconPreferredAsSingleProvider
public final @NonNull CustomCredentialEntry.Builder setDefaultIconPreferredAsSingleProvider(
boolean isDefaultIconPreferredAsSingleProvider
)
When set to true, the UI prefers to render the default credential type icon when you are the single available provider; false by default.
setEntryGroupId
public final @NonNull CustomCredentialEntry.Builder setEntryGroupId(@NonNull CharSequence entryGroupId)
Sets an ID to uniquely mark this entry for deduplication or for grouping entries during display; if not set, will default to title.
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
If the entryGroupId is empty |
setIcon
public final @NonNull CustomCredentialEntry.Builder setIcon(@NonNull Icon icon)
Sets the icon to be show on the UI. If no icon is set, a default icon representing a custom credential will be set.
setLastUsedTime
public final @NonNull CustomCredentialEntry.Builder setLastUsedTime(Instant lastUsedTime)
Sets the last used time of this account. This information will be used to sort the entries on the selector.
setSubtitle
public final @NonNull CustomCredentialEntry.Builder setSubtitle(CharSequence subtitle)
Sets a displayName to be shown on the UI with this entry.
setTypeDisplayName
public final @NonNull CustomCredentialEntry.Builder setTypeDisplayName(CharSequence typeDisplayName)
Sets the display name of this credential type, to be shown on the UI with this entry.