diff --git a/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java b/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java index 67e9d898e5..907767551c 100644 --- a/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java +++ b/go/quickstep/src/com/android/quickstep/TaskOverlayFactoryGo.java @@ -170,9 +170,9 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory { public void checkPermissions() { ContentResolver contentResolver = mApplicationContext.getContentResolver(); boolean structureEnabled = Settings.Secure.getInt(contentResolver, - Settings.Secure.ASSIST_STRUCTURE_ENABLED, 0) != 0; + Settings.Secure.ASSIST_STRUCTURE_ENABLED, 1) != 0; boolean screenshotEnabled = Settings.Secure.getInt(contentResolver, - Settings.Secure.ASSIST_SCREENSHOT_ENABLED, 0) != 0; + Settings.Secure.ASSIST_SCREENSHOT_ENABLED, 1) != 0; mAssistPermissionsEnabled = structureEnabled && screenshotEnabled; } diff --git a/quickstep/res/drawable/gesture_tutorial_back_left.xml b/quickstep/res/drawable/gesture_tutorial_back_left.xml deleted file mode 100644 index 92ae2025fb..0000000000 --- a/quickstep/res/drawable/gesture_tutorial_back_left.xml +++ /dev/null @@ -1,559 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_back_right.xml b/quickstep/res/drawable/gesture_tutorial_back_right.xml deleted file mode 100644 index 77d9924524..0000000000 --- a/quickstep/res/drawable/gesture_tutorial_back_right.xml +++ /dev/null @@ -1,561 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_home.xml b/quickstep/res/drawable/gesture_tutorial_home.xml deleted file mode 100644 index e77eb7401f..0000000000 --- a/quickstep/res/drawable/gesture_tutorial_home.xml +++ /dev/null @@ -1,394 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/quickstep/res/drawable/gesture_tutorial_loop_back_left.xml b/quickstep/res/drawable/gesture_tutorial_loop_back_left.xml new file mode 100644 index 0000000000..8bf305cd15 --- /dev/null +++ b/quickstep/res/drawable/gesture_tutorial_loop_back_left.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_loop_back_right.xml b/quickstep/res/drawable/gesture_tutorial_loop_back_right.xml new file mode 100644 index 0000000000..812c54c9e2 --- /dev/null +++ b/quickstep/res/drawable/gesture_tutorial_loop_back_right.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_loop_bottom_edge.xml b/quickstep/res/drawable/gesture_tutorial_loop_bottom_edge.xml new file mode 100644 index 0000000000..3efb52d16f --- /dev/null +++ b/quickstep/res/drawable/gesture_tutorial_loop_bottom_edge.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_loop_gesture_back_right.xml b/quickstep/res/drawable/gesture_tutorial_loop_gesture_back_right.xml new file mode 100644 index 0000000000..c41d077218 --- /dev/null +++ b/quickstep/res/drawable/gesture_tutorial_loop_gesture_back_right.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_loop_gesture_home.xml b/quickstep/res/drawable/gesture_tutorial_loop_gesture_home.xml new file mode 100644 index 0000000000..c5dd41b520 --- /dev/null +++ b/quickstep/res/drawable/gesture_tutorial_loop_gesture_home.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_loop_gesture_left_edge.xml b/quickstep/res/drawable/gesture_tutorial_loop_gesture_left_edge.xml new file mode 100644 index 0000000000..c41d077218 --- /dev/null +++ b/quickstep/res/drawable/gesture_tutorial_loop_gesture_left_edge.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_loop_gesture_overview.xml b/quickstep/res/drawable/gesture_tutorial_loop_gesture_overview.xml new file mode 100644 index 0000000000..5d87805e3c --- /dev/null +++ b/quickstep/res/drawable/gesture_tutorial_loop_gesture_overview.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_loop_home.xml b/quickstep/res/drawable/gesture_tutorial_loop_home.xml new file mode 100644 index 0000000000..ed072a9526 --- /dev/null +++ b/quickstep/res/drawable/gesture_tutorial_loop_home.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_loop_left_edge.xml b/quickstep/res/drawable/gesture_tutorial_loop_left_edge.xml new file mode 100644 index 0000000000..07caaea042 --- /dev/null +++ b/quickstep/res/drawable/gesture_tutorial_loop_left_edge.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_loop_overview.xml b/quickstep/res/drawable/gesture_tutorial_loop_overview.xml new file mode 100644 index 0000000000..acf0c4c9d0 --- /dev/null +++ b/quickstep/res/drawable/gesture_tutorial_loop_overview.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_loop_right_edge.xml b/quickstep/res/drawable/gesture_tutorial_loop_right_edge.xml new file mode 100644 index 0000000000..d86b653e50 --- /dev/null +++ b/quickstep/res/drawable/gesture_tutorial_loop_right_edge.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_motion_back_left.xml b/quickstep/res/drawable/gesture_tutorial_motion_back_left.xml new file mode 100644 index 0000000000..e944c0e919 --- /dev/null +++ b/quickstep/res/drawable/gesture_tutorial_motion_back_left.xml @@ -0,0 +1,1412 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_motion_back_right.xml b/quickstep/res/drawable/gesture_tutorial_motion_back_right.xml new file mode 100644 index 0000000000..f8d649abb2 --- /dev/null +++ b/quickstep/res/drawable/gesture_tutorial_motion_back_right.xml @@ -0,0 +1,1413 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_motion_home.xml b/quickstep/res/drawable/gesture_tutorial_motion_home.xml new file mode 100644 index 0000000000..9dbaee6247 --- /dev/null +++ b/quickstep/res/drawable/gesture_tutorial_motion_home.xml @@ -0,0 +1,1254 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_motion_overview.xml b/quickstep/res/drawable/gesture_tutorial_motion_overview.xml new file mode 100644 index 0000000000..4751fa9e2b --- /dev/null +++ b/quickstep/res/drawable/gesture_tutorial_motion_overview.xml @@ -0,0 +1,1623 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quickstep/res/drawable/gesture_tutorial_overview.xml b/quickstep/res/drawable/gesture_tutorial_overview.xml deleted file mode 100644 index c4ca72f5a1..0000000000 --- a/quickstep/res/drawable/gesture_tutorial_overview.xml +++ /dev/null @@ -1,823 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/quickstep/res/drawable/mock_conversation.xml b/quickstep/res/drawable/mock_conversation.xml new file mode 100644 index 0000000000..272d9ed8a8 --- /dev/null +++ b/quickstep/res/drawable/mock_conversation.xml @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quickstep/res/drawable/mock_conversations_list.xml b/quickstep/res/drawable/mock_conversations_list.xml new file mode 100644 index 0000000000..2dbc88f0bf --- /dev/null +++ b/quickstep/res/drawable/mock_conversations_list.xml @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quickstep/res/drawable/mock_webpage.xml b/quickstep/res/drawable/mock_webpage.xml new file mode 100644 index 0000000000..93b22b7d31 --- /dev/null +++ b/quickstep/res/drawable/mock_webpage.xml @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quickstep/res/drawable/sandbox_fake_google_search.xml b/quickstep/res/drawable/sandbox_fake_google_search.xml deleted file mode 100644 index f06b92784c..0000000000 --- a/quickstep/res/drawable/sandbox_fake_google_search.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/quickstep/res/layout/gesture_tutorial_fragment.xml b/quickstep/res/layout/gesture_tutorial_fragment.xml index 700dd1f9f5..5f827309d9 100644 --- a/quickstep/res/layout/gesture_tutorial_fragment.xml +++ b/quickstep/res/layout/gesture_tutorial_fragment.xml @@ -65,6 +65,17 @@ android:scaleType="fitXY" android:visibility="gone"/> + + Make sure you swipe from the far-left edge. Make sure you swipe from the left edge to the middle of the screen and let go. - - That\'s it! Now try swiping from the right edge. + + Nice! Now swipe from the right to go back + + You can also go back to the last screen by swiping from the right edge to the middle of the screen. Make sure you swipe from the far-right edge. Make sure you swipe from the right edge to the middle of the screen and let go. - - You completed the go back gesture. Next up, learn how to go Home. + + You completed the go back gesture. Next up, learn how to switch apps. + + You completed the go back gesture. Make sure you don\'t swipe too close to the bottom of the screen. To change the sensitivity of the back gesture, go to Settings - Swipe to go back + Swipe from the left to go back - To go back to the last screen, swipe from the left or right edge to the middle of the screen. + To go back to the last screen you were on, swipe from the left edge to the middle of the screen. Make sure you swipe up from the bottom edge of the screen. Make sure you don\'t pause before letting go. Make sure you swipe straight up. - You completed the go Home gesture. Next up, learn how to switch apps. + + You completed the go Home gesture. Next up, learn how to go back. + + You completed the go Home gesture. Swipe to go home @@ -130,7 +137,10 @@ Try holding the window for longer before releasing. Make sure you swipe straight up, then pause. - You completed the switch apps gesture. You\'re ready to use your phone! + + You learned how to use gestures. To turn off gestures, go to Settings. + + You completed the switch apps gesture. Swipe to switch apps diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java index 1b54211beb..de9b361197 100644 --- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java @@ -783,7 +783,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener final FloatingWidgetView floatingView = FloatingWidgetView.getFloatingWidgetView(mLauncher, v, widgetBackgroundBounds, new Size(windowTargetBounds.width(), windowTargetBounds.height()), - finalWindowRadius); + finalWindowRadius, appTargetsAreTranslucent); final float initialWindowRadius = supportsRoundedCornersOnWindows(mLauncher.getResources()) ? floatingView.getInitialCornerRadius() : 0; diff --git a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java index e508690113..814cf93936 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java @@ -99,13 +99,15 @@ public abstract class BaseRecentsViewStateController config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_X, LINEAR)); setter.setFloat(mRecentsView, ADJACENT_PAGE_VERTICAL_OFFSET, scaleAndOffset[2], config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, LINEAR)); + setter.setFloat(mRecentsView, TASK_SECONDARY_TRANSLATION, 0f, + config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, LINEAR)); PagedOrientationHandler orientationHandler = ((RecentsView) mLauncher.getOverviewPanel()).getPagedOrientationHandler(); FloatProperty taskViewsFloat = orientationHandler.getSplitSelectTaskOffset( TASK_PRIMARY_SPLIT_TRANSLATION, TASK_SECONDARY_SPLIT_TRANSLATION, mLauncher.getDeviceProfile()); setter.setFloat(mRecentsView, taskViewsFloat, - toState.getOverviewSecondaryTranslation(mLauncher), LINEAR); + toState.getSplitSelectTranslation(mLauncher), LINEAR); setter.setFloat(mRecentsView, getContentAlphaProperty(), toState.overviewUi ? 1 : 0, config.getInterpolator(ANIM_OVERVIEW_FADE, AGGRESSIVE_EASE_IN_OUT)); diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java b/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java index 722d74a55a..6968494b0f 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java @@ -41,11 +41,14 @@ public class SplitScreenSelectState extends OverviewState { } @Override - public float getOverviewSecondaryTranslation(Launcher launcher) { + public float getSplitSelectTranslation(Launcher launcher) { RecentsView recentsView = launcher.getOverviewPanel(); - PagedOrientationHandler orientationHandler = recentsView.getPagedOrientationHandler(); int splitPosition = recentsView.getSplitPlaceholder().getSplitController() .getActiveSplitPositionOption().mStagePosition; + if (!recentsView.shouldShiftThumbnailsForSplitSelect(splitPosition)) { + return 0f; + } + PagedOrientationHandler orientationHandler = recentsView.getPagedOrientationHandler(); int direction = orientationHandler.getSplitTranslationDirectionFactor(splitPosition); return launcher.getResources().getDimension(R.dimen.split_placeholder_size) * direction; } diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index d04bfe95e2..afe989df66 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -1047,7 +1047,7 @@ public abstract class AbsSwipeUpHandler, } protected abstract HomeAnimationFactory createHomeAnimationFactory( - ArrayList launchCookies, long duration); + ArrayList launchCookies, long duration, boolean isTargetTranslucent); private final TaskStackChangeListener mActivityRestartListener = new TaskStackChangeListener() { @Override @@ -1091,7 +1091,9 @@ public abstract class AbsSwipeUpHandler, final ArrayList cookies = runningTaskTarget != null ? runningTaskTarget.taskInfo.launchCookies : new ArrayList<>(); - HomeAnimationFactory homeAnimFactory = createHomeAnimationFactory(cookies, duration); + boolean isTranslucent = runningTaskTarget != null && runningTaskTarget.isTranslucent; + HomeAnimationFactory homeAnimFactory = + createHomeAnimationFactory(cookies, duration, isTranslucent); mIsSwipingPipToHome = homeAnimFactory.supportSwipePipToHome() && runningTaskTarget != null && runningTaskTarget.taskInfo.pictureInPictureParams != null @@ -1519,7 +1521,6 @@ public abstract class AbsSwipeUpHandler, private void setupLauncherUiAfterSwipeUpToRecentsAnimation() { endLauncherTransitionController(); - mActivityInterface.onSwipeUpToRecentsComplete(); mRecentsView.onSwipeUpAnimationSuccess(); if (LIVE_TILE.get()) { mTaskAnimationManager.setLiveTileCleanUpHandler(mInputConsumerProxy::destroy); diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java index b60b1be24b..c8865c4b3b 100644 --- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java +++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java @@ -99,16 +99,8 @@ public abstract class BaseActivityInterface launchCookies, - long duration) { + long duration, boolean isTargetTranslucent) { mActiveAnimationFactory = new FallbackHomeAnimationFactory(duration); ActivityOptions options = ActivityOptions.makeCustomAnimation(mContext, 0, 0); Intent intent = new Intent(mGestureState.getHomeIntent()); diff --git a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java index c43d3c9653..5217c3b169 100644 --- a/quickstep/src/com/android/quickstep/LauncherActivityInterface.java +++ b/quickstep/src/com/android/quickstep/LauncherActivityInterface.java @@ -21,6 +21,7 @@ import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.LauncherState.QUICK_SWITCH; import static com.android.launcher3.anim.AnimatorListeners.forEndCallback; import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SHOWING; import android.animation.Animator; @@ -84,9 +85,13 @@ public final class LauncherActivityInterface extends if (launcher == null) { return; } - // Ensure recents is at the correct position for NORMAL state. For example, when we detach - // recents, we assume the first task is invisible, making translation off by one task. - launcher.getStateManager().reapplyState(); + // When going to home, the state animator we use has SKIP_OVERVIEW because we assume that + // setRecentsAttachedToAppWindow() will handle animating Overview instead. Thus, at the end + // of the animation, we should ensure recents is at the correct position for NORMAL state. + // For example, when doing a long swipe to home, RecentsView may be scaled down. This is + // relatively expensive, so do it on the next frame instead of critical path. + MAIN_EXECUTOR.getHandler().post(launcher.getStateManager()::reapplyState); + launcher.getRootView().setForceHideBackArrow(false); notifyRecentsOfOrientation(deviceState.getRotationTouchHelper()); } diff --git a/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java b/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java index 46cd8a2cf9..267227dce5 100644 --- a/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java +++ b/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java @@ -80,7 +80,7 @@ public class LauncherSwipeHandlerV2 extends @Override protected HomeAnimationFactory createHomeAnimationFactory(ArrayList launchCookies, - long duration) { + long duration, boolean isTargetTranslucent) { if (mActivity == null) { mStateCallback.addChangeListener(STATE_LAUNCHER_PRESENT | STATE_HANDLER_INVALIDATED, isPresent -> mRecentsView.startHome()); @@ -103,7 +103,8 @@ public class LauncherSwipeHandlerV2 extends return new LauncherHomeAnimationFactory(); } if (workspaceView instanceof LauncherAppWidgetHostView) { - return createWidgetHomeAnimationFactory((LauncherAppWidgetHostView) workspaceView); + return createWidgetHomeAnimationFactory((LauncherAppWidgetHostView) workspaceView, + isTargetTranslucent); } return createIconHomeAnimationFactory(workspaceView); } @@ -235,7 +236,7 @@ public class LauncherSwipeHandlerV2 extends } private HomeAnimationFactory createWidgetHomeAnimationFactory( - LauncherAppWidgetHostView hostView) { + LauncherAppWidgetHostView hostView, boolean isTargetTranslucent) { RectF backgroundLocation = new RectF(); Rect crop = new Rect(); @@ -243,7 +244,7 @@ public class LauncherSwipeHandlerV2 extends Size windowSize = new Size(crop.width(), crop.height()); FloatingWidgetView floatingWidgetView = FloatingWidgetView.getFloatingWidgetView(mActivity, hostView, backgroundLocation, windowSize, - mTaskViewSimulator.getCurrentCornerRadius()); + mTaskViewSimulator.getCurrentCornerRadius(), isTargetTranslucent); return new LauncherHomeAnimationFactory() { diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java index 110b3563ac..e821e06180 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java @@ -31,6 +31,7 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_A import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BUBBLES_EXPANDED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_GLOBAL_ACTIONS_SHOWING; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_HOME_DISABLED; +import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_MAGNIFICATION_OVERLAP; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NAV_BAR_HIDDEN; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_ONE_HANDED_ACTIVE; @@ -404,6 +405,7 @@ public class RecentsAnimationDeviceState implements return canStartWithNavHidden && (mSystemUiStateFlags & SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED) == 0 && (mSystemUiStateFlags & SYSUI_STATE_QUICK_SETTINGS_EXPANDED) == 0 + && (mSystemUiStateFlags & SYSUI_STATE_MAGNIFICATION_OVERLAP) == 0 && ((mSystemUiStateFlags & SYSUI_STATE_HOME_DISABLED) == 0 || (mSystemUiStateFlags & SYSUI_STATE_OVERVIEW_DISABLED) == 0); } diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index 027dd1cf8d..edc7a3c8b8 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -534,13 +534,6 @@ public class TouchInteractionService extends Service implements PluginListener mTutorialFragment.changeController(RIGHT_EDGE_BACK_NAVIGATION)); break; case BACK_CANCELLED_FROM_LEFT: diff --git a/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialFragment.java b/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialFragment.java index 71d00f03a2..830d0ad54e 100644 --- a/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialFragment.java +++ b/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialFragment.java @@ -29,8 +29,16 @@ public class BackGestureTutorialFragment extends TutorialFragment { @Override Integer getFeedbackVideoResId() { return mTutorialType == TutorialType.RIGHT_EDGE_BACK_NAVIGATION - ? R.drawable.gesture_tutorial_back_right - : R.drawable.gesture_tutorial_back_left; + ? R.drawable.gesture_tutorial_motion_back_right + : R.drawable.gesture_tutorial_motion_back_left; + } + + @Nullable + @Override + Integer getGestureVideoResId() { + return mTutorialType == TutorialType.RIGHT_EDGE_BACK_NAVIGATION + ? R.drawable.gesture_tutorial_loop_back_right + : R.drawable.gesture_tutorial_loop_back_left; } @Override diff --git a/quickstep/src/com/android/quickstep/interaction/EdgeBackGestureHandler.java b/quickstep/src/com/android/quickstep/interaction/EdgeBackGestureHandler.java index 9489bac266..c532f8e43d 100644 --- a/quickstep/src/com/android/quickstep/interaction/EdgeBackGestureHandler.java +++ b/quickstep/src/com/android/quickstep/interaction/EdgeBackGestureHandler.java @@ -30,6 +30,7 @@ import android.view.ViewGroup.LayoutParams; import androidx.annotation.Nullable; import com.android.launcher3.ResourceUtils; +import com.android.launcher3.Utilities; /** * Utility class to handle edge swipes for back gestures. @@ -47,9 +48,9 @@ public class EdgeBackGestureHandler implements OnTouchListener { private final Point mDisplaySize = new Point(); // The edge width where touch down is allowed - private int mEdgeWidth; + private final int mEdgeWidth; // The bottom gesture area height - private int mBottomGestureHeight; + private final int mBottomGestureHeight; // The slop to distinguish between horizontal and vertical motion private final float mTouchSlop; // Duration after which we consider the event as longpress. @@ -97,7 +98,9 @@ public class EdgeBackGestureHandler implements OnTouchListener { mBottomGestureHeight = ResourceUtils.getNavbarSize(ResourceUtils.NAVBAR_BOTTOM_GESTURE_SIZE, res); - mEdgeWidth = ResourceUtils.getNavbarSize("config_backGestureInset", res); + int systemBackRegion = ResourceUtils.getNavbarSize("config_backGestureInset", res); + // System back region is 0 if gesture nav is not currently enabled. + mEdgeWidth = systemBackRegion == 0 ? Utilities.dpToPx(18) : systemBackRegion; } void setViewGroupParent(@Nullable ViewGroup parent) { diff --git a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java index 2e580af18f..ff50a0e01b 100644 --- a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java @@ -41,6 +41,11 @@ final class HomeGestureTutorialController extends SwipeUpGestureTutorialControll return R.string.home_gesture_intro_subtitle; } + @Override + protected int getMockAppTaskThumbnailResId() { + return R.drawable.mock_webpage; + } + @Override public void onBackGestureAttempted(BackGestureResult result) { switch (mTutorialType) { @@ -72,10 +77,13 @@ final class HomeGestureTutorialController extends SwipeUpGestureTutorialControll case HOME_NAVIGATION: switch (result) { case HOME_GESTURE_COMPLETED: { + mTutorialFragment.releaseGestureVideoView(); animateFakeTaskViewHome(finalVelocity, null); showActionButton(); - showFeedback(R.string.home_gesture_feedback_complete, - true); + int subtitleResId = mTutorialFragment.getNumSteps() == 1 + ? R.string.home_gesture_feedback_complete_without_follow_up + : R.string.home_gesture_feedback_complete_with_follow_up; + showFeedback(subtitleResId, true); break; } case HOME_NOT_STARTED_TOO_FAR_FROM_EDGE: diff --git a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialFragment.java b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialFragment.java index ebddc6934b..47964d27c3 100644 --- a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialFragment.java +++ b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialFragment.java @@ -25,7 +25,13 @@ public class HomeGestureTutorialFragment extends TutorialFragment { @Nullable @Override Integer getFeedbackVideoResId() { - return R.drawable.gesture_tutorial_home; + return R.drawable.gesture_tutorial_motion_home; + } + + @Nullable + @Override + Integer getGestureVideoResId() { + return R.drawable.gesture_tutorial_loop_home; } @Override diff --git a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java index 06610e6ad6..7b0961e121 100644 --- a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java @@ -48,6 +48,11 @@ final class OverviewGestureTutorialController extends SwipeUpGestureTutorialCont return R.string.overview_gesture_intro_subtitle; } + @Override + protected int getMockAppTaskThumbnailResId() { + return R.drawable.mock_conversations_list; + } + @Override public void onBackGestureAttempted(BackGestureResult result) { switch (mTutorialType) { @@ -90,6 +95,7 @@ final class OverviewGestureTutorialController extends SwipeUpGestureTutorialCont showFeedback(R.string.overview_gesture_feedback_swipe_too_far_from_edge); break; case OVERVIEW_GESTURE_COMPLETED: + mTutorialFragment.releaseGestureVideoView(); PendingAnimation anim = new PendingAnimation(300); anim.setFloat(mTaskViewSwipeUpAnimation .getCurrentShift(), AnimatedFloat.VALUE, 1, ACCEL); @@ -97,7 +103,10 @@ final class OverviewGestureTutorialController extends SwipeUpGestureTutorialCont animset.start(); mRunningWindowAnim = SwipeUpAnimationLogic.RunningWindowAnim.wrap(animset); onMotionPaused(true /*arbitrary value*/); - showFeedback(R.string.overview_gesture_feedback_complete, true); + int subtitleResId = mTutorialFragment.getNumSteps() == 1 + ? R.string.overview_gesture_feedback_complete_without_follow_up + : R.string.overview_gesture_feedback_complete_with_follow_up; + showFeedback(subtitleResId, true); break; case HOME_OR_OVERVIEW_NOT_STARTED_WRONG_SWIPE_DIRECTION: case HOME_OR_OVERVIEW_CANCELLED: diff --git a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialFragment.java b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialFragment.java index 86344ab292..c919b96a46 100644 --- a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialFragment.java +++ b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialFragment.java @@ -25,7 +25,13 @@ public class OverviewGestureTutorialFragment extends TutorialFragment { @Nullable @Override Integer getFeedbackVideoResId() { - return R.drawable.gesture_tutorial_overview; + return R.drawable.gesture_tutorial_motion_overview; + } + + @Nullable + @Override + Integer getGestureVideoResId() { + return R.drawable.gesture_tutorial_loop_overview; } @Override diff --git a/quickstep/src/com/android/quickstep/interaction/TutorialController.java b/quickstep/src/com/android/quickstep/interaction/TutorialController.java index 1128a7ca24..f9d5c94375 100644 --- a/quickstep/src/com/android/quickstep/interaction/TutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/TutorialController.java @@ -62,6 +62,7 @@ abstract class TutorialController implements BackGestureAttemptCallback, final ImageButton mCloseButton; final ViewGroup mFeedbackView; final ImageView mFeedbackVideoView; + final ImageView mGestureVideoView; final ImageView mFakeLauncherView; final ClipIconView mFakeIconView; final View mFakeTaskView; @@ -84,6 +85,7 @@ abstract class TutorialController implements BackGestureAttemptCallback, mCloseButton.setOnClickListener(button -> showSkipTutorialDialog()); mFeedbackView = rootView.findViewById(R.id.gesture_tutorial_fragment_feedback_view); mFeedbackVideoView = rootView.findViewById(R.id.gesture_tutorial_feedback_video); + mGestureVideoView = rootView.findViewById(R.id.gesture_tutorial_gesture_video); mFakeLauncherView = rootView.findViewById(R.id.gesture_tutorial_fake_launcher_view); mFakeIconView = rootView.findViewById(R.id.gesture_tutorial_fake_icon_view); mFakeTaskView = rootView.findViewById(R.id.gesture_tutorial_fake_task_view); @@ -173,8 +175,8 @@ abstract class TutorialController implements BackGestureAttemptCallback, /** * Show feedback reflecting a failed gesture attempt. **/ - void showFeedback(int subtitleResId, @Nullable Runnable successEndAction) { - showFeedback(subtitleResId, successEndAction, false); + void showFeedback(int titleResId, int subtitleResId, @Nullable Runnable successEndAction) { + showFeedback(titleResId, subtitleResId, successEndAction, false); } /** @@ -212,7 +214,8 @@ abstract class TutorialController implements BackGestureAttemptCallback, mHideFeedbackEndAction = successEndAction; AnimatedVectorDrawable tutorialAnimation = mTutorialFragment.getTutorialAnimation(); - if (tutorialAnimation != null) { + AnimatedVectorDrawable gestureAnimation = mTutorialFragment.getGestureAnimation(); + if (tutorialAnimation != null && gestureAnimation != null) { if (successEndAction == null) { if (tutorialAnimation.isRunning()) { tutorialAnimation.reset(); @@ -223,6 +226,11 @@ abstract class TutorialController implements BackGestureAttemptCallback, public void onAnimationStart(Drawable drawable) { super.onAnimationStart(drawable); + mGestureVideoView.setVisibility(View.GONE); + if (gestureAnimation.isRunning()) { + gestureAnimation.stop(); + } + mFeedbackView.setTranslationY( -mFeedbackView.getHeight() - mFeedbackView.getTop()); mFeedbackView.setVisibility(View.VISIBLE); @@ -236,6 +244,9 @@ abstract class TutorialController implements BackGestureAttemptCallback, public void onAnimationEnd(Drawable drawable) { super.onAnimationEnd(drawable); + mGestureVideoView.setVisibility(View.VISIBLE); + gestureAnimation.start(); + mFeedbackView.removeCallbacks(mHideFeedbackRunnable); mFeedbackView.post(mHideFeedbackRunnable); diff --git a/quickstep/src/com/android/quickstep/interaction/TutorialFragment.java b/quickstep/src/com/android/quickstep/interaction/TutorialFragment.java index b6663b8b81..0220f2d21f 100644 --- a/quickstep/src/com/android/quickstep/interaction/TutorialFragment.java +++ b/quickstep/src/com/android/quickstep/interaction/TutorialFragment.java @@ -51,8 +51,10 @@ abstract class TutorialFragment extends Fragment implements OnTouchListener { EdgeBackGestureHandler mEdgeBackGestureHandler; NavBarGestureHandler mNavBarGestureHandler; private ImageView mFeedbackVideoView; + private ImageView mGestureVideoView; @Nullable private AnimatedVectorDrawable mTutorialAnimation = null; + @Nullable private AnimatedVectorDrawable mGestureAnimation = null; private boolean mIntroductionShown = false; public static TutorialFragment newInstance(TutorialType tutorialType) { @@ -96,11 +98,20 @@ abstract class TutorialFragment extends Fragment implements OnTouchListener { return null; } + @Nullable Integer getGestureVideoResId() { + return null; + } + @Nullable AnimatedVectorDrawable getTutorialAnimation() { return mTutorialAnimation; } + @Nullable + AnimatedVectorDrawable getGestureAnimation() { + return mGestureAnimation; + } + abstract TutorialController createController(TutorialType type); abstract Class getControllerClass(); @@ -135,6 +146,7 @@ abstract class TutorialFragment extends Fragment implements OnTouchListener { }); mRootView.setOnTouchListener(this); mFeedbackVideoView = mRootView.findViewById(R.id.gesture_tutorial_feedback_video); + mGestureVideoView = mRootView.findViewById(R.id.gesture_tutorial_gesture_video); return mRootView; } @@ -162,7 +174,7 @@ abstract class TutorialFragment extends Fragment implements OnTouchListener { boolean updateFeedbackVideo() { Integer feedbackVideoResId = getFeedbackVideoResId(); - if (feedbackVideoResId == null || getContext() == null) { + if (feedbackVideoResId == null || getContext() == null || !updateGestureVideo()) { return false; } mTutorialAnimation = (AnimatedVectorDrawable) getContext().getDrawable(feedbackVideoResId); @@ -190,6 +202,29 @@ abstract class TutorialFragment extends Fragment implements OnTouchListener { return true; } + boolean updateGestureVideo() { + Integer gestureVideoResId = getGestureVideoResId(); + if (gestureVideoResId == null || getContext() == null) { + return false; + } + mGestureAnimation = (AnimatedVectorDrawable) getContext().getDrawable(gestureVideoResId); + + if (mGestureAnimation != null) { + mGestureAnimation.registerAnimationCallback(new Animatable2.AnimationCallback() { + + @Override + public void onAnimationEnd(Drawable drawable) { + super.onAnimationEnd(drawable); + + mGestureAnimation.start(); + } + }); + } + mGestureVideoView.setImageDrawable(mGestureAnimation); + + return true; + } + void releaseFeedbackVideoView() { if (mTutorialAnimation != null && mTutorialAnimation.isRunning()) { mTutorialAnimation.stop(); @@ -198,6 +233,14 @@ abstract class TutorialFragment extends Fragment implements OnTouchListener { mFeedbackVideoView.setVisibility(View.GONE); } + void releaseGestureVideoView() { + if (mGestureAnimation != null && mGestureAnimation.isRunning()) { + mGestureAnimation.stop(); + } + + mGestureVideoView.setVisibility(View.GONE); + } + @Override public void onResume() { super.onResume(); diff --git a/quickstep/src/com/android/quickstep/views/FloatingWidgetView.java b/quickstep/src/com/android/quickstep/views/FloatingWidgetView.java index ed54f1007e..121e09400f 100644 --- a/quickstep/src/com/android/quickstep/views/FloatingWidgetView.java +++ b/quickstep/src/com/android/quickstep/views/FloatingWidgetView.java @@ -57,6 +57,7 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, private Runnable mEndRunnable; private Runnable mFastFinishRunnable; private Runnable mOnTargetChangeRunnable; + private boolean mAppTargetIsTranslucent; public FloatingWidgetView(Context context) { this(context, null); @@ -142,10 +143,12 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, } private void init(DragLayer dragLayer, LauncherAppWidgetHostView originalView, - RectF widgetBackgroundPosition, Size windowSize, float windowCornerRadius) { + RectF widgetBackgroundPosition, Size windowSize, float windowCornerRadius, + boolean appTargetIsTranslucent) { mAppWidgetView = originalView; mAppWidgetView.beginDeferringUpdates(); mBackgroundPosition = widgetBackgroundPosition; + mAppTargetIsTranslucent = appTargetIsTranslucent; mEndRunnable = () -> finish(dragLayer); mAppWidgetBackgroundView = RoundedCornerEnforcement.findBackground(mAppWidgetView); @@ -155,11 +158,13 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, getRelativePosition(mAppWidgetBackgroundView, dragLayer, mBackgroundPosition); getRelativePosition(mAppWidgetBackgroundView, mAppWidgetView, mBackgroundOffset); - mBackgroundView.init(mAppWidgetView, mAppWidgetBackgroundView, windowCornerRadius); - // Layout call before GhostView creation so that the overlaid view isn't clipped - layout(0, 0, windowSize.getWidth(), windowSize.getHeight()); - mForegroundOverlayView = GhostView.addGhost(mAppWidgetView, this); - positionViews(); + if (!mAppTargetIsTranslucent) { + mBackgroundView.init(mAppWidgetView, mAppWidgetBackgroundView, windowCornerRadius); + // Layout call before GhostView creation so that the overlaid view isn't clipped + layout(0, 0, windowSize.getWidth(), windowSize.getHeight()); + mForegroundOverlayView = GhostView.addGhost(mAppWidgetView, this); + positionViews(); + } mListenerView.setListener(this::fastFinish); dragLayer.addView(mListenerView); @@ -179,7 +184,7 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, */ public void update(RectF backgroundPosition, float floatingWidgetAlpha, float foregroundAlpha, float fallbackBackgroundAlpha, float cornerRadiusProgress) { - if (isUninitialized()) return; + if (isUninitialized() || mAppTargetIsTranslucent) return; setAlpha(floatingWidgetAlpha); mBackgroundView.update(cornerRadiusProgress, fallbackBackgroundAlpha); mAppWidgetView.setAlpha(foregroundAlpha); @@ -203,13 +208,16 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, backgroundParams.height = (int) mBackgroundPosition.height(); mBackgroundView.setLayoutParams(backgroundParams); - sTmpMatrix.reset(); - float foregroundScale = mBackgroundPosition.width() / mAppWidgetBackgroundView.getWidth(); - sTmpMatrix.setTranslate(-mBackgroundOffset.left - mAppWidgetView.getLeft(), - -mBackgroundOffset.top - mAppWidgetView.getTop()); - sTmpMatrix.postScale(foregroundScale, foregroundScale); - sTmpMatrix.postTranslate(mBackgroundPosition.left, mBackgroundPosition.top); - mForegroundOverlayView.setMatrix(sTmpMatrix); + if (mForegroundOverlayView != null) { + sTmpMatrix.reset(); + float foregroundScale = + mBackgroundPosition.width() / mAppWidgetBackgroundView.getWidth(); + sTmpMatrix.setTranslate(-mBackgroundOffset.left - mAppWidgetView.getLeft(), + -mBackgroundOffset.top - mAppWidgetView.getTop()); + sTmpMatrix.postScale(foregroundScale, foregroundScale); + sTmpMatrix.postTranslate(mBackgroundPosition.left, mBackgroundPosition.top); + mForegroundOverlayView.setMatrix(sTmpMatrix); + } } private void finish(DragLayer dragLayer) { @@ -254,7 +262,7 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, */ public static FloatingWidgetView getFloatingWidgetView(Launcher launcher, LauncherAppWidgetHostView originalView, RectF widgetBackgroundPosition, - Size windowSize, float windowCornerRadius) { + Size windowSize, float windowCornerRadius, boolean appTargetsAreTranslucent) { final DragLayer dragLayer = launcher.getDragLayer(); ViewGroup parent = (ViewGroup) dragLayer.getParent(); FloatingWidgetView floatingView = @@ -262,7 +270,7 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, floatingView.recycle(); floatingView.init(dragLayer, originalView, widgetBackgroundPosition, windowSize, - windowCornerRadius); + windowCornerRadius, appTargetsAreTranslucent); parent.addView(floatingView); return floatingView; } diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index dfe0c4347a..21100c4499 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -127,6 +127,7 @@ import com.android.launcher3.util.DynamicResource; import com.android.launcher3.util.IntSet; import com.android.launcher3.util.MultiValueAlpha; import com.android.launcher3.util.ResourceBasedOverride.Overrides; +import com.android.launcher3.util.SplitConfigurationOptions; import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption; import com.android.launcher3.util.Themes; import com.android.launcher3.util.TranslateEdgeEffect; @@ -1584,12 +1585,16 @@ public abstract class RecentsView { + unloadVisibleTaskData(TaskView.FLAG_UPDATE_ALL); + setCurrentPage(0); + LayoutUtils.setViewEnabled(mActionsView, true); + if (mOrientationState.setGestureActive(false)) { + updateOrientationHandler(); + } + }); } public int getRunningTaskId() { @@ -2417,6 +2422,47 @@ public abstract class RecentsView