Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f43eab14 authored by Adam Powell's avatar Adam Powell Committed by Android (Google) Code Review
Browse files

Merge "Make AbsListViews remeasure children after rotation"

parents 5062a582 f3c2edaa
Loading
Loading
Loading
Loading
+27 −0
Original line number Original line Diff line number Diff line
@@ -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;
        
        
@@ -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;
        }
        }