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

Commit 07ddb460 authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android (Google) Code Review
Browse files

Merge "NumberPicker should adjust min and max when displayed values are set." into jb-mr1-dev

parents 94ffe873 a1410e67
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1361,6 +1361,14 @@ public class NumberPicker extends LinearLayout {
            // Allow text entry rather than strictly numeric entry.
            mInputText.setRawInputType(InputType.TYPE_CLASS_TEXT
                    | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
            // Make sure the min, max, respect the size of the displayed
            // values. This will take care of the current value as well.
            if (getMinValue() >= displayedValues.length) {
                setMinValue(0);
            }
            if (getMaxValue() >= displayedValues.length) {
                setMaxValue(displayedValues.length - 1);
            }
        } else {
            mInputText.setRawInputType(InputType.TYPE_CLASS_NUMBER);
        }