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

Commit cdb86673 authored by Romain Guy's avatar Romain Guy
Browse files

Force all views to relayout when ViewRoot is resized.

Bug #2519590

Change-Id: Ia6b9d4cf6d719f713703a1eb2e1ccdd5d61a5123
parent ed531b37
Loading
Loading
Loading
Loading
+14 −0
Original line number 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);
    }

    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 DIE = 1001;
@@ -1862,6 +1872,10 @@ public final class ViewRoot extends Handler implements ViewParent,
                if (msg.what == RESIZED_REPORT) {
                    mReportNextDraw = true;
                }

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