summaryrefslogtreecommitdiffstats
path: root/core/java/android/widget/AdapterViewAnimator.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2010-10-25 14:01:29 -0700
committerAdam Cohen <adamcohen@google.com>2010-10-25 14:03:11 -0700
commita9238c89a43500ed0bcdeaee182be08ff991c627 (patch)
tree0c94a1dd7d8a2112d3fa80bc90dfa9a2ba2a175c /core/java/android/widget/AdapterViewAnimator.java
parentf0a896b353e01c7093ba2ee0539f1a7cabef6ec6 (diff)
downloadframeworks_base-a9238c89a43500ed0bcdeaee182be08ff991c627.zip
frameworks_base-a9238c89a43500ed0bcdeaee182be08ff991c627.tar.gz
frameworks_base-a9238c89a43500ed0bcdeaee182be08ff991c627.tar.bz2
-> Fixing a bug where AdapterViewAnimator doesn't refresh correctly
-> Reduced swipe threshold for StackView Change-Id: I0f04f45dade57f29581fe03fb195a6db5f12adb1
Diffstat (limited to 'core/java/android/widget/AdapterViewAnimator.java')
-rw-r--r--core/java/android/widget/AdapterViewAnimator.java6
1 files changed, 4 insertions, 2 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;