We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 94ffe87 + a1410e6 commit 07ddb46Copy full SHA for 07ddb46
core/java/android/widget/NumberPicker.java
@@ -1361,6 +1361,14 @@ public void setDisplayedValues(String[] displayedValues) {
1361
// Allow text entry rather than strictly numeric entry.
1362
mInputText.setRawInputType(InputType.TYPE_CLASS_TEXT
1363
| InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
1364
+ // Make sure the min, max, respect the size of the displayed
1365
+ // values. This will take care of the current value as well.
1366
+ if (getMinValue() >= displayedValues.length) {
1367
+ setMinValue(0);
1368
+ }
1369
+ if (getMaxValue() >= displayedValues.length) {
1370
+ setMaxValue(displayedValues.length - 1);
1371
1372
} else {
1373
mInputText.setRawInputType(InputType.TYPE_CLASS_NUMBER);
1374
}
0 commit comments