Merge "Fix number picker vertical scroll computations" into klp-dev
diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java
index e4956dd..c0fde2e 100644
--- a/core/java/android/widget/NumberPicker.java
+++ b/core/java/android/widget/NumberPicker.java
@@ -1099,13 +1099,18 @@
}
@Override
- public int computeVerticalScrollOffset() {
+ protected int computeVerticalScrollOffset() {
return mCurrentScrollOffset;
}
@Override
- public int computeVerticalScrollRange() {
- return mSelectorIndices.length * mSelectorElementHeight;
+ protected int computeVerticalScrollRange() {
+ return (mMaxValue - mMinValue + 1) * mSelectorElementHeight;
+ }
+
+ @Override
+ protected int computeVerticalScrollExtent() {
+ return getHeight();
}
@Override