Skip to content

Most visited

Recently visited

navigation

PictureInPictureParams.Builder

public static class PictureInPictureParams.Builder
extends Object

java.lang.Object
   ↳ android.app.PictureInPictureParams.Builder


Builder class for PictureInPictureParams objects.

Summary

Public constructors

PictureInPictureParams.Builder()

Public methods

PictureInPictureParams build()
PictureInPictureParams.Builder setActions(List<RemoteAction> actions)

Sets the user actions.

PictureInPictureParams.Builder setAspectRatio(Rational aspectRatio)

Sets the aspect ratio.

PictureInPictureParams.Builder setSourceRectHint(Rect launchBounds)

Sets the source bounds hint.

Inherited methods

From class java.lang.Object

Public constructors

PictureInPictureParams.Builder

added in API level 26
PictureInPictureParams.Builder ()

Public methods

build

added in API level 26
PictureInPictureParams build ()

Returns
PictureInPictureParams an immutable PictureInPictureParams to be used when entering or updating the activity in picture-in-picture.

See also:

setActions

added in API level 26
PictureInPictureParams.Builder setActions (List<RemoteAction> actions)

Sets the user actions. If there are more than getMaxNumPictureInPictureActions() actions, then the input list will be truncated to that number.

Parameters
actions List: the new actions to show in the picture-in-picture menu.

Returns
PictureInPictureParams.Builder this builder instance.

See also:

setAspectRatio

added in API level 26
PictureInPictureParams.Builder setAspectRatio (Rational aspectRatio)

Sets the aspect ratio. This aspect ratio is defined as the desired width / height, and does not change upon device rotation.

Parameters
aspectRatio Rational: the new aspect ratio for the activity in picture-in-picture, must be between 2.39:1 and 1:2.39 (inclusive).

Returns
PictureInPictureParams.Builder this builder instance.

setSourceRectHint

added in API level 26
PictureInPictureParams.Builder setSourceRectHint (Rect launchBounds)

Sets the source bounds hint. These bounds are only used when an activity first enters picture-in-picture, and describe the bounds in window coordinates of activity entering picture-in-picture that will be visible following the transition. For the best effect, these bounds should also match the aspect ratio in the arguments.

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

Returns
PictureInPictureParams.Builder this builder instance.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)