diff --git a/core/java/android/widget/AdapterViewAnimator.java b/core/java/android/widget/AdapterViewAnimator.java index bb2e26c320875..5ac047cecb93d 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 } 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 c05da035811ea..0e92eeb94d59d 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; /**