CustomCredentialEntry.Builder


class CustomCredentialEntry.Builder


Builder for CustomCredentialEntry

Summary

Public constructors

Builder(
    context: Context,
    type: String,
    title: CharSequence,
    pendingIntent: PendingIntent,
    beginGetCredentialOption: BeginGetCredentialOption
)

constructs an instance of CustomCredentialEntry.Builder

Public functions

CustomCredentialEntry

Builds an instance of CustomCredentialEntry

CustomCredentialEntry.Builder
setAutoSelectAllowed(autoSelectAllowed: Boolean)

Sets whether the entry should be auto-selected.

CustomCredentialEntry.Builder
setDefaultIconPreferredAsSingleProvider(
    isDefaultIconPreferredAsSingleProvider: Boolean
)

When set to true, the UI prefers to render the default credential type icon when you are the single available provider; false by default.

CustomCredentialEntry.Builder

Sets an ID to uniquely mark this entry for deduplication or for grouping entries during display; if not set, will default to title.

CustomCredentialEntry.Builder
setIcon(icon: Icon)

Sets the icon to be show on the UI.

CustomCredentialEntry.Builder
setLastUsedTime(lastUsedTime: Instant?)

Sets the last used time of this account.

CustomCredentialEntry.Builder

Sets a displayName to be shown on the UI with this entry.

CustomCredentialEntry.Builder
setTypeDisplayName(typeDisplayName: CharSequence?)

Sets the display name of this credential type, to be shown on the UI with this entry.

Public constructors

Builder

Added in 1.2.0
Builder(
    context: Context,
    type: String,
    title: CharSequence,
    pendingIntent: PendingIntent,
    beginGetCredentialOption: BeginGetCredentialOption
)

constructs an instance of CustomCredentialEntry.Builder

Parameters
context: Context

the context of the calling app, required to retrieve fallback resources

type: String

the type string that defines this custom credential

title: CharSequence

the title shown with this entry on the selector UI

pendingIntent: PendingIntent

the PendingIntent that will get invoked when the user selects this entry, must be created with flag PendingIntent.FLAG_MUTABLE to allow the Android system to attach the final request

beginGetCredentialOption: BeginGetCredentialOption

the option from the original BeginGetCredentialResponse, for which this credential entry is being added

Public functions

build

Added in 1.2.0
fun build(): CustomCredentialEntry

Builds an instance of CustomCredentialEntry

setAutoSelectAllowed

Added in 1.2.0
fun setAutoSelectAllowed(autoSelectAllowed: Boolean): CustomCredentialEntry.Builder

Sets whether the entry should be auto-selected. The value is false by default.

setDefaultIconPreferredAsSingleProvider

Added in 1.3.0-alpha03
fun setDefaultIconPreferredAsSingleProvider(
    isDefaultIconPreferredAsSingleProvider: Boolean
): CustomCredentialEntry.Builder

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

Added in 1.3.0-alpha03
fun setEntryGroupId(entryGroupId: CharSequence): CustomCredentialEntry.Builder

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

Added in 1.2.0
fun setIcon(icon: Icon): CustomCredentialEntry.Builder

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

Added in 1.2.0
fun setLastUsedTime(lastUsedTime: Instant?): CustomCredentialEntry.Builder

Sets the last used time of this account. This information will be used to sort the entries on the selector.

setSubtitle

Added in 1.2.0
fun setSubtitle(subtitle: CharSequence?): CustomCredentialEntry.Builder

Sets a displayName to be shown on the UI with this entry.

setTypeDisplayName

Added in 1.2.0
fun setTypeDisplayName(typeDisplayName: CharSequence?): CustomCredentialEntry.Builder

Sets the display name of this credential type, to be shown on the UI with this entry.