alphamu / PinEntryEditText

An EditText that looks like a pin entry field. It is highly customisable and even animated text.
Apache License 2.0
670 stars 137 forks source link

Resizing view after setMaxLength called #60

Open babramovitch opened 5 years ago

babramovitch commented 5 years ago

Fixing two issues with setMaxLength if you call it after the view has been initialized. (e.g. after a button press)

When you call setMaxLength it now calls onSizeChanged to update all the values. In onSizeChanged the width and height is recorded for future use if setMaxLength is called.

1 - If number is larger than the initialized number, it would crash with an out of bounds exception. E.g 4 -> 5

2 - If the number is smaller than initialized number, the view would retain the width of the initial number, and the smaller entry dashes would be displayed starting from the left and then stopping mid way through the screen.