Skip to content

Instantly share code, notes, and snippets.

View jitendra7020's full-sized avatar

Jitendra Nath jitendra7020

View GitHub Profile
@jitendra7020
jitendra7020 / USPhoneNumberTextWatcher.java
Created June 19, 2016 04:07
US phone number format text watcher
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
public class USPhoneNumberTextWatcher implements TextWatcher {
private final int PHONE_NUMBER_LENGTH = 10;
private final int PHONE_FORMAT_TRIGGER_LENGTH = PHONE_NUMBER_LENGTH + 1;
private final String PHONE_FORMAT = "%s-%s-%s";