Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

ImageTransformation.Builder

public static class ImageTransformation.Builder
extends Object

java.lang.Object
   ↳ android.service.autofill.ImageTransformation.Builder


Builder for ImageTransformation objects.

Summary

Public constructors

ImageTransformation.Builder(AutofillId id, Pattern regex, int resId)

This constructor was deprecated in API level 28. use ImageTransformation.Builder(AutofillId, Pattern, int, CharSequence) instead.

ImageTransformation.Builder(AutofillId id, Pattern regex, int resId, CharSequence contentDescription)

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

Public methods

ImageTransformation.Builder addOption(Pattern regex, int resId)

This method was deprecated in API level 28. use addOption(Pattern, int, CharSequence) instead.

ImageTransformation.Builder addOption(Pattern regex, int resId, CharSequence contentDescription)

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

ImageTransformation build()

Creates a new ImageTransformation instance.

Inherited methods

Public constructors

ImageTransformation.Builder

added in API level 27
public ImageTransformation.Builder (AutofillId id, 
                Pattern regex, 
                int resId)

This constructor was deprecated in API level 28.
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 Pattern: regular expression defining what should be matched to use this image.

This value must never be null.

resId int: resource id of the image (in the autofill service's package). The presentation must contain a ImageView child with that id.

ImageTransformation.Builder

added in API level 28
public ImageTransformation.Builder (AutofillId id, 
                Pattern regex, 
                int resId, 
                CharSequence contentDescription)

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 Pattern: regular expression defining what should be matched to use this image.

This value must never be null.

resId int: resource id of the image (in the autofill service's package). The presentation must contain a ImageView child with that id.

contentDescription CharSequence: content description to be applied in the child view.

This value must never be null.

Public methods

addOption

added in API level 27
public ImageTransformation.Builder addOption (Pattern regex, 
                int resId)

This method was deprecated in API level 28.
use addOption(Pattern, int, CharSequence) instead.

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

Parameters
regex Pattern: regular expression defining what should be matched to use this image.

This value must never be null.

resId int: resource id of the image (in the autofill service's package). The presentation must contain a ImageView child with that id.

Returns
ImageTransformation.Builder this build

addOption

added in API level 28
public ImageTransformation.Builder addOption (Pattern regex, 
                int resId, 
                CharSequence contentDescription)

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

Parameters
regex Pattern: regular expression defining what should be matched to use this image.

This value must never be null.

resId int: resource id of the image (in the autofill service's package). The presentation must contain a ImageView child with that id.

contentDescription CharSequence: content description to be applied in the child view.

This value must never be null.

Returns
ImageTransformation.Builder this build

build

added in API level 27
public ImageTransformation build ()

Creates a new ImageTransformation instance.

Returns
ImageTransformation