Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 044a4c3e authored by Adam Powell's avatar Adam Powell Committed by Android Git Automerger
Browse files

am 351f7817: am 21af9a08: Merge "avoid multiple-"0" to exceed the length of upper bound"

# By Sungmin Choi
# Via Android Git Automerger (1) and others
* commit '351f7817':
  avoid multiple-"0" to exceed the length of upper bound
parents 11f1c5b8 351f7817
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -1969,8 +1969,10 @@ public class NumberPicker extends LinearLayout {
                 * Ensure the user can't type in a value greater than the max
                 * Ensure the user can't type in a value greater than the max
                 * allowed. We have to allow less than min as the user might
                 * allowed. We have to allow less than min as the user might
                 * want to delete some numbers and then type a new number.
                 * want to delete some numbers and then type a new number.
                 * And prevent multiple-"0" that exceeds the length of upper
                 * bound number.
                 */
                 */
                if (val > mMaxValue) {
                if (val > mMaxValue || result.length() > String.valueOf(mMaxValue).length()) {
                    return "";
                    return "";
                } else {
                } else {
                    return filtered;
                    return filtered;