ImageTransformation.Builder


public static class ImageTransformation.Builder
extends Object

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


Builder for ImageTransformation objects.

Summary

Public constructors

Builder(AutofillId id, Pattern regex, int resId)

This constructor is deprecated. use Builder(android.view.autofill.AutofillId, java.util.regex.Pattern, int, java.lang.CharSequence) instead.

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(java.util.regex.Pattern, int, java.lang.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

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

Builder

Added in API level 27
public Builder (AutofillId id, 
                Pattern regex, 
                int resId)

This constructor is deprecated.
use Builder(android.view.autofill.AutofillId, java.util.regex.Pattern, int, java.lang.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 cannot be null.

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

Builder

Added in API level 28
public 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 cannot be null.

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

Public methods

addOption

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

This method was deprecated in API level 28.
use addOption(java.util.regex.Pattern, int, java.lang.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 cannot 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 cannot 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 cannot be null.

Returns
ImageTransformation.Builder this build

build

Added in API level 27
public ImageTransformation build ()

Creates a new ImageTransformation instance.