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 extends TutorialController> 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
-
+
\ No newline at end of file
diff --git a/res/drawable/add_item_dialog_background.xml b/res/drawable/add_item_dialog_background.xml
index 04bde8f5a7..16a0767801 100644
--- a/res/drawable/add_item_dialog_background.xml
+++ b/res/drawable/add_item_dialog_background.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/res/drawable/deep_shortcuts_text_placeholder.xml b/res/drawable/deep_shortcuts_text_placeholder.xml
index 99da50fdca..5820d6b79f 100644
--- a/res/drawable/deep_shortcuts_text_placeholder.xml
+++ b/res/drawable/deep_shortcuts_text_placeholder.xml
@@ -15,7 +15,7 @@
-->
-
+
diff --git a/res/drawable/ic_deepshortcut_placeholder.xml b/res/drawable/ic_deepshortcut_placeholder.xml
index 3fa85065bd..16e7cf3a58 100644
--- a/res/drawable/ic_deepshortcut_placeholder.xml
+++ b/res/drawable/ic_deepshortcut_placeholder.xml
@@ -15,6 +15,6 @@
limitations under the License.
-->
-
-
+
+
diff --git a/res/drawable/single_item_secondary.xml b/res/drawable/single_item_secondary.xml
deleted file mode 100644
index 4edc4813aa..0000000000
--- a/res/drawable/single_item_secondary.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/res/layout/add_item_confirmation_activity.xml b/res/layout/add_item_confirmation_activity.xml
index 7c2f25b831..00d148f2dc 100644
--- a/res/layout/add_item_confirmation_activity.xml
+++ b/res/layout/add_item_confirmation_activity.xml
@@ -21,6 +21,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="24dp"
+ android:theme="?attr/widgetsTheme"
android:orientation="vertical">
+ android:textSize="16sp" />
+ android:textSize="16sp" />
\ No newline at end of file
diff --git a/res/layout/deep_shortcut.xml b/res/layout/deep_shortcut.xml
index 0d11b50ab3..b175d1703f 100644
--- a/res/layout/deep_shortcut.xml
+++ b/res/layout/deep_shortcut.xml
@@ -19,6 +19,7 @@
xmlns:launcher="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/bg_popup_item_width"
android:layout_height="@dimen/bg_popup_item_height"
+ android:elevation="@dimen/deep_shortcuts_elevation"
android:background="@drawable/middle_item_primary"
android:theme="@style/PopupItem" >
diff --git a/res/layout/longpress_options_menu.xml b/res/layout/longpress_options_menu.xml
index 3898365b1c..d2f7a660d9 100644
--- a/res/layout/longpress_options_menu.xml
+++ b/res/layout/longpress_options_menu.xml
@@ -20,6 +20,5 @@
android:layout_height="wrap_content"
android:clipToPadding="false"
android:clipChildren="false"
- android:elevation="@dimen/deep_shortcuts_elevation"
android:importantForAccessibility="yes"
android:orientation="vertical" />
diff --git a/res/layout/popup_container.xml b/res/layout/popup_container.xml
index 04822fd7a2..7c78e441f2 100644
--- a/res/layout/popup_container.xml
+++ b/res/layout/popup_container.xml
@@ -21,7 +21,6 @@
android:layout_height="wrap_content"
android:clipToPadding="false"
android:clipChildren="false"
- android:elevation="@dimen/deep_shortcuts_elevation"
android:orientation="vertical">
\ No newline at end of file
diff --git a/res/layout/system_shortcut.xml b/res/layout/system_shortcut.xml
index 9f45f30216..6337faeadb 100644
--- a/res/layout/system_shortcut.xml
+++ b/res/layout/system_shortcut.xml
@@ -19,6 +19,7 @@
xmlns:launcher="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/bg_popup_item_width"
android:layout_height="@dimen/bg_popup_item_height"
+ android:elevation="@dimen/deep_shortcuts_elevation"
android:background="@drawable/middle_item_primary"
android:theme="@style/PopupItem" >
diff --git a/res/layout/system_shortcut_icons.xml b/res/layout/system_shortcut_icons.xml
index f9922488fb..775a45f47b 100644
--- a/res/layout/system_shortcut_icons.xml
+++ b/res/layout/system_shortcut_icons.xml
@@ -21,7 +21,8 @@
android:layout_height="@dimen/system_shortcut_header_height"
android:orientation="horizontal"
android:gravity="end|center_vertical"
- android:background="@drawable/single_item_secondary"
+ android:background="@drawable/single_item_primary"
+ android:elevation="@dimen/deep_shortcuts_elevation"
android:clipToPadding="true">
-
+
\ No newline at end of file
diff --git a/res/layout/widgets_personal_work_tabs.xml b/res/layout/widgets_personal_work_tabs.xml
index 3402415e84..f835b52e9a 100644
--- a/res/layout/widgets_personal_work_tabs.xml
+++ b/res/layout/widgets_personal_work_tabs.xml
@@ -20,8 +20,7 @@
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="@dimen/all_apps_header_pill_height"
- android:layout_marginLeft="@dimen/all_apps_tabs_side_padding"
- android:layout_marginRight="@dimen/all_apps_tabs_side_padding"
+ android:layout_marginHorizontal="16dp"
android:orientation="horizontal"
android:elevation="2dp"
style="@style/TextHeadline">
diff --git a/res/values-v29/styles.xml b/res/values-v29/styles.xml
index 75905949a5..8254d483fc 100644
--- a/res/values-v29/styles.xml
+++ b/res/values-v29/styles.xml
@@ -27,6 +27,7 @@
- true
- true
- ?attr/workspaceTextColor
+ - ?attr/isWorkspaceDarkText
- shortEdges
- false
- false
diff --git a/res/values-v30/styles.xml b/res/values-v30/styles.xml
index 71740a92c5..a144363e12 100644
--- a/res/values-v30/styles.xml
+++ b/res/values-v30/styles.xml
@@ -27,6 +27,7 @@
- true
- true
- ?attr/workspaceTextColor
+ - ?attr/isWorkspaceDarkText
- always
- false
- false
diff --git a/res/values-v31/colors.xml b/res/values-v31/colors.xml
index 6c2d6aad69..5ade64cb28 100644
--- a/res/values-v31/colors.xml
+++ b/res/values-v31/colors.xml
@@ -17,8 +17,7 @@
*/
-->
- @android:color/system_neutral1_0
- @android:color/system_neutral1_50
+ @android:color/system_neutral1_0
@android:color/system_neutral2_100
@android:color/system_neutral2_300
@android:color/system_neutral1_1000
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index a81802d87a..e605ca8341 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -21,7 +21,6 @@
-
@@ -43,6 +42,7 @@
+
diff --git a/res/values/colors.xml b/res/values/colors.xml
index f44cf94c75..e6553a22bc 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -41,7 +41,6 @@
#FF000000
#B7F29F
- #FFF
#FFF
#F1F3F4
#E0E0E0
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 3267a5d246..26587d8a72 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -84,7 +84,7 @@
-26dp
- 300dp
+ 320dp
48dp
30dp
40dp
@@ -202,7 +202,8 @@
2dp
- 0dp
+ 2dp
+ 2dp
216dp
56dp
6dp
diff --git a/res/values/styles.xml b/res/values/styles.xml
index dd72114495..fa41b1aaa2 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -27,6 +27,7 @@
- true
- true
- ?attr/workspaceTextColor
+ - ?attr/isWorkspaceDarkText
@@ -86,6 +88,7 @@
- #CDFFFFFF
- #FF80868B
- ?attr/workspaceTextColor
+ - true
@@ -126,6 +130,7 @@
- #19212121
- #CDFFFFFF
- ?attr/workspaceTextColor
+ - ?attr/isWorkspaceDarkText
- @color/workspace_text_color_dark
- @android:color/transparent
- @android:color/transparent
@@ -195,7 +200,7 @@
- 0
- 3dp
- false
- - @android:color/white
+ - ?android:attr/textColorPrimaryInverse
- false
- no
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index e5ad24341b..812667371d 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -21,6 +21,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
import static com.android.launcher3.ResourceUtils.pxFromDp;
import static com.android.launcher3.Utilities.dpiFromPx;
+import static com.android.launcher3.Utilities.pxFromSp;
import static com.android.launcher3.util.WindowManagerCompat.MIN_TABLET_WIDTH;
import android.annotation.SuppressLint;
@@ -518,7 +519,7 @@ public class DeviceProfile {
float invIconSizeDp = isLandscape ? inv.landscapeIconSize : inv.iconSize;
iconSizePx = Math.max(1, pxFromDp(invIconSizeDp, mMetrics, scale));
float invIconTextSizeSp = isLandscape ? inv.landscapeIconTextSize : inv.iconTextSize;
- iconTextSizePx = (int) (Utilities.pxFromSp(invIconTextSizeSp, mMetrics) * scale);
+ iconTextSizePx = (int) (pxFromSp(invIconTextSizeSp, mMetrics) * scale);
iconDrawablePaddingPx = (int) (iconDrawablePaddingOriginalPx * scale);
setCellLayoutBorderSpacing((int) (cellLayoutBorderSpacingOriginalPx * scale));
@@ -548,7 +549,7 @@ public class DeviceProfile {
// All apps
if (numShownAllAppsColumns != inv.numColumns) {
allAppsIconSizePx = pxFromDp(inv.allAppsIconSize, mMetrics);
- allAppsIconTextSizePx = Utilities.pxFromSp(inv.allAppsIconTextSize, mMetrics);
+ allAppsIconTextSizePx = pxFromSp(inv.allAppsIconTextSize, mMetrics);
allAppsIconDrawablePaddingPx = iconDrawablePaddingOriginalPx;
autoResizeAllAppsCells();
} else {
@@ -619,7 +620,7 @@ public class DeviceProfile {
private void updateFolderCellSize(float scale, Resources res) {
float invIconSizeDp = isVerticalBarLayout() ? inv.landscapeIconSize : inv.iconSize;
folderChildIconSizePx = Math.max(1, pxFromDp(invIconSizeDp, mMetrics, scale));
- folderChildTextSizePx = pxFromDp(inv.iconTextSize, mMetrics, scale);
+ folderChildTextSizePx = pxFromSp(inv.iconTextSize, mMetrics, scale);
folderLabelTextSizePx = (int) (folderChildTextSizePx * folderLabelTextScale);
int textHeight = Utilities.calculateTextHeight(folderChildTextSizePx);
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 7b67807697..559e89e236 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -139,6 +139,7 @@ import com.android.launcher3.model.BgDataModel.Callbacks;
import com.android.launcher3.model.ItemInstallQueue;
import com.android.launcher3.model.ModelUtils;
import com.android.launcher3.model.ModelWriter;
+import com.android.launcher3.model.WidgetsModel;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.FolderInfo;
import com.android.launcher3.model.data.ItemInfo;
@@ -2316,24 +2317,43 @@ public class Launcher extends StatefulActivity implements Launche
try {
final LauncherAppWidgetProviderInfo appWidgetInfo;
+ String reason = "";
if (item.hasRestoreFlag(LauncherAppWidgetInfo.FLAG_PROVIDER_NOT_READY)) {
// If the provider is not ready, bind as a pending widget.
appWidgetInfo = null;
+ reason = "the provider not ready.";
} else if (item.hasRestoreFlag(LauncherAppWidgetInfo.FLAG_ID_NOT_VALID)) {
// The widget id is not valid. Try to find the widget based on the provider info.
appWidgetInfo = mAppWidgetManager.findProvider(item.providerName, item.user);
+ if (appWidgetInfo == null) {
+ if (WidgetsModel.GO_DISABLE_WIDGETS) {
+ reason = "widgets are disabled on go device.";
+ } else {
+ reason = "WidgetManagerHelper cannot find a provider from provider info.";
+ }
+ }
} else {
appWidgetInfo = mAppWidgetManager.getLauncherAppWidgetInfo(item.appWidgetId);
+ if (appWidgetInfo == null) {
+ if (item.appWidgetId <= LauncherAppWidgetInfo.CUSTOM_WIDGET_ID) {
+ reason = "CustomWidgetManager cannot find provider from that widget id .";
+ } else {
+ reason = "AppWidgetManager cannot find provider for that widget id."
+ + " It could be due to AppWidgetService is not available, or the"
+ + " appWidgetId has not been bound to a the provider yet, or you"
+ + " don't have access to that appWidgetId.";
+ }
+ }
}
// If the provider is ready, but the width is not yet restored, try to restore it.
if (!item.hasRestoreFlag(LauncherAppWidgetInfo.FLAG_PROVIDER_NOT_READY)
&& (item.restoreStatus != LauncherAppWidgetInfo.RESTORE_COMPLETED)) {
if (appWidgetInfo == null) {
- Log.d(TAG, "Removing restored widget: id=" + item.appWidgetId
- + " belongs to component " + item.providerName
- + ", as the provider is null");
+ FileLog.d(TAG, "Removing restored widget: id=" + item.appWidgetId
+ + " belongs to component " + item.providerName + " user " + item.user
+ + ", as the provider is null and " + reason);
getModelWriter().deleteItemFromDatabase(item);
return null;
}
diff --git a/src/com/android/launcher3/LauncherState.java b/src/com/android/launcher3/LauncherState.java
index 9d50edd234..8432f4be29 100644
--- a/src/com/android/launcher3/LauncherState.java
+++ b/src/com/android/launcher3/LauncherState.java
@@ -237,10 +237,10 @@ public abstract class LauncherState implements BaseState {
}
/**
- * For this state, how much additional vertical translation there should be for each of the
- * child TaskViews.
+ * For this state, how much additional translation there should be for each of the
+ * child TaskViews. Note that the translation can be its primary or secondary dimension.
*/
- public float getOverviewSecondaryTranslation(Launcher launcher) {
+ public float getSplitSelectTranslation(Launcher launcher) {
return 0;
}
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index 7c0036250b..7ae729aa0c 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -465,9 +465,14 @@ public final class Utilities {
return (int) (dp * Resources.getSystem().getDisplayMetrics().density);
}
+
public static int pxFromSp(float size, DisplayMetrics metrics) {
- return (int) Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,
- size, metrics));
+ return pxFromSp(size, metrics, 1f);
+ }
+
+ public static int pxFromSp(float size, DisplayMetrics metrics, float scale) {
+ return Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,
+ size, metrics) * scale);
}
public static String createDbSelectionQuery(String columnName, IntArray values) {
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index 47236b6994..5c9c037a62 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -45,6 +45,7 @@ import android.view.WindowInsets;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
+import androidx.annotation.VisibleForTesting;
import androidx.core.graphics.ColorUtils;
import androidx.core.os.BuildCompat;
import androidx.recyclerview.widget.DefaultItemAnimator;
@@ -79,10 +80,11 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
Insettable, OnDeviceProfileChangeListener, OnActivePageChangedListener,
ScrimView.ScrimDrawingController {
- private static final float FLING_VELOCITY_MULTIPLIER = 1000f;
+ public static final float PULL_MULTIPLIER = .02f;
+ public static final float FLING_VELOCITY_MULTIPLIER = 2000f;
// Starts the springs after at least 25% of the animation has passed.
- private static final float FLING_ANIMATION_THRESHOLD = 0.25f;
+ public static final float FLING_ANIMATION_THRESHOLD = 0.25f;
private final Paint mHeaderPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
@@ -100,6 +102,7 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
private AllAppsPagedView mViewPager;
protected FloatingHeaderView mHeader;
+ private float mHeaderTop;
private WorkModeSwitch mWorkModeSwitch;
@@ -464,7 +467,7 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
R.layout.work_mode_switch, this, false);
this.addView(mWorkModeSwitch);
mWorkModeSwitch.setInsets(mInsets);
- mWorkModeSwitch.post(() -> mAH[AdapterHolder.WORK].applyPadding());
+ mWorkModeSwitch.post(this::resetWorkProfile);
}
}
@@ -530,7 +533,7 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
return view.getGlobalVisibleRect(new Rect());
}
- // Used by tests only
+ @VisibleForTesting
public boolean isPersonalTabVisible() {
return isDescendantViewVisible(R.id.tab_personal);
}
@@ -582,6 +585,7 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
mAH[i].padding.top = padding;
mAH[i].applyPadding();
}
+ mHeaderTop = mHeader.getTop();
}
public void setLastSearchQuery(String query) {
@@ -636,14 +640,42 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
public void onAnimationUpdate(ValueAnimator valueAnimator) {
if (shouldSpring
&& valueAnimator.getAnimatedFraction() >= FLING_ANIMATION_THRESHOLD) {
- absorbSwipeUpVelocity(Math.abs(
- Math.round(velocity * FLING_VELOCITY_MULTIPLIER)));
+ absorbSwipeUpVelocity(Math.max(100, Math.abs(
+ Math.round(velocity * FLING_VELOCITY_MULTIPLIER))));
+ // calculate the velocity of using the not user controlled interpolator
+ // of when the container reach the end.
shouldSpring = false;
}
}
});
}
+ public void onPull(float deltaDistance, float displacement) {
+ absorbPullDeltaDistance(PULL_MULTIPLIER * deltaDistance,
+ PULL_MULTIPLIER * displacement);
+ // ideally, this should be done using EdgeEffect.onPush to create squish effect.
+ // However, until such method is available, launcher to simulate the onPush method.
+ mHeader.setTranslationY(-.5f * mHeaderTop * deltaDistance);
+ getRecyclerViewContainer().setTranslationY(-mHeaderTop * deltaDistance);
+ }
+
+ public void onRelease() {
+ ValueAnimator anim1 = ValueAnimator.ofFloat(1f, 0f);
+ final float floatingHeaderHeight = getFloatingHeaderView().getTranslationY();
+ final float recyclerViewHeight = getRecyclerViewContainer().getTranslationY();
+ anim1.setDuration(200);
+ anim1.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+ @Override
+ public void onAnimationUpdate(ValueAnimator valueAnimator) {
+ getFloatingHeaderView().setTranslationY(
+ ((float) valueAnimator.getAnimatedValue()) * floatingHeaderHeight);
+ getRecyclerViewContainer().setTranslationY(
+ ((float) valueAnimator.getAnimatedValue()) * recyclerViewHeight);
+ }
+ });
+ anim1.start();
+ super.onRelease();
+ }
@Override
public void getDrawingRect(Rect outRect) {
super.getDrawingRect(outRect);
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
index 2cfbdf9d59..3a616093db 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -17,10 +17,7 @@ package com.android.launcher3.allapps;
import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.LauncherState.ALL_APPS_CONTENT;
-import static com.android.launcher3.anim.Interpolators.ACCEL_0_75;
-import static com.android.launcher3.anim.Interpolators.ACCEL_2;
-import static com.android.launcher3.anim.Interpolators.DEACCEL;
-import static com.android.launcher3.anim.Interpolators.DEACCEL_2;
+import static com.android.launcher3.anim.Interpolators.DEACCEL_1_7;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.anim.PropertySetter.NO_ANIM_PROPERTY_SETTER;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_ALL_APPS_FADE;
@@ -158,9 +155,8 @@ public class AllAppsTransitionController
return;
}
- Interpolator interpolator = toState.equals(ALL_APPS)
- ? (config.userControlled ? ACCEL_2 : ACCEL_0_75) :
- (config.userControlled ? DEACCEL_2 : DEACCEL);
+ // need to decide depending on the release velocity
+ Interpolator interpolator = (config.userControlled ? LINEAR : DEACCEL_1_7);
Animator anim = createSpringAnimation(mProgress, targetProgress);
anim.setInterpolator(config.getInterpolator(ANIM_VERTICAL_PROGRESS, interpolator));
diff --git a/src/com/android/launcher3/dragndrop/DragView.java b/src/com/android/launcher3/dragndrop/DragView.java
index 30ee9ecddd..1664980c35 100644
--- a/src/com/android/launcher3/dragndrop/DragView.java
+++ b/src/com/android/launcher3/dragndrop/DragView.java
@@ -33,11 +33,13 @@ import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Path;
+import android.graphics.Picture;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.drawable.AdaptiveIconDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
+import android.graphics.drawable.PictureDrawable;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
@@ -457,7 +459,6 @@ public class DragView extends FrameLayout implements StateListener= 0) {
- removeView(mContent);
+ Picture picture = new Picture();
+ mContent.draw(picture.beginRecording(mWidth, mHeight));
+ picture.endRecording();
+ View view = new View(mLauncher);
+ view.setClipToOutline(mContent.getClipToOutline());
+ view.setOutlineProvider(mContent.getOutlineProvider());
+ view.setBackground(new PictureDrawable(picture));
+ view.measure(makeMeasureSpec(mWidth, EXACTLY), makeMeasureSpec(mHeight, EXACTLY));
+ view.layout(mContent.getLeft(), mContent.getTop(),
+ mContent.getRight(), mContent.getBottom());
+ addViewInLayout(view, indexOfChild(mContent), mContent.getLayoutParams(), true);
+
+ removeViewInLayout(mContent);
+ mContent.setVisibility(INVISIBLE);
mContent.setLayoutParams(mContentViewLayoutParams);
if (reattachToPreviousParent) {
mContentViewParent.addView(mContent, mContentViewInParentViewIndex);
diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java
index 22d1b1c48a..f5a8ef6f1d 100644
--- a/src/com/android/launcher3/folder/Folder.java
+++ b/src/com/android/launcher3/folder/Folder.java
@@ -296,6 +296,8 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
}
if (Utilities.ATLEAST_S) {
+ mColorExtractionIndex = LocalColorExtractor.getColorIndex(
+ !Themes.getAttrBoolean(getContext(), R.attr.isFolderDarkText));
mColorExtractor = LocalColorExtractor.newInstance(getContext());
mColorListener = (RectF rect, SparseIntArray extractedColors) -> {
mColorChangeRunnable = () -> {
diff --git a/src/com/android/launcher3/folder/FolderAnimationManager.java b/src/com/android/launcher3/folder/FolderAnimationManager.java
index af8be8d2f9..7fbfb8934e 100644
--- a/src/com/android/launcher3/folder/FolderAnimationManager.java
+++ b/src/com/android/launcher3/folder/FolderAnimationManager.java
@@ -168,15 +168,15 @@ public class FolderAnimationManager {
final float yDistance = initialY - lp.y;
// Set up the Folder background.
- int previewBackgroundColor = Themes.getAttrColor(mContext, R.attr.folderFillColor);
final int finalColor;
+ int folderFillColor = Themes.getAttrColor(mContext, R.attr.folderFillColor);
if (mIsOpening) {
- finalColor = Themes.getAttrColor(mContext, R.attr.popupColorPrimary);
+ finalColor = folderFillColor;
} else {
finalColor = mFolderBackground.getColor().getDefaultColor();
}
- final int initialColor = setColorAlphaBound(previewBackgroundColor,
- mPreviewBackground.getBackgroundAlpha());
+ final int initialColor = setColorAlphaBound(
+ folderFillColor, mPreviewBackground.getBackgroundAlpha());
mFolderBackground.mutate();
mFolderBackground.setColor(mIsOpening ? initialColor : finalColor);
diff --git a/src/com/android/launcher3/notification/NotificationItemView.java b/src/com/android/launcher3/notification/NotificationItemView.java
index e954480ca5..d44d158010 100644
--- a/src/com/android/launcher3/notification/NotificationItemView.java
+++ b/src/com/android/launcher3/notification/NotificationItemView.java
@@ -92,10 +92,6 @@ public class NotificationItemView {
});
}
- public void updateBackgroundColor(int color) {
- mMainView.updateBackgroundColor(color);
- }
-
public void addGutter() {
if (mGutter == null) {
mGutter = mPopupContainer.inflateAndAdd(R.layout.notification_gutter, mRootView);
diff --git a/src/com/android/launcher3/popup/ArrowPopup.java b/src/com/android/launcher3/popup/ArrowPopup.java
index 73ac8f2ab5..8dea14a8c0 100644
--- a/src/com/android/launcher3/popup/ArrowPopup.java
+++ b/src/com/android/launcher3/popup/ArrowPopup.java
@@ -19,21 +19,15 @@ package com.android.launcher3.popup;
import static com.android.launcher3.anim.Interpolators.ACCELERATED_EASE;
import static com.android.launcher3.anim.Interpolators.DECELERATED_EASE;
import static com.android.launcher3.anim.Interpolators.LINEAR;
-import static com.android.launcher3.popup.PopupPopulator.MAX_SHORTCUTS;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
-import android.animation.ArgbEvaluator;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.Resources;
-import android.graphics.Outline;
import android.graphics.Rect;
-import android.graphics.RectF;
-import android.graphics.drawable.ColorDrawable;
-import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.util.AttributeSet;
import android.util.Pair;
@@ -41,32 +35,25 @@ import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.view.ViewOutlineProvider;
-import android.view.ViewTreeObserver;
import android.view.animation.Interpolator;
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.InsettableFrameLayout;
-import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
-import com.android.launcher3.Workspace;
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.shortcuts.DeepShortcutView;
import com.android.launcher3.statemanager.StatefulActivity;
import com.android.launcher3.util.Themes;
import com.android.launcher3.views.BaseDragLayer;
-import com.android.launcher3.widget.LocalColorExtractor;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashMap;
/**
* A container for shortcuts to deep links and notifications associated with an app.
@@ -89,9 +76,6 @@ public abstract class ArrowPopup>
private static final int CLOSE_CHILD_FADE_START_DELAY = 0;
private static final int CLOSE_CHILD_FADE_DURATION = 140;
- // +1 for system shortcut view
- private static final int MAX_NUM_CHILDREN = MAX_SHORTCUTS + 1;
-
private final Rect mTempRect = new Rect();
protected final LayoutInflater mInflater;
@@ -120,13 +104,8 @@ public abstract class ArrowPopup>
private Runnable mOnCloseCallback = () -> { };
- // The rect string of the view that the arrow is attached to, in screen reference frame.
- private String mArrowColorRectString;
- private int mArrowColor;
- private final int[] mColors;
- private final HashMap mViewForRect = new HashMap<>();
-
- @Nullable private LocalColorExtractor mColorExtractor;
+ private final float mElevation;
+ private final int mBackgroundColor;
public ArrowPopup(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
@@ -134,13 +113,9 @@ public abstract class ArrowPopup>
mOutlineRadius = Themes.getDialogCornerRadius(context);
mLauncher = BaseDraggingActivity.fromContext(context);
mIsRtl = Utilities.isRtl(getResources());
- setClipToOutline(true);
- setOutlineProvider(new ViewOutlineProvider() {
- @Override
- public void getOutline(View view, Outline outline) {
- outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), mOutlineRadius);
- }
- });
+
+ mBackgroundColor = Themes.getAttrColor(context, R.attr.popupColorPrimary);
+ mElevation = getResources().getDimension(R.dimen.deep_shortcuts_elevation);
// Initialize arrow view
final Resources resources = getResources();
@@ -156,33 +131,14 @@ public abstract class ArrowPopup>
int smallerRadius = resources.getDimensionPixelSize(R.dimen.popup_smaller_radius);
mRoundedTop = new GradientDrawable();
+ mRoundedTop.setColor(mBackgroundColor);
mRoundedTop.setCornerRadii(new float[] { mOutlineRadius, mOutlineRadius, mOutlineRadius,
mOutlineRadius, smallerRadius, smallerRadius, smallerRadius, smallerRadius});
mRoundedBottom = new GradientDrawable();
+ mRoundedBottom.setColor(mBackgroundColor);
mRoundedBottom.setCornerRadii(new float[] { smallerRadius, smallerRadius, smallerRadius,
smallerRadius, mOutlineRadius, mOutlineRadius, mOutlineRadius, mOutlineRadius});
-
- boolean isAboveAnotherSurface = getTopOpenViewWithType(mLauncher, TYPE_FOLDER) != null
- || mLauncher.getStateManager().getState() == LauncherState.ALL_APPS;
- if (isAboveAnotherSurface) {
- mColors = new int[] { Themes.getAttrColor(context, R.attr.popupColorNeutral) };
- } else {
- int primaryColor = Themes.getAttrColor(context, R.attr.popupColorPrimary);
- int secondaryColor = Themes.getAttrColor(context, R.attr.popupColorSecondary);
- ArgbEvaluator argb = new ArgbEvaluator();
- mColors = new int[MAX_NUM_CHILDREN];
- // Interpolate between the two colors, exclusive.
- float step = 1f / (MAX_NUM_CHILDREN + 1);
- for (int i = 0; i < mColors.length; ++i) {
- mColors[i] =
- (int) argb.evaluate((i + 1) * step, primaryColor, secondaryColor);
- }
-
- if (supportsColorExtraction()) {
- setupColorExtraction();
- }
- }
}
public ArrowPopup(Context context, AttributeSet attrs) {
@@ -240,7 +196,6 @@ public abstract class ArrowPopup>
int numVisibleShortcut = 0;
View lastView = null;
- int numVisibleChild = 0;
for (int i = 0; i < count; i++) {
View view = getChildAt(i);
boolean isShortcut = view instanceof DeepShortcutView;
@@ -267,35 +222,11 @@ public abstract class ArrowPopup>
numVisibleShortcut++;
}
}
-
- int color = mColors[numVisibleChild % mColors.length];
- setChildColor(view, color);
-
- // Arrow color matches the first child or the last child.
- if (!mIsAboveIcon && numVisibleChild == 0) {
- mArrowColor = color;
- } else if (mIsAboveIcon) {
- mArrowColor = color;
- }
-
- numVisibleChild++;
}
}
measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
}
- /**
- * Sets the background color of the child.
- */
- protected void setChildColor(View view, int color) {
- Drawable bg = view.getBackground();
- if (bg instanceof GradientDrawable) {
- ((GradientDrawable) bg.mutate()).setColor(color);
- } else if (bg instanceof ColorDrawable) {
- ((ColorDrawable) bg.mutate()).setColor(color);
- }
- }
-
/**
* Shows the popup at the desired location, optionally reversing the children.
* @param viewsToFlip number of views from the top to to flip in case of reverse order
@@ -366,23 +297,18 @@ public abstract class ArrowPopup>
// so we centered it instead. In that case we don't want to showDefaultOptions the arrow.
mArrow.setVisibility(INVISIBLE);
} else {
- updateArrowColor();
- }
-
- mArrow.setPivotX(mArrowWidth / 2.0f);
- mArrow.setPivotY(mIsAboveIcon ? mArrowHeight : 0);
- }
-
- private void updateArrowColor() {
- if (!Gravity.isVertical(mGravity)) {
mArrow.setBackground(new RoundedArrowDrawable(
mArrowWidth, mArrowHeight, mArrowPointRadius,
mOutlineRadius, getMeasuredWidth(), getMeasuredHeight(),
mArrowOffsetHorizontal, -mArrowOffsetVertical,
!mIsAboveIcon, mIsLeftAligned,
- mArrowColor));
- mArrow.setElevation(getElevation());
+ mBackgroundColor));
+ // TODO: Remove elevation when arrow is above as it casts a shadow on the container
+ mArrow.setElevation(mIsAboveIcon ? mElevation : 0);
}
+
+ mArrow.setPivotX(mArrowWidth / 2.0f);
+ mArrow.setPivotY(mIsAboveIcon ? mArrowHeight : 0);
}
/**
@@ -434,7 +360,7 @@ public abstract class ArrowPopup>
}
int childMargins = (numVisibleChildren - 1) * mMargin;
int height = getMeasuredHeight() + extraVerticalSpace + childMargins;
- int width = getMeasuredWidth();
+ int width = getMeasuredWidth() + getPaddingLeft() + getPaddingRight();
getTargetObjectLocation(mTempRect);
InsettableFrameLayout dragLayer = getPopupContainer();
@@ -667,19 +593,6 @@ public abstract class ArrowPopup>
getPopupContainer().removeView(this);
getPopupContainer().removeView(mArrow);
mOnCloseCallback.run();
- mArrowColorRectString = null;
- mViewForRect.clear();
- if (mColorExtractor != null) {
- mColorExtractor.removeLocations();
- mColorExtractor.setListener(null);
- }
- }
-
- /**
- * Returns whether color extraction is supported.
- */
- public boolean supportsColorExtraction() {
- return Utilities.ATLEAST_S;
}
/**
@@ -689,68 +602,6 @@ public abstract class ArrowPopup>
mOnCloseCallback = callback;
}
- private void setupColorExtraction() {
- Workspace workspace = mLauncher.findViewById(R.id.workspace);
- if (workspace == null) {
- return;
- }
-
- mColorExtractor = LocalColorExtractor.newInstance(mLauncher);
- mColorExtractor.setListener((rect, extractedColors) -> {
- String rectString = rect.toShortString();
- View v = mViewForRect.get(rectString);
- if (v != null) {
- int newColor = extractedColors.get(mColorExtractionIndex);
- setChildColor(v, newColor);
- if (rectString.equals(mArrowColorRectString)) {
- mArrowColor = newColor;
- updateArrowColor();
- }
- }
- });
-
- getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
- @Override
- public boolean onPreDraw() {
- getViewTreeObserver().removeOnPreDrawListener(this);
-
- ArrayList locations = new ArrayList<>();
- Rect r = new Rect();
-
- int count = getChildCount();
- int numVisibleChild = 0;
- for (int i = 0; i < count; i++) {
- View view = getChildAt(i);
- if (view.getVisibility() == VISIBLE) {
- RectF rf = new RectF();
- mColorExtractor.getExtractedRectForView(Launcher.getLauncher(getContext()),
- workspace.getCurrentPage(), view, rf);
- if (rf.isEmpty()) {
- numVisibleChild++;
- continue;
- }
-
- locations.add(rf);
- String rectString = rf.toShortString();
- mViewForRect.put(rectString, view);
-
- // Arrow color matches the first child or the last child.
- if (!mIsAboveIcon && numVisibleChild == 0) {
- mArrowColorRectString = rectString;
- } else if (mIsAboveIcon) {
- mArrowColorRectString = rectString;
- }
-
- numVisibleChild++;
- }
- }
-
- mColorExtractor.addLocation(locations);
- return false;
- }
- });
- }
-
protected BaseDragLayer getPopupContainer() {
return mLauncher.getDragLayer();
}
diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
index 1659e6d9cf..b115678562 100644
--- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java
+++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
@@ -172,14 +172,6 @@ public class PopupContainerWithArrow>
return false;
}
- @Override
- protected void setChildColor(View v, int color) {
- super.setChildColor(v, color);
- if (v.getId() == R.id.notification_container && mNotificationItemView != null) {
- mNotificationItemView.updateBackgroundColor(color);
- }
- }
-
/**
* Returns true if we can show the container.
*/
diff --git a/src/com/android/launcher3/settings/DeveloperOptionsFragment.java b/src/com/android/launcher3/settings/DeveloperOptionsFragment.java
index 217453fb63..d0a8c711b0 100644
--- a/src/com/android/launcher3/settings/DeveloperOptionsFragment.java
+++ b/src/com/android/launcher3/settings/DeveloperOptionsFragment.java
@@ -277,8 +277,8 @@ public class DeveloperOptionsFragment extends PreferenceFragmentCompat {
startActivity(launchSandboxIntent.putExtra(
"tutorial_steps",
new String[] {
- "LEFT_EDGE_BACK_NAVIGATION",
"HOME_NAVIGATION",
+ "LEFT_EDGE_BACK_NAVIGATION",
"OVERVIEW_NAVIGATION"}));
return true;
});
diff --git a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
index d092f11ae5..a086635d57 100644
--- a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
+++ b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
@@ -56,9 +56,8 @@ public abstract class AbstractStateChangeTouchController
protected final AnimatorListener mClearStateOnCancelListener =
newCancelListener(this::clearState);
+ private final FlingBlockCheck mFlingBlockCheck = new FlingBlockCheck();
- private boolean mNoIntercept;
- private boolean mIsLogContainerSet;
protected int mStartContainerType;
protected LauncherState mStartState;
@@ -67,12 +66,14 @@ public abstract class AbstractStateChangeTouchController
protected AnimatorPlaybackController mCurrentAnimation;
protected boolean mGoingBetweenStates = true;
+ private boolean mNoIntercept;
+ private boolean mIsLogContainerSet;
private float mStartProgress;
// Ratio of transition process [0, 1] to drag displacement (px)
private float mProgressMultiplier;
private float mDisplacementShift;
private boolean mCanBlockFling;
- private final FlingBlockCheck mFlingBlockCheck = new FlingBlockCheck();
+ private boolean mAllAppsOvershootStarted;
public AbstractStateChangeTouchController(Launcher l, SingleAxisSwipeDetector.Direction dir) {
mLauncher = l;
@@ -216,8 +217,15 @@ public abstract class AbstractStateChangeTouchController
mFlingBlockCheck.blockFling();
}
}
+ if (mToState == LauncherState.ALL_APPS && !UNSTABLE_SPRINGS.get()) {
+ mAllAppsOvershootStarted = true;
+ // 1f, value when all apps container hit the top
+ mLauncher.getAppsView().onPull(progress - 1f, progress - 1f);
+ }
+
} else {
mFlingBlockCheck.onEvent();
+
}
return true;
@@ -325,8 +333,15 @@ public abstract class AbstractStateChangeTouchController
anim.setFloatValues(startProgress, endProgress);
updateSwipeCompleteAnimation(anim, duration, targetState, velocity, fling);
mCurrentAnimation.dispatchOnStart();
- if (fling && targetState == LauncherState.ALL_APPS && !UNSTABLE_SPRINGS.get()) {
- mLauncher.getAppsView().addSpringFromFlingUpdateListener(anim, velocity);
+ if (targetState == LauncherState.ALL_APPS && !UNSTABLE_SPRINGS.get()) {
+ if (mAllAppsOvershootStarted) {
+
+ mLauncher.getAppsView().onRelease();
+ mAllAppsOvershootStarted = false;
+
+ } else {
+ mLauncher.getAppsView().addSpringFromFlingUpdateListener(anim, velocity);
+ }
}
anim.start();
}
diff --git a/src/com/android/launcher3/views/SpringRelativeLayout.java b/src/com/android/launcher3/views/SpringRelativeLayout.java
index 9701389f91..8342d3e9d2 100644
--- a/src/com/android/launcher3/views/SpringRelativeLayout.java
+++ b/src/com/android/launcher3/views/SpringRelativeLayout.java
@@ -32,6 +32,7 @@ import com.android.launcher3.Utilities;
*/
public class SpringRelativeLayout extends RelativeLayout {
+ // fixed edge at the time force is applied
private final EdgeEffect mEdgeGlowTop;
private final EdgeEffect mEdgeGlowBottom;
@@ -87,6 +88,15 @@ public class SpringRelativeLayout extends RelativeLayout {
invalidate();
}
+ protected void absorbPullDeltaDistance(float deltaDistance, float displacement) {
+ mEdgeGlowBottom.onPull(deltaDistance, displacement);
+ invalidate();
+ }
+
+ protected void onRelease() {
+ mEdgeGlowBottom.onRelease();
+ }
+
public EdgeEffectFactory createEdgeEffectFactory() {
return new ProxyEdgeEffectFactory();
}
diff --git a/src/com/android/launcher3/widget/LocalColorExtractor.java b/src/com/android/launcher3/widget/LocalColorExtractor.java
index a66024aafc..e479b7d049 100644
--- a/src/com/android/launcher3/widget/LocalColorExtractor.java
+++ b/src/com/android/launcher3/widget/LocalColorExtractor.java
@@ -113,8 +113,14 @@ public class LocalColorExtractor implements ResourceBasedOverride {
* Returns an index used to query the color of interest from the list of extracted colors.
*/
public static int getColorIndex(Context context) {
- return Utilities.isDarkTheme(context)
- ? DARK_COLOR_EXTRACTION_INDEX
- : LIGHT_COLOR_EXTRACTION_INDEX;
+ return getColorIndex(Utilities.isDarkTheme(context));
+ }
+
+ /**
+ * Returns an index used to query the color of interest from the list of extracted colors.
+ * @param getDarkIndex True when dark index is wanted, False when light index is wanted.
+ */
+ public static int getColorIndex(boolean getDarkIndex) {
+ return getDarkIndex ? DARK_COLOR_EXTRACTION_INDEX : LIGHT_COLOR_EXTRACTION_INDEX;
}
}
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index c77583ccff..f993bcf547 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -445,11 +445,10 @@ public final class LauncherInstrumentation {
if (systemHealth != null) {
return message
- + ",\nperhaps linked to system health problems:\n<<<<<<<<<<<<<<<<<<\n"
+ + ";\nPerhaps linked to system health problems:\n<<<<<<<<<<<<<<<<<<\n"
+ systemHealth + "\n>>>>>>>>>>>>>>>>>>";
}
}
-
return message;
}
@@ -460,7 +459,7 @@ public final class LauncherInstrumentation {
if (checkEvents) {
final String eventMismatch = eventChecker.verify(0, false);
if (eventMismatch != null) {
- message = message + ", having produced " + eventMismatch;
+ message = message + ";\n" + eventMismatch;
}
} else {
eventChecker.finishNoWait();
@@ -497,12 +496,13 @@ public final class LauncherInstrumentation {
private void fail(String message) {
checkForAnomaly();
Assert.fail(formatSystemHealthMessage(formatErrorWithEvents(
- "http://go/tapl : " + getContextDescription() + message
- + " (visible state: " + getVisibleStateMessage() + ")", true)));
+ "http://go/tapl test failure:\nOverview: " + getContextDescription()
+ + " - visible state is " + getVisibleStateMessage()
+ + ";\nDetails: " + message, true)));
}
private String getContextDescription() {
- return mDiagnosticContext.isEmpty() ? "" : String.join(", ", mDiagnosticContext) + "; ";
+ return mDiagnosticContext.isEmpty() ? "" : String.join(", ", mDiagnosticContext);
}
void assertTrue(String message, boolean condition) {
diff --git a/tests/tapl/com/android/launcher3/tapl/LogEventChecker.java b/tests/tapl/com/android/launcher3/tapl/LogEventChecker.java
index ab6465c572..a809e2e30c 100644
--- a/tests/tapl/com/android/launcher3/tapl/LogEventChecker.java
+++ b/tests/tapl/com/android/launcher3/tapl/LogEventChecker.java
@@ -115,7 +115,7 @@ public class LogEventChecker {
}
}
- return hasMismatches ? "mismatching events: " + sb.toString() : null;
+ return hasMismatches ? "Mismatching events: " + sb.toString() : null;
}
// If the list of actual events matches the list of expected events, returns -1, otherwise