diff options
| author | Adam Cohen <adamcohen@google.com> | 2010-10-25 14:11:00 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-10-25 14:11:00 -0700 |
| commit | c18b2e504ad66b4c6640cf9754c4918f382f7f80 (patch) | |
| tree | ae0ad419200904a720b821ad4a19c1d6474d3e80 /core | |
| parent | 8fa50d4f2ddec9bd22436e41eb1dd8dd83a2a039 (diff) | |
| parent | a9238c89a43500ed0bcdeaee182be08ff991c627 (diff) | |
| download | frameworks_base-c18b2e504ad66b4c6640cf9754c4918f382f7f80.zip frameworks_base-c18b2e504ad66b4c6640cf9754c4918f382f7f80.tar.gz frameworks_base-c18b2e504ad66b4c6640cf9754c4918f382f7f80.tar.bz2 | |
Merge "-> Fixing a bug where AdapterViewAnimator doesn't refresh correctly -> Reduced swipe threshold for StackView Change-Id: I0f04f45dade57f29581fe03fb195a6db5f12adb1"
Diffstat (limited to 'core')
| -rw-r--r-- | core/java/android/widget/AdapterViewAnimator.java | 6 | ||||
| -rw-r--r-- | core/java/android/widget/StackView.java | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/core/java/android/widget/AdapterViewAnimator.java b/core/java/android/widget/AdapterViewAnimator.java index bb2e26c3..5ac047c 100644 --- a/core/java/android/widget/AdapterViewAnimator.java +++ b/core/java/android/widget/AdapterViewAnimator.java @@ -379,11 +379,13 @@ public abstract class AdapterViewAnimator extends AdapterView<Adapter> } void refreshChildren() { + if (mAdapter == null) return; for (int i = mCurrentWindowStart; i <= mCurrentWindowEnd; i++) { - int index = modulo(i, mMaxNumActiveViews); + int index = modulo(i, getWindowSize()); + int adapterCount = mAdapter.getCount(); // get the fresh child from the adapter - View updatedChild = mAdapter.getView(i, null, this); + View updatedChild = mAdapter.getView(modulo(i, adapterCount), null, this); if (mViewsMap.containsKey(index)) { FrameLayout fl = (FrameLayout) mViewsMap.get(index).view; diff --git a/core/java/android/widget/StackView.java b/core/java/android/widget/StackView.java index c05da03..0e92eeb 100644 --- a/core/java/android/widget/StackView.java +++ b/core/java/android/widget/StackView.java @@ -79,7 +79,12 @@ public class StackView extends AdapterViewAnimator { * Specifies how far you need to swipe (up or down) before it * will be consider a completed gesture when you lift your finger */ - private static final float SWIPE_THRESHOLD_RATIO = 0.35f; + private static final float SWIPE_THRESHOLD_RATIO = 0.2f; + + /** + * Specifies the total distance, relative to the size of the stack, + * that views will be slid, either up or down + */ private static final float SLIDE_UP_RATIO = 0.7f; /** |
