CardEditText extends ErrorEditText implements TextWatcher { @Override protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) { super.onFocusChanged(focused, direction, previouslyFocusedRect); if (focused) { unmaskNumber(); if (getText().toString().length() > 0) { setSelection(getText().toString().length()); } } else if (mMask && isValid()) { maskNumber(); } } CardEditText(Context context);  CardEditText(Context context, AttributeSet attrs);  CardEditText(Context context, AttributeSet attrs, int defStyle); void displayCardTypeIcon(boolean display); CardType getCardType(); void setMask(boolean mask); void setOnCardTypeChangedListener(OnCardTypeChangedListener listener); @Override void afterTextChanged(Editable editable); @Override boolean isValid(); @Override String getErrorMessage(); @Override void beforeTextChanged(CharSequence s, int start, int count, int after);  }
@Test public void doesNotMaskIfMaskingIsNotEnabled() { TransformationMethod originalMethod = mView.getTransformationMethod(); type("4111111111111111"); mView.onFocusChanged(false, 1, null); assertEquals(originalMethod, mView.getTransformationMethod()); }