LoginSignup
11
12

More than 5 years have passed since last update.

Android N で注意すること その4 (Multi Window その2)

Last updated at Posted at 2016-03-12

Overview

3/9(US時間) に、Android N Developer Previewが出ました。

と、同時に developer.android.com において、behavior change が出ましたので、少しずつ読み解いていきたいと思います。

前回は、

Multi Windowでのdrag & 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.

抄訳: 2つのactivityが、画面を共有している間は、ユーザは、1つのactivityから別へ、drag & dropができます。(以前は、ユーザーは自分の単一のactivityの中でのみdrag & dropできました。) この理由から、あなたのアプリが現在サポートしていないならば、drag & dropの機能をあなたは追加したいかもしれません。

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.

抄訳: N previde SDKでは、android.view packageを拡張して、アプリ間のdrag & dropに対応しています。詳細は、以下のclassとmethodについて、N preview SDK referenceを参照ください。

android.view.DropPermissions

Token object responsible for specifying the permissions granted to the app that receives a drop.

抄訳: Token objectは、dropを受信したアプリへpermission承認を特定するための責任を担います。

View.startDragAndDrop()

New alias for View.startDrag(). To enable cross-activity drag and drop, pass the new flag View.DRAG_FLAG_GLOBAL. If you need to give URI permissions to the recipient activity, pass the new flags View.DRAG_FLAG_GLOBAL_URI_READ or View.DRAG_FLAG_GLOBAL_URI_WRITE, as appropriate.

抄訳:

View.cancelDragAndDrop()

Cancels a drag operation currently in progress. Can only be called by the app that originated the drag operation.

抄訳: 現在進行中のdrag操作をキャンセルする。drag操作を開始したアプリだけが呼び出せます。

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.

抄訳: 現在進行中のdrag操作に対するdrag shadowを交換します。drag操作を開始したアプリだけが呼び出せます。

Activity.requestDropPermissions()

Requests the permissions for the content URIs passed with the ClipData contained in a DragEvent.

抄訳: DragEvent内にあるClipDataに渡されるcontent URIへのpermissionをrequestします。

Multi-Window Supportのテストの仕方

Whether or not you update your app for Android N, you should verify how it behaves in multi-window mode in case a user tries to launch it in multiwindow mode on a device running Android N.

抄訳: あなたのアプリをAndroid N向けに更新するしないにかかわらず、あなたは、multi-window modeがどう振る舞うのかを、Android Nが動作するデバイスの上で、確認すべきです。

Test Deviceの設定

If you install Android N on a device, split-screen mode is automatically supported.

抄訳: Android Nをデバイスにインストールするならば、split-screen modeは自動的にサポートされます。

N Preview SDK向けにbuildされていないアプリ

If you did not build your app with the N Preview SDK and the user attempts to use the app in multi-window mode, the system forcibly resizes the app unless the app declares a fixed orientation.

抄訳: N Preview SDK向けにbuildしていなく、ユーザーがmulti-window modeでアプリを使おうとした時は、アプリがfixed orientationを宣言していなければ、systemが強制的にappをresizeします。

If your app does not declare a fixed orientation, you should launch your app on a device running Android N and attempt to put the app in split-screen mode. Verify that the user experience is acceptable when the app is forcibly resized.

抄訳: アプリがfixed orientationを宣言していなかった場合、Android Nが走るデバイスの上で、split-screenモードで、アプリを起動して、そのアプリが強制的にresizeされた時に、ユーザー体験が許容可能か検証してください。

If the app declares a fixed orientation, you should attempt to put the app in multi-window mode. Verify that when you do so, the app remains in full-screen mode.

抄訳: アプリがfixed orientaionを宣言しているときは、multi-windowモードに、アプリを遷移させることを試みてください。そして、アプリがfull screenのままになることを確認してください。

multi-window modeをサポートする場合

If you built your app with the N Preview SDK and have not disabled multi-window support, verify the following behavior under both split-screen and freeform modes.

抄訳: N preview SDK向けにbuildし、multi-windowを無効にしない場合、以下の挙動を、split-screenモードとfreeformモードの両方で確認してください。

  • Launch the app in full-screen mode, then switch to multi-window mode by long-pressing the Overview button. Verify that the app switches properly.

