class CharSequenceTransformation : Parcelable, Transformation
Replaces a TextView
child of a CustomDescription
with the contents of one or more regular expressions (regexs).
When it contains more than one field, the fields that match their regex are added to the overall transformation result.
For example, a transformation to mask a credit card number contained in just one field would be:
new CharSequenceTransformation
.Builder(ccNumberId, Pattern.compile("^.*(\\d\\d\\d\\d)$"), "...$1")
.build();
But a transformation that generates a Exp: MM / YYYY
credit expiration date from two fields (month and year) would be:
new CharSequenceTransformation
.Builder(ccExpMonthId, Pattern.compile("^(\\d\\d)$"), "Exp: $1")
.addField(ccExpYearId, Pattern.compile("^(\\d\\d\\d\\d)$"), " / $1");
Summary
Inherited constants |
From class Parcelable
Int |
CONTENTS_FILE_DESCRIPTOR
Descriptor bit used with describeContents() : indicates that the Parcelable object's flattened representation includes a file descriptor.
|
Int |
PARCELABLE_WRITE_RETURN_VALUE
Flag for use with writeToParcel : the object being written is a return value, that is the result of a function such as "Parcelable someFunction() ", "void someFunction(out Parcelable) ", or "void someFunction(inout Parcelable) ". Some implementations may want to release resources at this point.
|
|
Public methods
describeContents
fun describeContents(): Int
toString
fun toString(): String
Return |
String |
a string representation of the object. |
writeToParcel
fun writeToParcel(
parcel: Parcel,
flags: Int
): Unit
Properties