Language

PictureInPictureParams.Builder.SetSourceRectHint(Rect) Method

Definition

Sets the window-coordinate bounds of an activity transitioning to picture-in-picture.

[Android.Runtime.Register("setSourceRectHint", "(Landroid/graphics/Rect;)Landroid/app/PictureInPictureParams$Builder;", "GetSetSourceRectHint_Landroid_graphics_Rect_Handler", ApiSince=26)]
public virtual Android.App.PictureInPictureParams.Builder? SetSourceRectHint(Android.Graphics.Rect? launchBounds);
[<Android.Runtime.Register("setSourceRectHint", "(Landroid/graphics/Rect;)Landroid/app/PictureInPictureParams$Builder;", "GetSetSourceRectHint_Landroid_graphics_Rect_Handler", ApiSince=26)>]
abstract member SetSourceRectHint : Android.Graphics.Rect -> Android.App.PictureInPictureParams.Builder
override this.SetSourceRectHint : Android.Graphics.Rect -> Android.App.PictureInPictureParams.Builder

Parameters

launchBounds
Rect

Rect: window-coordinate bounds indicating the area of the activity that will still be visible following the transition into picture-in-picture (e.g. the video view bounds in a video player)

Returns

this builder instance.

Attributes

Remarks

Sets the window-coordinate bounds of an activity transitioning to picture-in-picture. The bounds is the area of an activity that will be visible in the transition to picture-in-picture mode. For the best effect, these bounds should also match the aspect ratio in the arguments. In Android 12+ these bounds are also reused to improve the exit transition from picture-in-picture mode. See Support smoother animations when exiting out of PiP mode for more details.

Android reference for android.app.PictureInPictureParams.Builder.setSourceRectHint.

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