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

Commit 8be2d96c authored by Garfield Tan's avatar Garfield Tan
Browse files

Update Window#setResizingCaptionDrawable

New window decorations are drawn in SystemUI, so their responsiveness
isn't limited by app's responsiveness like old captions. Therefore,
there is no need to expose an API to apps to provide a background
drawable to improve UX while resizing.

Apps can choose to draw in caption areas, which is a good replacement of
old drawables.

Bug: 333724879
Test: Builds.
Change-Id: I44c62a591ed5ce962cedd81697234d3a18fdb2e3
parent 0349d538
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -2954,6 +2954,15 @@ public abstract class Window {
     * There is a second caption drawn underneath it that will be fast enough. By default the
     * caption is constructed from the theme. You can provide a drawable, that will be drawn instead
     * to better match your application.
     *
     * Starting in Android 15, this API is a no-op. New window decorations introduced in Android 14
     * are drawn in SystemUI process, and OEMs are responsible to make them responsive to resizing.
     * There is no need to set a background drawable to improve UX anymore since then. Additionally,
     * the foremost activity can draw in caption areas starting in Android 15. Check
     * {@link WindowInsetsController#APPEARANCE_TRANSPARENT_CAPTION_BAR_BACKGROUND},
     * {@link WindowInsetsController#APPEARANCE_LIGHT_CAPTION_BARS},
     * {@link WindowInsetsController#setSystemBarsAppearance(int, int)} and
     * {@link WindowInsets#getBoundingRects(int)}.
     */
    public abstract void setResizingCaptionDrawable(Drawable drawable);

+1 −4
Original line number Diff line number Diff line
@@ -4054,10 +4054,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
    }

    @Override
    public void setResizingCaptionDrawable(Drawable drawable) {
        // TODO(b/333724879): Deprecate this public API. The new caption in WM shell allows the app
        // content to draw behind it directly if requested.
    }
    public void setResizingCaptionDrawable(Drawable drawable) {}

    @Override
    public void setDecorCaptionShade(int decorCaptionShade) {