PictureInPictureParams.Builder.SetExpandedAspectRatio(Rational) Method

Definition

Sets the aspect ratio for the expanded picture-in-picture mode.

[Android.Runtime.Register("setExpandedAspectRatio", "(Landroid/util/Rational;)Landroid/app/PictureInPictureParams$Builder;", "GetSetExpandedAspectRatio_Landroid_util_Rational_Handler", ApiSince=33)]
public virtual Android.App.PictureInPictureParams.Builder SetExpandedAspectRatio(Android.Util.Rational? expandedAspectRatio);
[<Android.Runtime.Register("setExpandedAspectRatio", "(Landroid/util/Rational;)Landroid/app/PictureInPictureParams$Builder;", "GetSetExpandedAspectRatio_Landroid_util_Rational_Handler", ApiSince=33)>]
abstract member SetExpandedAspectRatio : Android.Util.Rational -> Android.App.PictureInPictureParams.Builder
override this.SetExpandedAspectRatio : Android.Util.Rational -> Android.App.PictureInPictureParams.Builder

Parameters

expandedAspectRatio
Rational

Rational: must not be between 2.39:1 and 1:2.39 (inclusive). If null, expanded picture-in-picture mode is not supported.

Returns

this builder instance. This value cannot be null.

Attributes

Remarks

Sets the aspect ratio for the expanded picture-in-picture mode. The aspect ratio is defined as the desired width / height. The aspect ratio cannot be changed from horizontal to vertical or vertical to horizontal while the PIP is shown. Any such changes will be ignored. Setting the expanded ratio shows the activity's support for expanded mode. Requires the PackageManager.FEATURE_EXPANDED_PICTURE_IN_PICTURE feature which can be detected using PackageManager.hasSystemFeature(String).

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

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