diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2011-01-17 12:52:18 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-17 12:52:18 -0800 |
commit | 59cce94eb8cecd484b467d7b855817116e4b13fc (patch) | |
tree | d269ea26c49a22894a94052caffb0e3f0966f9a8 /core/java | |
parent | db7f38673c33ba55801019007ff18fa4c57f75e0 (diff) | |
parent | 6c742f1e95dfe1f808bf02fadd5fbf9660b95050 (diff) | |
download | frameworks_base-59cce94eb8cecd484b467d7b855817116e4b13fc.zip frameworks_base-59cce94eb8cecd484b467d7b855817116e4b13fc.tar.gz frameworks_base-59cce94eb8cecd484b467d7b855817116e4b13fc.tar.bz2 |
Merge "Catching some edge cases while flinging/scrolling in NumberPicker" into honeycomb
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/widget/NumberPicker.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java index ba46a3f..63dbfbf 100644 --- a/core/java/android/widget/NumberPicker.java +++ b/core/java/android/widget/NumberPicker.java @@ -754,7 +754,7 @@ public class NumberPicker extends LinearLayout { return; } mCurrentScrollOffset += y; - while (mCurrentScrollOffset - mInitialScrollOffset > mSelectorElementHeight) { + while (mCurrentScrollOffset - mInitialScrollOffset >= mSelectorElementHeight) { mCurrentScrollOffset -= mSelectorElementHeight; decrementSelectorIndices(selectorIndices); changeCurrent(selectorIndices[SELECTOR_MIDDLE_ITEM_INDEX]); @@ -762,7 +762,7 @@ public class NumberPicker extends LinearLayout { mCurrentScrollOffset = mInitialScrollOffset; } } - while (mCurrentScrollOffset - mInitialScrollOffset < -mSelectorElementHeight) { + while (mCurrentScrollOffset - mInitialScrollOffset <= -mSelectorElementHeight) { mCurrentScrollOffset += mSelectorElementHeight; incrementScrollSelectorIndices(selectorIndices); changeCurrent(selectorIndices[SELECTOR_MIDDLE_ITEM_INDEX]); @@ -1147,8 +1147,8 @@ public class NumberPicker extends LinearLayout { postAdjustScrollerCommand(0); tryNotifyScrollListener(OnScrollListener.SCROLL_STATE_IDLE); } else { - showInputControls(); updateInputTextView(); + showInputControls(); } } @@ -1537,8 +1537,8 @@ public class NumberPicker extends LinearLayout { public void run() { mPreviousScrollerY = 0; if (mInitialScrollOffset == mCurrentScrollOffset) { - showInputControls(); updateInputTextView(); + showInputControls(); return; } // adjust to the closest value |