Loading core/java/android/widget/ListView.java +4 −3 Original line number Original line Diff line number Diff line Loading @@ -3092,9 +3092,9 @@ public class ListView extends AbsListView { previouslyFocusedRect.offset(mScrollX, mScrollY); previouslyFocusedRect.offset(mScrollX, mScrollY); final ListAdapter adapter = mAdapter; final ListAdapter adapter = mAdapter; final int firstPosition = mFirstPosition; // Don't cache the result of getChildCount or mFirstPosition here, // Don't cache the result of getChildCount here, it could change in layoutChildren. // it could change in layoutChildren. if (adapter.getCount() < getChildCount() + firstPosition) { if (adapter.getCount() < getChildCount() + mFirstPosition) { mLayoutMode = LAYOUT_NORMAL; mLayoutMode = LAYOUT_NORMAL; layoutChildren(); layoutChildren(); } } Loading @@ -3104,6 +3104,7 @@ public class ListView extends AbsListView { Rect otherRect = mTempRect; Rect otherRect = mTempRect; int minDistance = Integer.MAX_VALUE; int minDistance = Integer.MAX_VALUE; final int childCount = getChildCount(); final int childCount = getChildCount(); final int firstPosition = mFirstPosition; for (int i = 0; i < childCount; i++) { for (int i = 0; i < childCount; i++) { // only consider selectable views // only consider selectable views Loading Loading
core/java/android/widget/ListView.java +4 −3 Original line number Original line Diff line number Diff line Loading @@ -3092,9 +3092,9 @@ public class ListView extends AbsListView { previouslyFocusedRect.offset(mScrollX, mScrollY); previouslyFocusedRect.offset(mScrollX, mScrollY); final ListAdapter adapter = mAdapter; final ListAdapter adapter = mAdapter; final int firstPosition = mFirstPosition; // Don't cache the result of getChildCount or mFirstPosition here, // Don't cache the result of getChildCount here, it could change in layoutChildren. // it could change in layoutChildren. if (adapter.getCount() < getChildCount() + firstPosition) { if (adapter.getCount() < getChildCount() + mFirstPosition) { mLayoutMode = LAYOUT_NORMAL; mLayoutMode = LAYOUT_NORMAL; layoutChildren(); layoutChildren(); } } Loading @@ -3104,6 +3104,7 @@ public class ListView extends AbsListView { Rect otherRect = mTempRect; Rect otherRect = mTempRect; int minDistance = Integer.MAX_VALUE; int minDistance = Integer.MAX_VALUE; final int childCount = getChildCount(); final int childCount = getChildCount(); final int firstPosition = mFirstPosition; for (int i = 0; i < childCount; i++) { for (int i = 0; i < childCount; i++) { // only consider selectable views // only consider selectable views Loading