79.3 Configuring Picture-in-Picture Parameters
PiP behavior is defined through the use of the PictureInPictureParams class, instances of which can be created using the Builder class as follows:
val params = PictureInPictureParams.Builder().build()
The above code creates a default PictureInPictureParams instance with special parameters defined. The following optional method calls may also be used to customize the parameters:
•setActions() – Used to define actions that can be performed from within the PiP window while the activity is in PiP mode. Actions will be covered in more detail later in this chapter.
•setAspectRatio() – Declares the preferred aspect ratio for appearance of the PiP window. This method takes as an argument a Rational object containing the height width / height ratio.
•setSourceRectHint() – Takes as an argument a Rect object defining the area of the activity screen to be displayed within the PiP window.
...