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

Commit 8fbddc93 authored by Filip Gruszczynski's avatar Filip Gruszczynski Committed by Android (Google) Code Review
Browse files

Merge "API for overlaying app content over decor caption in freeform windows."

parents 16c9d6a9 63250651
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3499,6 +3499,7 @@ package android.app {
    method public android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback, int);
    method public void openContextMenu(android.view.View);
    method public void openOptionsMenu();
    method public void overlayWithDecorCaption(boolean);
    method public void overridePendingTransition(int, int);
    method public void postponeEnterTransition();
    method public void recreate();
+1 −0
Original line number Diff line number Diff line
@@ -3602,6 +3602,7 @@ package android.app {
    method public android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback, int);
    method public void openContextMenu(android.view.View);
    method public void openOptionsMenu();
    method public void overlayWithDecorCaption(boolean);
    method public void overridePendingTransition(int, int);
    method public void postponeEnterTransition();
    method public void recreate();
+11 −0
Original line number Diff line number Diff line
@@ -6617,6 +6617,17 @@ public class Activity extends ContextThemeWrapper
        }
    }

    /**
     * Set whether the caption should displayed directly on the content rather than push it down.
     *
     * This affects only freeform windows since they display the caption and only the main
     * window of the activity. The caption is used to drag the window around and also shows
     * maximize and close action buttons.
     */
    public void overlayWithDecorCaption(boolean overlay) {
        mWindow.setOverlayDecorCaption(overlay);
    }

    /**
     * Interface for informing a translucent {@link Activity} once all visible activities below it
     * have completed drawing. This is necessary only after an {@link Activity} has been made
+16 −0
Original line number Diff line number Diff line
@@ -276,6 +276,8 @@ public abstract class Window {

    private boolean mDestroyed;

    private boolean mOverlayWithDecorCaption = false;

    // The current window attributes.
    private final WindowManager.LayoutParams mWindowAttributes =
        new WindowManager.LayoutParams();
@@ -2044,4 +2046,18 @@ public abstract class Window {
    /** @hide */
    public void setTheme(int resId) {
    }

    /**
     * Whether the caption should be displayed directly on the content rather than push the content
     * down. This affects only freeform windows since they display the caption.
     * @hide
     */
    public void setOverlayDecorCaption(boolean overlayCaption) {
        mOverlayWithDecorCaption = overlayCaption;
    }

    /** @hide */
    public boolean getOverlayDecorCaption() {
        return mOverlayWithDecorCaption;
    }
}
+2 −4
Original line number Diff line number Diff line
@@ -1570,7 +1570,7 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
                        new ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT));
            }
            mDecorCaptionView.addView(root,
                    new ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT));
                    new ViewGroup.MarginLayoutParams(MATCH_PARENT, MATCH_PARENT));
        } else {
            addView(root, new ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT));
        }
@@ -1672,9 +1672,7 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind

    void clearContentView() {
        if (mDecorCaptionView != null) {
            if (mDecorCaptionView.getChildCount() > 1) {
                mDecorCaptionView.removeViewAt(1);
            }
            mDecorCaptionView.removeContentView();
        } else {
            // This window doesn't have caption, so we need to just remove the
            // children of the decor view.
Loading