diff --git a/docs/html/preview/features/picture-in-picture.jd b/docs/html/preview/features/picture-in-picture.jd index 106ad8b7f065d..893f8c1ca568b 100644 --- a/docs/html/preview/features/picture-in-picture.jd +++ b/docs/html/preview/features/picture-in-picture.jd @@ -99,15 +99,15 @@ in the PIP window.
Activity.enterPictureInPicture(). The following example switches
-to PIP mode when the user selects a dedicated PIP button on a media control
-bar:
+Activity.enterPictureInPictureMode(). The following example
+switches to PIP mode when the user selects a dedicated PIP button on a media
+control bar:
@Override
public void onActionClicked(Action action) {
if (action.getId() == R.id.lb_control_picture_in_picture) {
- getActivity().enterPictureInPicture();
+ getActivity().enterPictureInPictureMode();
return;
}
...
@@ -129,14 +129,14 @@ control bar PIP actions and uses the PIP icon.
When your activity enters PIP mode, your activity should only show video
playback. Remove UI elements before your activity enters PIP,
and restore these elements when your activity becomes full-screen again.
-Override Activity.onPictureInPictureChanged() or
-Fragment.onPictureInPictureChanged() and enable or
+Override Activity.onPictureInPictureModeChanged() or
+Fragment.onPictureInPictureModeChanged() and enable or
disable your UI elements as needed, for example:
@Override
-public void onPictureInPictureChanged(boolean inPictureInPicture) {
- if (inPictureInPicture) {
+public void onPictureInPictureModeChanged(boolean isInPictureInPictureMode) {
+ if (isInPictureInPictureMode) {
// Hide the controls in picture-in-picture mode.
...
} else {
@@ -159,8 +159,8 @@ example:
@Override
public void onPause() {
- // If called due to PIP, do not pause playback
- if (inPictureInPicture()) {
+ // If called while in PIP mode, do not pause playback
+ if (isInPictureInPictureMode()) {
// Continue playback
...
}