抄訳: 全画面モードでアプリを起動し、Overviewボタンを長押しして、multi-window modeに切り替えてみてください。アプリが適切に切り替わるか確認してください。

  • Launch the app directly in multi-window mode, and verify that the app launches properly. You can launch an app in multi-window mode by pressing the Overview button, then long-pressing the title bar of your app and dragging it to one of the highlighted areas on the screen.

抄訳: multi-window modeで、アプリを直接起動して、アプリが適切に起動するか確認してください。overviewボタンを押すことによって、multi-window modeで起動することができます。そして、アプリのタイトルの部分を長押しして、それをdragして、スクリーンのハイライトされたエリアしてみてください。

  • Resize your app in split-screen mode by dragging the divider line. Verify that the app resizes without crashing, and that necessary UI elements are visible.

抄訳: 境界線をdragすることによって、split-screenモードで、アプリをresizeしてみてください。resizeしても、アプリがクラッシュしないことを確認ください。そして、必要なUI要素が見えることを確認ください。

  • If you have specified minimum dimensions for your app, attempt to resize the app below those dimensions. Verify that you cannot resize the app to be smaller than the specified minimum.

抄訳: 最小のdimension (width/height)を指定しているならば、それらのdimensionよりも小さいサイズにresizeしてください。アプリが最小値よりも小さいサイズにresizeされないことを確認してください。

  • Through all tests, verify that your app's performance is acceptable. For example, verify that there is not too long a lag to update the UI after the app is resized.

抄訳: すべてのテストを通して、アプリケーションのパフォーマンスが許容可能などうかを確認してください。例えば、リサイズしたときに、UIの更新ラグが長すぎないかを確認してください。

Testのchecklist

To verify your app's performance in multi-window mode, try the following operations. You should try these operations in both split-screen and multi-window mode, except where otherwise noted.

抄訳: multi-windowモードでのアプリのパフォーマンスの確認のために、以下を操作を試してください。これらの操作は、例外の記載がなければ、split-screenとmulti-window modeの両方で確認してください。

  • Enter and leave multi-window mode.

抄訳: multi-windowモードへの遷移と離脱

  • Switch from your app to another app, and verify that the app behaves properly while it is visible but not active. For example, if your app is playing video, verify that the video continues to play while the user is interacting with another app.

抄訳: あなたのアプリから他のアプリに切り替えてください。そして、visibleでnot active (pausedのこと)の状態で、アプリが適切に振る舞うかを確認してください。例えば、あなたのアプリが動画を再生しているならば、ユーザーが他のアプリを操作している間、ビデオの再生が継続されることの確認をしてください。

  • In split-screen mode, try moving the dividing bar to make your app both larger and smaller. Try these operations in both side-by-side and one-above-the-other configurations. Verify that the app does not crash, essential functionality is visible, and the resize operation doesn't take too long.

抄訳: split-screenモードでは、境界バーを動かして、アプリを大きくしたり小さくしたりすることを試してみてください。side-by-sideとone-above-the-otherの両方のconfigurationでこれらの操作を試してみてください。アプリがクラッシュしないこと、本質的な機能がvisibleで、リサイズ処理が長すぎないことを確認してください。

  • Perform several resize operations in rapid succession. Verify that your app doesn't crash or leak memory. For information about checking your app's memory usage, see Investigating Your RAM Usage.

抄訳: resize操作を何度か素早く動かしてみてください。あなたのアプリがcrashしたり、leakしたりしないことを確認してください。アプリのmemory usage情報に関しては、Investigating Your RAM Usageを参照してください。

  • Use your app normally in a number of different window configurations, and verify that the app behaves properly. Verify that text is readable, and that UI elements aren't too small to interact with.

抄訳: 複数の異なるwindow configurationで、アプリを通常通り使って、アプリ動作が適切かを確認してください。textが読めるか、UI elementが、操作するのに小さすぎないか。

multi-window supportを無効化する場合

If you disabled multi-window support by setting android:resizableActivity="false", you should launch your app on a device running Android N and attempt to put the app in freeform and split-screen modes. Verify that when you do so, the app remains in full-screen mode.

抄訳: android:resizableActivity="false"を指定して、multi-windowサポートを無効化したい場合は、アプリをAndroid Nが動くデバイスで起動して、アプリをfreeformとsplit-screenのモードにすることを試みてください。そして、あなたのアプリがfull screenモードのままになることを確認してください。

11
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
12