Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public class PinEntryEditText extends AppCompatEditText {
protected int mMaxLength = 4;
protected RectF[] mLineCoords;
protected float[] mCharBottom;
protected int mWidth = 0;
protected int mHeight = 0;
protected Paint mCharPaint;
protected Paint mLastCharPaint;
protected Paint mSingleCharPaint;
Expand Down Expand Up @@ -112,8 +114,10 @@ public void setMaxLength(final int maxLength) {
mNumChars = maxLength;

setFilters(new InputFilter[]{new InputFilter.LengthFilter(maxLength)});

setText(null);

onSizeChanged(mWidth, mHeight , mWidth, mHeight);

invalidate();
}

Expand Down Expand Up @@ -251,6 +255,8 @@ public void setInputType(int type) {

@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
mWidth = w;
mHeight = h;
super.onSizeChanged(w, h, oldw, oldh);
mOriginalTextColors = getTextColors();
if (mOriginalTextColors != null) {
Expand Down Expand Up @@ -626,4 +632,4 @@ public void setOnPinEnteredListener(OnPinEnteredListener l) {
public interface OnPinEnteredListener {
void onPinEntered(CharSequence str);
}
}
}