private void setStylePinBox ( EditText editText ) { editText . setFilters ( new InputFilter [ ] { new InputFilter . LengthFilter ( mNumberCharacters ) } ) ; if ( mMaskPassword ) { editText . setTransformationMethod ( PasswordTransformationMethod . getInstance ( ) ) ; } else { editText . setTransformationMethod ( HideReturnsTransformationMethod . getInstance ( ) ) ; } if ( mNativePinBox ) { if ( android . os . Build . VERSION . SDK_INT < android . os . Build . VERSION_CODES . JELLY_BEAN ) { //noinspection deprecation editText . setBackgroundDrawable ( new EditText ( getContext ( ) ) . getBackground ( ) ) ; } else { editText . setBackground ( new EditText ( getContext ( ) ) . getBackground ( ) ) ; } } else { editText . setBackgroundResource ( mCustomDrawablePinBox ) ; } if ( mColorTextPinBoxes != PinViewSettings . DEFAULT_TEXT_COLOR_PIN_BOX ) { editText . setTextColor ( mColorTextPinBoxes ) ; } editText . setTextSize ( PinViewUtils . convertPixelToDp ( getContext ( ) , mTextSizePinBoxes ) ) ; }
Set a PinBox with all attributes