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

Commit d1e0cec5 authored by Adam Cohen's avatar Adam Cohen
Browse files

Avoid unnecessary layout passes from insets callbacks if they haven't changed

Change-Id: Ia7560bd466ff47103811a1a1795af5a5a25abb59
parent c9e71b88
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -43,6 +43,10 @@ public class InsettableFrameLayout extends FrameLayout implements

    @Override
    public void setInsets(Rect insets) {
        // If the insets haven't changed, this is a no-op. Avoid unnecessary layout caused by
        // modifying child layout params.
        if (insets.equals(mInsets)) return;

        final int n = getChildCount();
        for (int i = 0; i < n; i++) {
            final View child = getChildAt(i);