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

Commit 51359cf3 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Automerger Merge Worker
Browse files

Merge "Initialize sourceless insets with Insets.NONE" into rvc-dev am:...

Merge "Initialize sourceless insets with Insets.NONE" into rvc-dev am: fe2228aa am: ce247615 am: 8622d98f

Change-Id: I0fa7b9e9a31e40b4a6b8c0ae49dc3ddb1b858d02
parents 95f1c4d1 8622d98f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -172,6 +172,10 @@ public class InsetsState implements Parcelable {
        for (int type = FIRST_TYPE; type <= LAST_TYPE; type++) {
            InsetsSource source = mSources.get(type);
            if (source == null) {
                int index = indexOf(toPublicType(type));
                if (typeInsetsMap[index] == null) {
                    typeInsetsMap[index] = Insets.NONE;
                }
                continue;
            }

+44 −6
Original line number Diff line number Diff line
@@ -835,12 +835,24 @@ public final class WindowInsets {

    @Override
    public String toString() {
        return "WindowInsets{systemWindowInsets=" + getSystemWindowInsets()
                + " stableInsets=" + getStableInsets()
                + " sysGestureInsets=" + getSystemGestureInsets()
                + (mDisplayCutout != null ? " cutout=" + mDisplayCutout : "")
                + (isRound() ? " round" : "")
                + "}";
        StringBuilder result = new StringBuilder("WindowInsets{\n    ");
        for (int i = 0; i < SIZE; i++) {
            Insets insets = mTypeInsetsMap[i];
            Insets maxInsets = mTypeMaxInsetsMap[i];
            boolean visible = mTypeVisibilityMap[i];
            if (!Insets.NONE.equals(insets) || !Insets.NONE.equals(maxInsets) || visible) {
                result.append(Type.toString(1 << i)).append("=").append(insets)
                        .append(" max=").append(maxInsets)
                        .append(" vis=").append(visible)
                        .append("\n    ");
            }
        }

        result.append(mDisplayCutout != null ? "cutout=" + mDisplayCutout : "");
        result.append("\n    ");
        result.append(isRound() ? "round" : "");
        result.append("}");
        return result.toString();
    }

    /**
@@ -1309,6 +1321,32 @@ public final class WindowInsets {
            }
        }

        static String toString(@InsetsType int type) {
            switch (type) {
                case STATUS_BARS:
                    return "statusBars";
                case NAVIGATION_BARS:
                    return "navigationBars";
                case CAPTION_BAR:
                    return "captionBar";
                case IME:
                    return "ime";
                case SYSTEM_GESTURES:
                    return "systemGestures";
                case MANDATORY_SYSTEM_GESTURES:
                    return "mandatorySystemGestures";
                case TAPPABLE_ELEMENT:
                    return "tappableElement";
                case DISPLAY_CUTOUT:
                    return "displayCutout";
                case WINDOW_DECOR:
                    return "windowDecor";
                default:
                    throw new IllegalArgumentException("type needs to be >= FIRST and <= LAST,"
                            + " type=" + type);
            }
        }

        private Type() {
        }