Window.SetResizingCaptionDrawable(Drawable) Method

Definition

Set the drawable that is drawn underneath the caption during the resizing.

[Android.Runtime.Register("setResizingCaptionDrawable", "(Landroid/graphics/drawable/Drawable;)V", "GetSetResizingCaptionDrawable_Landroid_graphics_drawable_Drawable_Handler", ApiSince=24)]
public abstract void SetResizingCaptionDrawable(Android.Graphics.Drawables.Drawable? drawable);
[<Android.Runtime.Register("setResizingCaptionDrawable", "(Landroid/graphics/drawable/Drawable;)V", "GetSetResizingCaptionDrawable_Landroid_graphics_drawable_Drawable_Handler", ApiSince=24)>]
abstract member SetResizingCaptionDrawable : Android.Graphics.Drawables.Drawable -> unit

Parameters

drawable
Drawable
Attributes

Remarks

Set the drawable that is drawn underneath the caption during the resizing.

During the resizing the caption might not be drawn fast enough to match the new dimensions. 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 WindowInsetsController#APPEARANCE_TRANSPARENT_CAPTION_BAR_BACKGROUND, WindowInsetsController#APPEARANCE_LIGHT_CAPTION_BARS, WindowInsetsController#setSystemBarsAppearance(int, int) and WindowInsets#getBoundingRects(int).

Java documentation for android.view.Window.setResizingCaptionDrawable(android.graphics.drawable.Drawable).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to