Skip to content

Instantly share code, notes, and snippets.

View MatheusAmelco's full-sized avatar
😄
Working...

Matheus Amelco MatheusAmelco

😄
Working...
View GitHub Profile
@MatheusAmelco
MatheusAmelco / PhoneFormatter.java
Last active October 18, 2017 13:28 — forked from joaopedronardari/PhoneMask.java
Brazilian Phone Number Formatter for Android
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
public class PhoneFormatter implements TextWatcher {
private static final String PHONE_MASK = "(##) #####-####";
private final char[] PHONE_MASK_ARRAY = PHONE_MASK.toCharArray();
private boolean isInTextChanged = false;
private boolean isInAfterTextChanged = false;