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

Commit 9a7444ce authored by Robert Horvath's avatar Robert Horvath
Browse files

Keep custom keep-clear Rects if preferKeepClear is set

Since ViewParents can be set to not clip their children, custom
keep clear areas can extend beyond the bounds of its hosting View.
If preferKeepClear is set, add the View's bounds as a keep clear area,
but also keep the custom Rects.

Bug: 221073574
Test: atest KeepClearRectsTests
Change-Id: I85a4e4a223fbba787c5afebf2689a031243808d4
parent b57bb862
Loading
Loading
Loading
Loading
+6 −5
Original line number Original line Diff line number Diff line
@@ -11807,8 +11807,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * <p>
     * <p>
     * The system will try to respect this preference, but when not possible will ignore it.
     * The system will try to respect this preference, but when not possible will ignore it.
     * <p>
     * <p>
     * Note: while this is set to {@code true}, the system will ignore the {@code Rect}s provided
     * Note: This is independent from {@link #setPreferKeepClearRects}. If both are set, both will
     * through {@link #setPreferKeepClearRects} (but not clear them).
     * be taken into account.
     * <p>
     * <p>
     * @see #setPreferKeepClearRects
     * @see #setPreferKeepClearRects
     * @see #isPreferKeepClear
     * @see #isPreferKeepClear
@@ -11842,8 +11842,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * <p>
     * <p>
     * The system will try to respect this preference, but when not possible will ignore it.
     * The system will try to respect this preference, but when not possible will ignore it.
     * <p>
     * <p>
     * Note: While {@link #isPreferKeepClear} is {@code true}, the {@code Rect}s set here are
     * Note: This is independent from {@link #setPreferKeepClear}. If both are set, both will be
     * ignored.
     * taken into account.
     * <p>
     * <p>
     * @see #setPreferKeepClear
     * @see #setPreferKeepClear
     * @see #getPreferKeepClearRects
     * @see #getPreferKeepClearRects
@@ -11939,7 +11939,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            final List<Rect> list = new ArrayList();
            final List<Rect> list = new ArrayList();
            if (info.mPreferKeepClear) {
            if (info.mPreferKeepClear) {
                list.add(new Rect(0, 0, getWidth(), getHeight()));
                list.add(new Rect(0, 0, getWidth(), getHeight()));
            } else if (info.mKeepClearRects != null) {
            }
            if (info.mKeepClearRects != null) {
                list.addAll(info.mKeepClearRects);
                list.addAll(info.mKeepClearRects);
            }
            }
            return list;
            return list;