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

Commit b05ec118 authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Force all views to relayout when ViewRoot is resized. Bug #2519590"

parents 951749ba cdb86673
Loading
Loading
Loading
Loading
+14 −0
Original line number Original line Diff line number Diff line
@@ -1675,6 +1675,16 @@ public final class ViewRoot extends Handler implements ViewParent,
        return (theParent instanceof ViewGroup) && isViewDescendantOf((View) theParent, parent);
        return (theParent instanceof ViewGroup) && isViewDescendantOf((View) theParent, parent);
    }
    }


    private static void forceLayout(View view) {
        view.forceLayout();
        if (view instanceof ViewGroup) {
            ViewGroup group = (ViewGroup) view;
            final int count = group.getChildCount();
            for (int i = 0; i < count; i++) {
                forceLayout(group.getChildAt(i));
            }
        }
    }


    public final static int DO_TRAVERSAL = 1000;
    public final static int DO_TRAVERSAL = 1000;
    public final static int DIE = 1001;
    public final static int DIE = 1001;
@@ -1862,6 +1872,10 @@ public final class ViewRoot extends Handler implements ViewParent,
                if (msg.what == RESIZED_REPORT) {
                if (msg.what == RESIZED_REPORT) {
                    mReportNextDraw = true;
                    mReportNextDraw = true;
                }
                }

                if (mView != null) {
                    forceLayout(mView);
                }
                requestLayout();
                requestLayout();
            }
            }
            break;
            break;