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

Commit 05ac00c6 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge changes from topic "windowinsets-api"

* changes:
  WindowInsets: Annotate nullability
  WindowInsets: Add Builder
  WindowInsets: reimplement WindowInsets on top of Insets
  WindowInsets: make WindowInsets.inset() public
parents dce7d019 9272cfe1
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -50145,17 +50145,29 @@ package android.view {
    method public int getStableInsetLeft();
    method public int getStableInsetRight();
    method public int getStableInsetTop();
    method public android.graphics.Insets getStableInsets();
    method public int getSystemWindowInsetBottom();
    method public int getSystemWindowInsetLeft();
    method public int getSystemWindowInsetRight();
    method public int getSystemWindowInsetTop();
    method public android.graphics.Insets getSystemWindowInsets();
    method public boolean hasInsets();
    method public boolean hasStableInsets();
    method public boolean hasSystemWindowInsets();
    method public android.view.WindowInsets inset(int, int, int, int);
    method public boolean isConsumed();
    method public boolean isRound();
    method public android.view.WindowInsets replaceSystemWindowInsets(int, int, int, int);
    method public android.view.WindowInsets replaceSystemWindowInsets(android.graphics.Rect);
    method public deprecated android.view.WindowInsets replaceSystemWindowInsets(int, int, int, int);
    method public deprecated android.view.WindowInsets replaceSystemWindowInsets(android.graphics.Rect);
  }
  public static class WindowInsets.Builder {
    ctor public WindowInsets.Builder();
    ctor public WindowInsets.Builder(android.view.WindowInsets);
    method public android.view.WindowInsets build();
    method public android.view.WindowInsets.Builder setDisplayCutout(android.view.DisplayCutout);
    method public android.view.WindowInsets.Builder setStableInsets(android.graphics.Insets);
    method public android.view.WindowInsets.Builder setSystemWindowInsets(android.graphics.Insets);
  }
  public abstract interface WindowManager implements android.view.ViewManager {
+4 −4
Original line number Diff line number Diff line
@@ -9852,12 +9852,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            // We weren't called from within a direct call to fitSystemWindows,
            // call into it as a fallback in case we're in a class that overrides it
            // and has logic to perform.
            if (fitSystemWindows(insets.getSystemWindowInsets())) {
            if (fitSystemWindows(insets.getSystemWindowInsetsAsRect())) {
                return insets.consumeSystemWindowInsets();
            }
        } else {
            // We were called from within a direct call to fitSystemWindows.
            if (fitSystemWindowsInt(insets.getSystemWindowInsets())) {
            if (fitSystemWindowsInt(insets.getSystemWindowInsetsAsRect())) {
                return insets.consumeSystemWindowInsets();
            }
        }
@@ -9960,7 +9960,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    protected boolean computeFitSystemWindows(Rect inoutInsets, Rect outLocalInsets) {
        WindowInsets innerInsets = computeSystemWindowInsets(new WindowInsets(inoutInsets),
                outLocalInsets);
        inoutInsets.set(innerInsets.getSystemWindowInsets());
        inoutInsets.set(innerInsets.getSystemWindowInsetsAsRect());
        return innerInsets.isSystemWindowInsetsConsumed();
    }
@@ -9979,7 +9979,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                || mAttachInfo == null
                || ((mAttachInfo.mSystemUiVisibility & SYSTEM_UI_LAYOUT_FLAGS) == 0
                && !mAttachInfo.mOverscanRequested)) {
            outLocalInsets.set(in.getSystemWindowInsets());
            outLocalInsets.set(in.getSystemWindowInsetsAsRect());
            return in.consumeSystemWindowInsets().inset(outLocalInsets);
        } else {
            // The application wants to take care of fitting system window for
+274 −130

File changed.

Preview size limit exceeded, changes collapsed.

+2 −1
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Insets;
import android.graphics.Outline;
import android.graphics.Paint;
import android.graphics.PixelFormat;
@@ -568,7 +569,7 @@ public final class Magnifier {
    private Point getCurrentClampedWindowCoordinates() {
        final Rect windowBounds;
        if (mParentSurface.mIsMainWindowSurface) {
            final Rect systemInsets = mView.getRootWindowInsets().getSystemWindowInsets();
            final Insets systemInsets = mView.getRootWindowInsets().getSystemWindowInsets();
            windowBounds = new Rect(systemInsets.left, systemInsets.top,
                    mParentSurface.mWidth - systemInsets.right,
                    mParentSurface.mHeight - systemInsets.bottom);
+1 −1
Original line number Diff line number Diff line
@@ -1001,7 +1001,7 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
                        insets.getSystemWindowInsetRight(), 0);
            }
        }
        mFrameOffsets.set(insets.getSystemWindowInsets());
        mFrameOffsets.set(insets.getSystemWindowInsetsAsRect());
        insets = updateColorViews(insets, true /* animate */);
        insets = updateStatusGuard(insets);
        if (getForeground() != null) {
Loading