use of com.redmadrobot.inputmask.model.CaretString in project caronae-android by caronae.
the class MyProfileFrag method getFormatedPlate.
// Use this function to get user car plate correctly formated
String getFormatedPlate(String plate) {
final Mask mask = new Mask("[AAA]-[0000]");
final String input = plate;
final Mask.Result result = mask.apply(new CaretString(input, input.length()), // you may consider disabling autocompletion for your case
true);
final String output = result.getFormattedText().getString();
return output;
}
use of com.redmadrobot.inputmask.model.CaretString in project caronae-android by caronae.
the class MyProfileFrag method getFormatedNumber.
// Use this function to get user phone number correctly formated
String getFormatedNumber(String phone) {
final Mask mask = new Mask("({0}[00]) [00000]-[0000]");
final String input = phone;
final Mask.Result result = mask.apply(new CaretString(input, input.length()), // you may consider disabling autocompletion for your case
true);
final String output = result.getFormattedText().getString();
return output;
}
Aggregations