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

Commit 02fab899 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Automerger Merge Worker
Browse files

Merge "Restore force relayout logic for apps targeting < R" into rvc-dev am:...

Merge "Restore force relayout logic for apps targeting < R" into rvc-dev am: 98f012c3 am: 5706a132 am: 0c321614 am: cd794c76

Change-Id: I0d10f160fd08a29b3d729b91b437ea818a817a21
parents 4ac876c9 cd794c76
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -982,6 +982,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     */
     */
    protected static boolean sBrokenWindowBackground;
    protected static boolean sBrokenWindowBackground;
    /**
     * Prior to R, we were always forcing a layout of the entire hierarchy when insets changed from
     * the server. This is inefficient and not all apps use it. Instead, we want to rely on apps
     * calling {@link #requestLayout} when they need to relayout based on an insets change.
     */
    static boolean sForceLayoutWhenInsetsChanged;
    /** @hide */
    /** @hide */
    @IntDef({NOT_FOCUSABLE, FOCUSABLE, FOCUSABLE_AUTO})
    @IntDef({NOT_FOCUSABLE, FOCUSABLE, FOCUSABLE_AUTO})
    @Retention(RetentionPolicy.SOURCE)
    @Retention(RetentionPolicy.SOURCE)
@@ -5391,6 +5398,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            GradientDrawable.sWrapNegativeAngleMeasurements =
            GradientDrawable.sWrapNegativeAngleMeasurements =
                    targetSdkVersion >= Build.VERSION_CODES.Q;
                    targetSdkVersion >= Build.VERSION_CODES.Q;
            sForceLayoutWhenInsetsChanged = targetSdkVersion < Build.VERSION_CODES.R;
            sCompatibilityDone = true;
            sCompatibilityDone = true;
        }
        }
    }
    }
+5 −0
Original line number Original line Diff line number Diff line
@@ -1584,6 +1584,11 @@ public final class ViewRootImpl implements ViewParent,
        mApplyInsetsRequested = true;
        mApplyInsetsRequested = true;
        requestLayout();
        requestLayout();


        // See comment for View.sForceLayoutWhenInsetsChanged
        if (View.sForceLayoutWhenInsetsChanged && mView != null) {
            forceLayout(mView);
        }

        // If this changes during traversal, no need to schedule another one as it will dispatch it
        // If this changes during traversal, no need to schedule another one as it will dispatch it
        // during the current traversal.
        // during the current traversal.
        if (!mIsInTraversal) {
        if (!mIsInTraversal) {