Loading core/java/android/widget/AbsListView.java +27 −0 Original line number Original line Diff line number Diff line Loading @@ -1160,6 +1160,14 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te protected void onLayout(boolean changed, int l, int t, int r, int b) { protected void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed, l, t, r, b); super.onLayout(changed, l, t, r, b); mInLayout = true; mInLayout = true; if (changed) { int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { getChildAt(i).forceLayout(); } mRecycler.markChildrenDirty(); } layoutChildren(); layoutChildren(); mInLayout = false; mInLayout = false; Loading Loading @@ -4143,6 +4151,25 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te mScrapViews = scrapViews; mScrapViews = scrapViews; } } public void markChildrenDirty() { if (mViewTypeCount == 1) { final ArrayList<View> scrap = mCurrentScrap; final int scrapCount = scrap.size(); for (int i = 0; i < scrapCount; i++) { scrap.get(i).forceLayout(); } } else { final int typeCount = mViewTypeCount; for (int i = 0; i < typeCount; i++) { final ArrayList<View> scrap = mScrapViews[i]; final int scrapCount = scrap.size(); for (int j = 0; j < scrapCount; j++) { scrap.get(j).forceLayout(); } } } } public boolean shouldRecycleViewType(int viewType) { public boolean shouldRecycleViewType(int viewType) { return viewType >= 0; return viewType >= 0; } } Loading Loading
core/java/android/widget/AbsListView.java +27 −0 Original line number Original line Diff line number Diff line Loading @@ -1160,6 +1160,14 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te protected void onLayout(boolean changed, int l, int t, int r, int b) { protected void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed, l, t, r, b); super.onLayout(changed, l, t, r, b); mInLayout = true; mInLayout = true; if (changed) { int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { getChildAt(i).forceLayout(); } mRecycler.markChildrenDirty(); } layoutChildren(); layoutChildren(); mInLayout = false; mInLayout = false; Loading Loading @@ -4143,6 +4151,25 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te mScrapViews = scrapViews; mScrapViews = scrapViews; } } public void markChildrenDirty() { if (mViewTypeCount == 1) { final ArrayList<View> scrap = mCurrentScrap; final int scrapCount = scrap.size(); for (int i = 0; i < scrapCount; i++) { scrap.get(i).forceLayout(); } } else { final int typeCount = mViewTypeCount; for (int i = 0; i < typeCount; i++) { final ArrayList<View> scrap = mScrapViews[i]; final int scrapCount = scrap.size(); for (int j = 0; j < scrapCount; j++) { scrap.get(j).forceLayout(); } } } } public boolean shouldRecycleViewType(int viewType) { public boolean shouldRecycleViewType(int viewType) { return viewType >= 0; return viewType >= 0; } } Loading