Added in API level 33

Builder


class Builder
kotlin.Any
   ↳ android.service.autofill.Field.Builder

A builder for Field

Summary

Public constructors

Public methods
Field

Builds the instance.

Field.Builder
setFilter(value: Pattern?)

Regex used to determine if the dataset should be shown in the autofill UI; when null, it disables filtering on that dataset (this is the recommended approach when value is not null and field contains sensitive data such as passwords).

Field.Builder

The presentations used to visualize this field in Autofill UI.

Field.Builder

The value to be autofilled.

Public constructors

Builder

Added in API level 33
Builder()

Public methods

build

Added in API level 33
fun build(): Field

Builds the instance. This builder should not be touched after calling this!

Return
Field This value cannot be null.

setFilter

Added in API level 33
fun setFilter(value: Pattern?): Field.Builder

Regex used to determine if the dataset should be shown in the autofill UI; when null, it disables filtering on that dataset (this is the recommended approach when value is not null and field contains sensitive data such as passwords).

Parameters
value Pattern?: This value may be null.

setPresentations

Added in API level 33
fun setPresentations(value: Presentations): Field.Builder

The presentations used to visualize this field in Autofill UI.

Parameters
value Presentations: This value cannot be null.
Return
Field.Builder This value cannot be null.

setValue

Added in API level 33
fun setValue(value: AutofillValue): Field.Builder

The value to be autofilled. Pass null if you do not have the value but the target view is a logical part of the dataset. For example, if the dataset needs authentication and you have no access to the value.

Parameters
value AutofillValue: This value cannot be null.