diff options
author | Adam Powell <adamp@google.com> | 2010-02-18 15:54:40 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-02-18 15:54:40 -0800 |
commit | 9599452dd9c001cc2217175227514ef9ac631cd9 (patch) | |
tree | bffe0b0fca34a58a6bb0605a860c486fbc53b015 /core | |
parent | b167643c875e19de2e9928eaae40f205e7219a62 (diff) | |
parent | d7507834e73f32b4c82839036dc3897a1587e668 (diff) | |
download | frameworks_base-9599452dd9c001cc2217175227514ef9ac631cd9.zip frameworks_base-9599452dd9c001cc2217175227514ef9ac631cd9.tar.gz frameworks_base-9599452dd9c001cc2217175227514ef9ac631cd9.tar.bz2 |
Merge "Don't cache mFirstPosition before a layoutChildren in ListView.onFocusChanged"
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/widget/ListView.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java index 5308725..2feed03 100644 --- a/core/java/android/widget/ListView.java +++ b/core/java/android/widget/ListView.java @@ -3092,9 +3092,9 @@ public class ListView extends AbsListView { previouslyFocusedRect.offset(mScrollX, mScrollY); final ListAdapter adapter = mAdapter; - final int firstPosition = mFirstPosition; - // Don't cache the result of getChildCount here, it could change in layoutChildren. - if (adapter.getCount() < getChildCount() + firstPosition) { + // Don't cache the result of getChildCount or mFirstPosition here, + // it could change in layoutChildren. + if (adapter.getCount() < getChildCount() + mFirstPosition) { mLayoutMode = LAYOUT_NORMAL; layoutChildren(); } @@ -3104,6 +3104,7 @@ public class ListView extends AbsListView { Rect otherRect = mTempRect; int minDistance = Integer.MAX_VALUE; final int childCount = getChildCount(); + final int firstPosition = mFirstPosition; for (int i = 0; i < childCount; i++) { // only consider selectable views |