Builder

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

Builder for ImageTransformation objects.
Requires API level 27 (Android 8.1, Oreo)

Summary

Public constructors
<init>(id: AutofillId, regex: Pattern, resId: Int)

use #ImageTransformation.Builder(AutofillId, Pattern, int, CharSequence) instead.

<init>(id: AutofillId, regex: Pattern, resId: Int, contentDescription: CharSequence)

Creates a new builder for a autofill id and add a first option.

Public methods
open ImageTransformation.Builder!
addOption(regex: Pattern, resId: Int)

Adds an option to replace the child view with a different image when the regex matches.

open ImageTransformation.Builder!
addOption(regex: Pattern, resId: Int, contentDescription: CharSequence)

Adds an option to replace the child view with a different image and content description when the regex matches.

open ImageTransformation!

Creates a new ImageTransformation instance.

Public constructors

<init>

Builder(id: AutofillId, regex: Pattern, resId: Int)

Deprecated: use #ImageTransformation.Builder(AutofillId, Pattern, int, CharSequence) instead.

Creates a new builder for a autofill id and add a first option.

Parameters
id AutofillId: id of the screen field that will be used to evaluate whether the image should be used. This value must never be null.
regex AutofillId: regular expression defining what should be matched to use this image. This value must never be null.
resId AutofillId: resource id of the image (in the autofill service's package). The presentation must contain a ImageView child with that id.

<init>

Builder(id: AutofillId, regex: Pattern, resId: Int, contentDescription: CharSequence)

Creates a new builder for a autofill id and add a first option.

Parameters
id AutofillId: id of the screen field that will be used to evaluate whether the image should be used. This value must never be null.
regex AutofillId: regular expression defining what should be matched to use this image. This value must never be null.
resId AutofillId: resource id of the image (in the autofill service's package). The presentation must contain a ImageView child with that id.
contentDescription AutofillId: content description to be applied in the child view. This value must never be null.

Public methods

addOption

added in API level 27
open fun addOption(regex: Pattern, resId: Int): ImageTransformation.Builder!

Adds an option to replace the child view with a different image when the regex matches.
Requires API level 27 (Android 8.1, Oreo)

Parameters
regex Pattern: regular expression defining what should be matched to use this image. This value must never be null.
resId Pattern: resource id of the image (in the autofill service's package). The presentation must contain a ImageView child with that id.
Return
ImageTransformation.Builder!: this build

addOption

added in API level 28
open fun addOption(regex: Pattern, resId: Int, contentDescription: CharSequence): ImageTransformation.Builder!

Adds an option to replace the child view with a different image and content description when the regex matches.
Requires API level 28 (Android 8.+, P)

Parameters
regex Pattern: regular expression defining what should be matched to use this image. This value must never be null.
resId Pattern: resource id of the image (in the autofill service's package). The presentation must contain a ImageView child with that id.
contentDescription Pattern: content description to be applied in the child view. This value must never be null.
Return
ImageTransformation.Builder!: this build

build

added in API level 27
open fun build(): ImageTransformation!

Creates a new ImageTransformation instance.
Requires API level 27 (Android 8.1, Oreo)