From eb667fd62628471dd13f8ad0b93710c2e87eb092 Mon Sep 17 00:00:00 2001 From: Andrew Solovay Date: Thu, 31 Mar 2016 14:15:54 -0700 Subject: [PATCH] docs: Updates to Multi-Window/PiP APIs for Preview 2 Per bug b/27528326 , the minimalSize attribute is removed from N Preview 2, replaced by height and width-specific attributes. Per bug b/27942263 , several method names have changed for DP2. DO NOT SUBMIT until the final pre-DP2 push, this change should not go live before DP2 releases. See first comment for doc stage location. bug: 27927931 bug: 27942263 Change-Id: I011ab244218ab123bd28aa9e8cb3bc8858fff815 --- docs/html/preview/features/multi-window.jd | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/docs/html/preview/features/multi-window.jd b/docs/html/preview/features/multi-window.jd index 0fe5ecf32cb9f..0773b329bd7fb 100644 --- a/docs/html/preview/features/multi-window.jd +++ b/docs/html/preview/features/multi-window.jd @@ -251,7 +251,7 @@ android:supportsPictureInPicture=["true" | "false"]
- android:minimalSize + android:minimalHeight, android:minimalWidth
@@ -273,7 +273,8 @@ android:supportsPictureInPicture=["true" | "false"] <layout android:defaultHeight="500dp" android:defaultWidth="600dp" android:gravity="top|end" - android:minimalSize="450dp" /> + android:minimalHeight="450dp" + android:minimalWidth="300dp" /> </activity> @@ -308,12 +309,13 @@ android:supportsPictureInPicture=["true" | "false"]

The following new methods have been added to the {@link android.app.Activity} class to support multi-window display. For details on each method, see the - N Preview SDK Reference. + N Preview SDK + Reference.

- Activity.inMultiWindow() + Activity.isInMultiWindowMode()
@@ -321,7 +323,7 @@ android:supportsPictureInPicture=["true" | "false"]
- Activity.inPictureInPicture() + Activity.isInPictureInPictureMode()
@@ -329,14 +331,14 @@ android:supportsPictureInPicture=["true" | "false"]

Note: Picture-in-picture mode is a special case of - multi-window mode. If myActivity.inPictureInPicture() - returns true, then myActivity.inMultiWindow() also returns - true. + multi-window mode. If myActivity.isInPictureInPictureMode() + returns true, then myActivity.isInMultiWindowMode() also + returns true.

- Activity.onMultiWindowChanged() + Activity.onMultiWindowModeChanged()
@@ -347,7 +349,7 @@ android:supportsPictureInPicture=["true" | "false"]
- Activity.onPictureInPictureChanged() + Activity.onPictureInPictureModeChanged()
@@ -360,14 +362,14 @@ android:supportsPictureInPicture=["true" | "false"]

There are also {@link android.app.Fragment} versions of each of these - methods, for example Fragment.inMultiWindow(). + methods, for example Fragment.isInMultiWindowMode().

Entering picture-in-picture mode

To put an activity in picture-in-picture mode, call the new method - Activity.enterPictureInPicture(). This method has no effect if + Activity.enterPictureInPictureMode(). This method has no effect if the device does not support picture-in-picture mode. For more information, see the Picture-in-Picture documentation.