From 45bdeb4ef8eed682d2ea9a72b2e56d6dd47ea449 Mon Sep 17 00:00:00 2001 From: Andrew Solovay Date: Thu, 3 Mar 2016 09:55:35 -0800 Subject: [PATCH] docs: Continuing work on the N Preview multi-window docs Work on multi-window doc continues here from the previous CL (http://ag/874065/) which we submitted in the run-up to Preview 1. Includes new note about Drag and Drop being extended for multi-window. See first comment for doc stage location. bug: 26558855 Change-Id: I0e71aec894e8917b0df4e586a954127c91d2d1fb --- docs/html/preview/features/multi-window.jd | 88 +++++++++++++++++++--- 1 file changed, 78 insertions(+), 10 deletions(-) diff --git a/docs/html/preview/features/multi-window.jd b/docs/html/preview/features/multi-window.jd index e2c1f47f44df0..bfc4b820edabe 100644 --- a/docs/html/preview/features/multi-window.jd +++ b/docs/html/preview/features/multi-window.jd @@ -52,9 +52,9 @@ page.keywords="multi-window", "android N", "split screen", "free-form"
  • On Nexus Player running the N Developer Preview, apps can put themselves - in picture-in-picture mode, allowing them to continue showing content - while the user browses or interacts with other apps. For more information, - see Picture-in-picture. + in picture-in-picture mode, allowing + them to continue showing content while the user browses or interacts with + other apps.
  • Manufacturers of larger devices can choose to enable freeform @@ -84,10 +84,16 @@ page.keywords="multi-window", "android N", "split screen", "free-form"
  • If the user performs a long press on the Overview button, the device puts the current activity in multi-window mode, and opens the Overview screen to let the user choose another activity to share the screen. -
  • +

    + Users can drag and + drop data from one activity to another while the activities are sharing + the screen. (Previously, users could only drag and drop data within a single + activity.) +

    +

    Multi-Window Lifecycle

    @@ -285,8 +291,7 @@ 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

    @@ -306,7 +311,7 @@ android:supportsPictureInPicture=["true" | "false"] Call to find out if the activity is in picture-in-picture mode.

    - Note: Picture-in-Picture mode is a special case of + Note: Picture-in-picture mode is a special case of multi-window mode. If myActivity.inPictureInPicture() returns true, then myActivity.inMultiWindow() also returns true. @@ -341,14 +346,13 @@ android:supportsPictureInPicture=["true" | "false"] methods, for example Fragment.inMultiWindow().

    -

    Entering Picture-in-Picture Mode

    +

    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 the device does not support picture-in-picture mode. For more information, - see - Picture-in-Picture Mode. + see the Picture-in-Picture documentation.

    Launch New Activities in Multi-Window Mode

    @@ -386,6 +390,70 @@ android:supportsPictureInPicture=["true" | "false"] window in multi-window mode, you must launch it in a new task stack.

    +

    Supporting drag and drop

    + +

    + Users can drag and + drop data from one activity to another while the two activities are + sharing the screen. (Previously, users could only drag and drop data within a + single activity.) For this reason, you may want to add drag and drop + functionality to your app if your app does not currently support it. +

    + +

    + The N Preview SDK extends the android.view + package to support cross-app drag and drop. For details on the following + classes and methods, see the N + Preview SDK Reference. +

    + +
    +
    + android.view.DropPermissions +
    + +
    + Token object responsible for specifying the permissions granted to the app + that receives a drop. +
    + +
    + View.startDragAndDrop() +
    + +
    + New alias for {@link android.view.View#startDrag View.startDrag()}. +
    + +
    + View.cancelDragAndDrop() +
    + +
    + Cancels a drag operation currently in progress. Can only be called by the + app that originated the drag operation. +
    + +
    + View.updateDragShadow() +
    + +
    + Replaces the drag shadow for a drag operation currently in progress. Can + only be called by the app that originated the drag operation. +
    + +
    + Activity.requestDropPermissions() +
    + +
    + Requests the permissions for the content URIs passed with the {@link + android.content.ClipData} contained in a {@link android.view.DragEvent}. +
    +
    +

    Testing Your App's Multi-Window Support