Merge "Prevent launching app in split if task split is unsupported" into sc-v2-dev
diff --git a/quickstep/res/layout/activity_allset.xml b/quickstep/res/layout/activity_allset.xml
index 4fbb8a0..b4ee482 100644
--- a/quickstep/res/layout/activity_allset.xml
+++ b/quickstep/res/layout/activity_allset.xml
@@ -14,81 +14,93 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:paddingStart="@dimen/allset_page_margin_horizontal"
-    android:paddingEnd="@dimen/allset_page_margin_horizontal"
-    android:layoutDirection="locale"
-    android:textDirection="locale">
+    android:id="@+id/root_view"
+    android:background="@color/all_set_page_background" >
 
-    <ImageView
-        android:id="@+id/icon"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/allset_title_icon_margin_top"
-        app:layout_constraintTop_toTopOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        android:src="@drawable/ic_all_set"/>
-
-    <TextView
-        android:id="@+id/title"
-        style="@style/TextAppearance.GestureTutorial.Feedback.Title"
+    <androidx.constraintlayout.widget.ConstraintLayout
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/allset_title_margin_top"
-        app:layout_constraintTop_toBottomOf="@id/icon"
-        app:layout_constraintStart_toStartOf="parent"
-        android:gravity="start"
-        android:text="@string/allset_title"/>
+        android:layout_height="match_parent"
+        android:layout_marginStart="@dimen/allset_page_margin_horizontal"
+        android:layout_marginEnd="@dimen/allset_page_margin_horizontal"
+        android:layoutDirection="locale"
+        android:textDirection="locale"
+        android:id="@+id/content_view"
+        android:forceHasOverlappingRendering="false"
+        android:fitsSystemWindows="true" >
 
-    <TextView
-        android:id="@+id/subtitle"
-        style="@style/TextAppearance.GestureTutorial.Feedback.Subtitle"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/allset_subtitle_margin_top"
-        app:layout_constraintTop_toBottomOf="@id/title"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintWidth_max="@dimen/allset_subtitle_width_max"
-        android:gravity="start"
-        android:text="@string/allset_description"/>
+        <ImageView
+            android:id="@+id/icon"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/allset_title_icon_margin_top"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            android:src="@drawable/ic_all_set"/>
 
-    <androidx.constraintlayout.widget.Guideline
-        android:id="@+id/navigation_settings_guideline_bottom"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:orientation="horizontal"
-        app:layout_constraintGuide_percent="0.83" />
+        <TextView
+            android:id="@+id/title"
+            style="@style/TextAppearance.GestureTutorial.Feedback.Title"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/allset_title_margin_top"
+            app:layout_constraintTop_toBottomOf="@id/icon"
+            app:layout_constraintStart_toStartOf="parent"
+            android:gravity="start"
+            android:text="@string/allset_title"/>
 
-    <TextView
-        android:id="@+id/navigation_settings"
-        style="@style/TextAppearance.GestureTutorial.LinkText"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintBottom_toBottomOf="@id/navigation_settings_guideline_bottom"
-        android:minHeight="48dp"
-        android:background="?android:attr/selectableItemBackground"
-        android:text="@string/allset_navigation_settings" />
+        <TextView
+            android:id="@+id/subtitle"
+            style="@style/TextAppearance.GestureTutorial.Feedback.Subtitle"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/allset_subtitle_margin_top"
+            app:layout_constraintTop_toBottomOf="@id/title"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintWidth_max="@dimen/allset_subtitle_width_max"
+            android:gravity="start"
+            android:text="@string/allset_description"/>
 
-    <androidx.constraintlayout.widget.Guideline
-        android:id="@+id/hint_guideline_bottom"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:orientation="horizontal"
-        app:layout_constraintGuide_percent="0.94" />
+        <androidx.constraintlayout.widget.Guideline
+            android:id="@+id/navigation_settings_guideline_bottom"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal"
+            app:layout_constraintGuide_percent="0.83" />
 
-    <TextView
-        android:id="@+id/hint"
-        style="@style/TextAppearance.GestureTutorial.Feedback.Subtitle"
-        android:textSize="14sp"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintBottom_toBottomOf="@id/hint_guideline_bottom"
-        android:text="@string/allset_hint"/>
-</androidx.constraintlayout.widget.ConstraintLayout>
+        <TextView
+            android:id="@+id/navigation_settings"
+            style="@style/TextAppearance.GestureTutorial.LinkText"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintBottom_toBottomOf="@id/navigation_settings_guideline_bottom"
+            android:minHeight="48dp"
+            android:background="?android:attr/selectableItemBackground"
+            android:text="@string/allset_navigation_settings" />
+
+        <androidx.constraintlayout.widget.Guideline
+            android:id="@+id/hint_guideline_bottom"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal"
+            app:layout_constraintGuide_percent="0.94" />
+
+        <TextView
+            android:id="@+id/hint"
+            style="@style/TextAppearance.GestureTutorial.Feedback.Subtitle"
+            android:textSize="14sp"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintBottom_toBottomOf="@id/hint_guideline_bottom"
+            android:text="@string/allset_hint"/>
+    </androidx.constraintlayout.widget.ConstraintLayout>
+
+</FrameLayout>
\ No newline at end of file
diff --git a/quickstep/res/layout/fallback_recents_activity.xml b/quickstep/res/layout/fallback_recents_activity.xml
index a43296f..bfeb82d 100644
--- a/quickstep/res/layout/fallback_recents_activity.xml
+++ b/quickstep/res/layout/fallback_recents_activity.xml
@@ -45,8 +45,7 @@
             android:layout_height="match_parent"
             android:clipChildren="false"
             android:clipToPadding="false"
-            android:outlineProvider="none"
-            android:theme="@style/HomeScreenElementTheme" />
+            android:outlineProvider="none" />
 
         <include
             android:id="@+id/overview_actions_view"
diff --git a/quickstep/res/layout/gesture_tutorial_foldable_mock_conversation.xml b/quickstep/res/layout/gesture_tutorial_foldable_mock_conversation.xml
index 34bd4e2..b0cc00b 100644
--- a/quickstep/res/layout/gesture_tutorial_foldable_mock_conversation.xml
+++ b/quickstep/res/layout/gesture_tutorial_foldable_mock_conversation.xml
@@ -84,7 +84,7 @@
         android:layout_width="match_parent"
         android:layout_height="0dp"
         android:background="@color/mock_conversation_background"
-        android:paddingBottom="80dp"
+        android:paddingBottom="@dimen/gesture_tutorial_mock_taskbar_height"
 
         app:layout_constraintTop_toBottomOf="@id/top_bar"
         app:layout_constraintBottom_toBottomOf="parent"
diff --git a/quickstep/res/layout/gesture_tutorial_foldable_mock_conversation_list.xml b/quickstep/res/layout/gesture_tutorial_foldable_mock_conversation_list.xml
index 0309cc3..e5cd9bc 100644
--- a/quickstep/res/layout/gesture_tutorial_foldable_mock_conversation_list.xml
+++ b/quickstep/res/layout/gesture_tutorial_foldable_mock_conversation_list.xml
@@ -51,7 +51,7 @@
         android:layout_width="match_parent"
         android:layout_height="0dp"
         android:background="@color/mock_list_background"
-        android:paddingBottom="80dp"
+        android:paddingBottom="@dimen/gesture_tutorial_mock_taskbar_height"
 
         app:layout_constraintTop_toBottomOf="@id/top_bar"
         app:layout_constraintBottom_toBottomOf="parent"
diff --git a/quickstep/res/layout/gesture_tutorial_foldable_mock_taskbar.xml b/quickstep/res/layout/gesture_tutorial_foldable_mock_taskbar.xml
new file mode 100644
index 0000000..ddfeeec
--- /dev/null
+++ b/quickstep/res/layout/gesture_tutorial_foldable_mock_taskbar.xml
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.android.quickstep.interaction.AnimatedTaskbarView
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="@dimen/gesture_tutorial_mock_taskbar_height">
+
+    <View
+        android:id="@+id/taskbar_background"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/gesture_tutorial_taskbar_color"
+
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"/>
+
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:id="@+id/icon_container"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintEnd_toEndOf="parent">
+
+        <androidx.cardview.widget.CardView
+            android:id="@+id/taskbar_icon_1"
+            android:layout_width="@dimen/gesture_tutorial_taskbar_icon_size"
+            android:layout_height="@dimen/gesture_tutorial_taskbar_icon_size"
+            android:layout_marginStart="@dimen/gesture_tutorial_taskbar_padding_start_end"
+
+            app:cardElevation="0dp"
+            app:cardCornerRadius="@dimen/gesture_tutorial_taskbar_icon_corner_radius"
+            app:cardBackgroundColor="@color/mock_app_icon_1"
+            app:layout_constraintDimensionRatio="1:1"
+            app:layout_constraintHorizontal_chainStyle="spread_inside"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toStartOf="@id/taskbar_icon_2"/>
+
+        <androidx.cardview.widget.CardView
+            android:id="@+id/taskbar_icon_2"
+            android:layout_width="@dimen/gesture_tutorial_taskbar_icon_size"
+            android:layout_height="@dimen/gesture_tutorial_taskbar_icon_size"
+
+            app:cardElevation="0dp"
+            app:cardCornerRadius="@dimen/gesture_tutorial_taskbar_icon_corner_radius"
+            app:cardBackgroundColor="@color/mock_app_icon_2"
+            app:layout_constraintDimensionRatio="1:1"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintStart_toEndOf="@id/taskbar_icon_1"
+            app:layout_constraintEnd_toStartOf="@id/taskbar_icon_3"/>
+
+        <androidx.cardview.widget.CardView
+            android:id="@+id/taskbar_icon_3"
+            android:layout_width="@dimen/gesture_tutorial_taskbar_icon_size"
+            android:layout_height="@dimen/gesture_tutorial_taskbar_icon_size"
+
+            app:cardElevation="0dp"
+            app:cardCornerRadius="@dimen/gesture_tutorial_taskbar_icon_corner_radius"
+            app:cardBackgroundColor="@color/mock_app_icon_3"
+            app:layout_constraintDimensionRatio="1:1"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintStart_toEndOf="@id/taskbar_icon_2"
+            app:layout_constraintEnd_toStartOf="@id/taskbar_icon_4"/>
+
+        <androidx.cardview.widget.CardView
+            android:id="@+id/taskbar_icon_4"
+            android:layout_width="@dimen/gesture_tutorial_taskbar_icon_size"
+            android:layout_height="@dimen/gesture_tutorial_taskbar_icon_size"
+
+            app:cardElevation="0dp"
+            app:cardCornerRadius="@dimen/gesture_tutorial_taskbar_icon_corner_radius"
+            app:cardBackgroundColor="@color/mock_app_icon_1"
+            app:layout_constraintDimensionRatio="1:1"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintStart_toEndOf="@id/taskbar_icon_3"
+            app:layout_constraintEnd_toStartOf="@id/taskbar_icon_5"/>
+
+        <androidx.cardview.widget.CardView
+            android:id="@+id/taskbar_icon_5"
+            android:layout_width="@dimen/gesture_tutorial_taskbar_icon_size"
+            android:layout_height="@dimen/gesture_tutorial_taskbar_icon_size"
+
+            app:cardElevation="0dp"
+            app:cardCornerRadius="@dimen/gesture_tutorial_taskbar_icon_corner_radius"
+            app:cardBackgroundColor="@color/mock_app_icon_4"
+            app:layout_constraintDimensionRatio="1:1"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintStart_toEndOf="@id/taskbar_icon_4"
+            app:layout_constraintEnd_toStartOf="@id/taskbar_icon_6"/>
+
+        <androidx.cardview.widget.CardView
+            android:id="@+id/taskbar_icon_6"
+            android:layout_width="@dimen/gesture_tutorial_taskbar_icon_size"
+            android:layout_height="@dimen/gesture_tutorial_taskbar_icon_size"
+            android:layout_marginEnd="@dimen/gesture_tutorial_taskbar_padding_start_end"
+
+            app:cardElevation="0dp"
+            app:cardCornerRadius="@dimen/gesture_tutorial_taskbar_icon_corner_radius"
+            app:cardBackgroundColor="@color/mock_app_icon_2"
+            app:layout_constraintDimensionRatio="1:1"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintStart_toEndOf="@id/taskbar_icon_5"
+            app:layout_constraintEnd_toEndOf="parent"/>
+
+    </androidx.constraintlayout.widget.ConstraintLayout>
+
+</com.android.quickstep.interaction.AnimatedTaskbarView>
\ No newline at end of file
diff --git a/quickstep/res/layout/gesture_tutorial_fragment.xml b/quickstep/res/layout/gesture_tutorial_fragment.xml
index 41d0a1d..08e6178 100644
--- a/quickstep/res/layout/gesture_tutorial_fragment.xml
+++ b/quickstep/res/layout/gesture_tutorial_fragment.xml
@@ -101,6 +101,15 @@
         android:layout_height="match_parent"
         android:background="@drawable/gesture_tutorial_ripple"/>
 
+    <include
+        layout="@layout/gesture_tutorial_foldable_mock_taskbar"
+        android:id="@+id/gesture_tutorial_fake_taskbar_view"
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/gesture_tutorial_mock_taskbar_height"
+        android:layout_alignParentBottom="true"
+        android:layout_alignParentStart="true"
+        android:layout_alignParentEnd="true" />
+
     <ImageView
         android:id="@+id/gesture_tutorial_edge_gesture_video"
         android:layout_width="match_parent"
diff --git a/quickstep/res/layout/predicted_hotseat_edu.xml b/quickstep/res/layout/predicted_hotseat_edu.xml
index 1dab482..e4e3956 100644
--- a/quickstep/res/layout/predicted_hotseat_edu.xml
+++ b/quickstep/res/layout/predicted_hotseat_edu.xml
@@ -73,6 +73,7 @@
                 launcher:containerType="hotseat" />
 
             <LinearLayout
+                android:id="@+id/button_container"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:paddingLeft="@dimen/bottom_sheet_edu_padding"
diff --git a/quickstep/res/values-night/colors.xml b/quickstep/res/values-night/colors.xml
index c3b2536..af6e064 100644
--- a/quickstep/res/values-night/colors.xml
+++ b/quickstep/res/values-night/colors.xml
@@ -22,4 +22,6 @@
     <color name="mock_webpage_url_bar">#202124</color>
     <color name="mock_webpage_url_bar_item">#3c4043</color>
 
+    <color name="all_set_page_background">#FF000000</color>
+
 </resources>
\ No newline at end of file
diff --git a/quickstep/res/values-night/styles.xml b/quickstep/res/values-night/styles.xml
index 1bd3f5d..e6b3450 100644
--- a/quickstep/res/values-night/styles.xml
+++ b/quickstep/res/values-night/styles.xml
@@ -21,7 +21,7 @@
         <item name="android:statusBarColor">@android:color/transparent</item>
         <item name="android:enforceNavigationBarContrast">false</item>
         <item name="android:windowLightStatusBar">false</item>
-        <item name="android:windowBackground">#FF000000</item>
+        <item name="android:windowBackground">@android:color/transparent</item>
     </style>
 
 </resources>
\ No newline at end of file
diff --git a/quickstep/res/values/colors.xml b/quickstep/res/values/colors.xml
index 5edcc9d..fb2ee1c 100644
--- a/quickstep/res/values/colors.xml
+++ b/quickstep/res/values/colors.xml
@@ -40,6 +40,7 @@
     <color name="gesture_tutorial_fake_previous_task_view_color">#3C4043</color> <!-- Gray -->
     <color name="gesture_tutorial_action_button_label_color">#FF000000</color>
     <color name="gesture_tutorial_primary_color">#B7F29F</color> <!-- Light Green -->
+    <color name="gesture_tutorial_taskbar_color">#202124</color>
 
     <!-- Mock hotseat -->
     <color name="mock_app_icon_1">#8AB4F8</color>
@@ -72,4 +73,7 @@
     <color name="mock_webpage_top_bar">#e8eaed</color>
     <color name="mock_webpage_top_bar_item">#80868b</color>
     <color name="mock_webpage_page_text">#bdc1c6</color>
+
+    <color name="all_set_page_background">#FFFFFFFF</color>
+
 </resources>
\ No newline at end of file
diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml
index e08eda8..4ebf5cf 100644
--- a/quickstep/res/values/dimens.xml
+++ b/quickstep/res/values/dimens.xml
@@ -121,6 +121,7 @@
     <dimen name="gesture_tutorial_foldable_feedback_margin_start_end">140dp</dimen>
     <dimen name="gesture_tutorial_multi_row_task_view_spacing">72dp</dimen>
     <dimen name="gesture_tutorial_small_task_view_corner_radius">18dp</dimen>
+    <dimen name="gesture_tutorial_mock_taskbar_height">80dp</dimen>
 
     <!-- Gesture Tutorial mock conversations -->
     <dimen name="gesture_tutorial_message_icon_size">44dp</dimen>
@@ -155,12 +156,18 @@
     <dimen name="gesture_tutorial_webpage_large_line_height">36dp</dimen>
     <dimen name="gesture_tutorial_webpage_small_line_height">22dp</dimen>
 
+    <!-- Gesture Tutorial mock taskbar -->
+    <dimen name="gesture_tutorial_taskbar_icon_size">44dp</dimen>
+    <dimen name="gesture_tutorial_taskbar_icon_corner_radius">100dp</dimen>
+    <dimen name="gesture_tutorial_taskbar_padding_start_end">218dp</dimen>
+
     <!-- All Set page -->
     <dimen name="allset_page_margin_horizontal">40dp</dimen>
     <dimen name="allset_title_margin_top">24dp</dimen>
     <dimen name="allset_title_icon_margin_top">32dp</dimen>
     <dimen name="allset_subtitle_margin_top">24dp</dimen>
     <dimen name="allset_subtitle_width_max">348dp</dimen>
+    <dimen name="allset_swipe_up_shift">10dp</dimen>
 
     <!-- All Apps Education tutorial -->
     <dimen name="swipe_edu_padding">8dp</dimen>
diff --git a/quickstep/res/values/styles.xml b/quickstep/res/values/styles.xml
index b5444b5..40e18ec 100644
--- a/quickstep/res/values/styles.xml
+++ b/quickstep/res/values/styles.xml
@@ -115,7 +115,7 @@
         <item name="android:statusBarColor">@android:color/transparent</item>
         <item name="android:enforceNavigationBarContrast">false</item>
         <item name="android:windowLightStatusBar">true</item>
-        <item name="android:windowBackground">#FFFFFFFF</item>
+        <item name="android:windowBackground">@android:color/transparent</item>
     </style>
 
     <!--
diff --git a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
index e8ea671..6e2d2a9 100644
--- a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
+++ b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
@@ -57,7 +57,6 @@
 import com.android.launcher3.statemanager.StateManager.StateHandler;
 import com.android.launcher3.taskbar.LauncherTaskbarUIController;
 import com.android.launcher3.taskbar.TaskbarManager;
-import com.android.launcher3.taskbar.TaskbarStateHandler;
 import com.android.launcher3.uioverrides.RecentsViewStateController;
 import com.android.launcher3.util.ActivityOptionsWrapper;
 import com.android.launcher3.util.DisplayController;
@@ -115,8 +114,6 @@
     private @Nullable OverviewCommandHelper mOverviewCommandHelper;
     private @Nullable LauncherTaskbarUIController mTaskbarUIController;
 
-    private final TaskbarStateHandler mTaskbarStateHandler = new TaskbarStateHandler(this);
-
     // Will be updated when dragging from taskbar.
     private @Nullable DragOptions mNextWorkspaceDragOptions = null;
 
@@ -368,17 +365,12 @@
         out.add(getDepthController());
         out.add(new RecentsViewStateController(this));
         out.add(new BackButtonAlphaHandler(this));
-        out.add(getTaskbarStateHandler());
     }
 
     public DepthController getDepthController() {
         return mDepthController;
     }
 
-    public TaskbarStateHandler getTaskbarStateHandler() {
-        return mTaskbarStateHandler;
-    }
-
     @Nullable
     public UnfoldTransitionProgressProvider getUnfoldTransitionProgressProvider() {
         return mUnfoldTransitionProgressProvider;
diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
index ddb20a1..8a05533 100644
--- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
+++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
@@ -439,9 +439,9 @@
                         4 - rotationChange);
             }
         }
-        // TODO(b/196637509): don't do this for immersive apps.
         if (mDeviceProfile.isTaskbarPresentInApps) {
-            bounds.bottom -= mDeviceProfile.taskbarSize;
+            // Animate to above the taskbar.
+            bounds.bottom -= target.contentInsets.bottom;
         }
         return bounds;
     }
diff --git a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java
index c41f2ce..119ae90 100644
--- a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java
+++ b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java
@@ -28,17 +28,20 @@
 import android.view.LayoutInflater;
 import android.view.View;
 import android.widget.Button;
+import android.widget.LinearLayout;
 import android.widget.TextView;
 
 import com.android.launcher3.AbstractFloatingView;
 import com.android.launcher3.CellLayout;
 import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.Insettable;
+import com.android.launcher3.InvariantDeviceProfile;
 import com.android.launcher3.Launcher;
 import com.android.launcher3.R;
 import com.android.launcher3.anim.Interpolators;
 import com.android.launcher3.config.FeatureFlags;
 import com.android.launcher3.model.data.WorkspaceItemInfo;
+import com.android.launcher3.uioverrides.ApiWrapper;
 import com.android.launcher3.uioverrides.PredictedAppIcon;
 import com.android.launcher3.views.AbstractSlideInView;
 
@@ -89,8 +92,9 @@
         mHotseatWrapper = findViewById(R.id.hotseat_wrapper);
         mSampleHotseat = findViewById(R.id.sample_prediction);
 
+        Context context = getContext();
         DeviceProfile grid = mActivityContext.getDeviceProfile();
-        Rect padding = grid.getHotseatLayoutPadding(getContext());
+        Rect padding = grid.getHotseatLayoutPadding(context);
 
         mSampleHotseat.getLayoutParams().height = grid.cellHeightPx;
         mSampleHotseat.setGridSize(grid.numShownHotseatIcons, 1);
@@ -102,6 +106,15 @@
         mDismissBtn = findViewById(R.id.no_thanks);
         mDismissBtn.setOnClickListener(this::onDismiss);
 
+        LinearLayout buttonContainer = findViewById(R.id.button_container);
+        int adjustedMarginEnd = ApiWrapper.getHotseatEndOffset(context)
+                - buttonContainer.getPaddingEnd();
+        if (InvariantDeviceProfile.INSTANCE.get(context)
+                .getDeviceProfile(context).isTaskbarPresent && adjustedMarginEnd > 0) {
+            ((LinearLayout.LayoutParams) buttonContainer.getLayoutParams()).setMarginEnd(
+                    adjustedMarginEnd);
+        }
+
         // update ui to reflect which migration method is going to be used
         if (FeatureFlags.HOTSEAT_MIGRATE_TO_FOLDER.get()) {
             ((TextView) findViewById(R.id.hotseat_edu_content)).setText(
diff --git a/quickstep/src/com/android/launcher3/model/WidgetsPredictionUpdateTask.java b/quickstep/src/com/android/launcher3/model/WidgetsPredictionUpdateTask.java
index 3d891e8..4be83dc 100644
--- a/quickstep/src/com/android/launcher3/model/WidgetsPredictionUpdateTask.java
+++ b/quickstep/src/com/android/launcher3/model/WidgetsPredictionUpdateTask.java
@@ -83,7 +83,7 @@
             }
         } else {
             Map<ComponentKey, WidgetItem> widgetItems =
-                    allWidgets.values().stream().flatMap(List::stream)
+                    allWidgets.values().stream().flatMap(List::stream).distinct()
                             .collect(Collectors.toMap(widget -> (ComponentKey) widget,
                                     widget -> widget));
             for (AppTarget app : mTargets) {
diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
index f206252..648a16e 100644
--- a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
@@ -21,14 +21,20 @@
 import static com.android.launcher3.taskbar.TaskbarStashController.FLAG_IN_STASHED_LAUNCHER_STATE;
 import static com.android.launcher3.taskbar.TaskbarStashController.TASKBAR_STASH_DURATION;
 import static com.android.launcher3.taskbar.TaskbarViewController.ALPHA_INDEX_HOME;
+import static com.android.systemui.shared.system.WindowManagerWrapper.ITYPE_EXTRA_NAVIGATION_BAR;
 
 import android.animation.Animator;
 import android.animation.AnimatorListenerAdapter;
 import android.animation.AnimatorSet;
 import android.animation.ObjectAnimator;
+import android.annotation.ColorInt;
 import android.graphics.Rect;
+import android.os.RemoteException;
+import android.util.Log;
 import android.view.MotionEvent;
+import android.view.TaskTransitionSpec;
 import android.view.View;
+import android.view.WindowManagerGlobal;
 
 import androidx.annotation.NonNull;
 
@@ -36,6 +42,7 @@
 import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.LauncherState;
 import com.android.launcher3.QuickstepTransitionManager;
+import com.android.launcher3.R;
 import com.android.launcher3.Utilities;
 import com.android.launcher3.anim.AnimatorListeners;
 import com.android.launcher3.anim.PendingAnimation;
@@ -56,6 +63,7 @@
 import com.android.systemui.shared.recents.model.ThumbnailData;
 
 import java.util.Arrays;
+import java.util.Set;
 import java.util.function.Supplier;
 import java.util.stream.Stream;
 
@@ -64,6 +72,8 @@
  */
 public class LauncherTaskbarUIController extends TaskbarUIController {
 
+    private static final String TAG = "TaskbarUIController";
+
     private final BaseQuickstepLauncher mLauncher;
 
     private final AnimatedFloat mIconAlignmentForResumedState =
@@ -193,6 +203,7 @@
         mLauncher.getHotseat().setIconsAlpha(1f);
         mLauncher.setTaskbarUIController(null);
         mLauncher.removeOnDeviceProfileChangeListener(mProfileChangeListener);
+        updateTaskTransitionSpec(true);
     }
 
     @Override
@@ -367,6 +378,32 @@
     private void onStashedInAppChanged(DeviceProfile deviceProfile) {
         boolean taskbarStashedInApps = mControllers.taskbarStashController.isStashedInApp();
         deviceProfile.isTaskbarPresentInApps = !taskbarStashedInApps;
+        updateTaskTransitionSpec(taskbarStashedInApps);
+    }
+
+    private void updateTaskTransitionSpec(boolean taskbarIsHidden) {
+        try {
+            if (taskbarIsHidden) {
+                // Clear custom task transition settings when the taskbar is stashed
+                WindowManagerGlobal.getWindowManagerService().clearTaskTransitionSpec();
+            } else {
+                // Adjust task transition spec to account for taskbar being visible
+                @ColorInt int taskAnimationBackgroundColor =
+                        mLauncher.getColor(R.color.taskbar_background);
+
+                TaskTransitionSpec customTaskAnimationSpec = new TaskTransitionSpec(
+                        taskAnimationBackgroundColor,
+                        Set.of(ITYPE_EXTRA_NAVIGATION_BAR)
+                );
+                WindowManagerGlobal.getWindowManagerService()
+                        .setTaskTransitionSpec(customTaskAnimationSpec);
+            }
+        } catch (RemoteException e) {
+            // This shouldn't happen but if it does task animations won't look good until the
+            // taskbar stashing state is changed.
+            Log.e(TAG, "Failed to update task transition spec to account for new taskbar state",
+                    e);
+        }
     }
 
     /**
diff --git a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
index b768d60..69804bd 100644
--- a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
@@ -30,7 +30,9 @@
 import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_HOME_DISABLED;
 import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SHOWING;
 import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SWITCHER_SHOWING;
+import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED;
 import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED;
+import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
 
 import android.animation.ObjectAnimator;
 import android.annotation.DrawableRes;
@@ -81,6 +83,7 @@
     private static final int FLAG_DISABLE_HOME = 1 << 7;
     private static final int FLAG_DISABLE_RECENTS = 1 << 8;
     private static final int FLAG_DISABLE_BACK = 1 << 9;
+    private static final int FLAG_NOTIFICATION_SHADE_EXPANDED = 1 << 10;
 
     private static final int MASK_IME_SWITCHER_VISIBLE = FLAG_SWITCHER_SUPPORTED | FLAG_IME_VISIBLE;
 
@@ -98,6 +101,8 @@
 
     private final AnimatedFloat mTaskbarNavButtonTranslationY = new AnimatedFloat(
             this::updateNavButtonTranslationY);
+    private final AnimatedFloat mNavButtonTranslationYMultiplier = new AnimatedFloat(
+            this::updateNavButtonTranslationY);
 
     // Initialized in init.
     private TaskbarControllers mControllers;
@@ -120,6 +125,7 @@
         mControllers = controllers;
         mNavButtonsView.getLayoutParams().height = mContext.getDeviceProfile().taskbarSize;
         parseSystemUiFlags(sharedState.sysuiStateFlags);
+        mNavButtonTranslationYMultiplier.value = 1;
 
         mA11yLongClickListener = view -> {
             mControllers.navButtonController.onButtonClick(BUTTON_A11Y_LONG_CLICK);
@@ -149,6 +155,11 @@
                 .getKeyguardBgTaskbar(),
                 flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0, AnimatedFloat.VALUE, 1, 0));
 
+        // Make sure to remove nav bar buttons translation when notification shade is expanded.
+        mPropertyHolders.add(new StatePropertyHolder(mNavButtonTranslationYMultiplier,
+                flags -> (flags & FLAG_NOTIFICATION_SHADE_EXPANDED) != 0, AnimatedFloat.VALUE,
+                0, 1));
+
         // Force nav buttons (specifically back button) to be visible during setup wizard.
         boolean isInSetup = !mContext.isUserSetupComplete();
         if (isThreeButtonNav || isInSetup) {
@@ -176,12 +187,12 @@
                 }
             }
 
-            // Animate taskbar background when IME shows
+            // Animate taskbar background when any of these flags are enabled
+            int flagsToShowBg = FLAG_IME_VISIBLE | FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE
+                    | FLAG_NOTIFICATION_SHADE_EXPANDED;
             mPropertyHolders.add(new StatePropertyHolder(
                     mControllers.taskbarDragLayerController.getNavbarBackgroundAlpha(),
-                    flags -> (flags & FLAG_IME_VISIBLE) != 0 ||
-                            (flags & FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE) != 0,
-                    AnimatedFloat.VALUE, 1, 0));
+                    flags -> (flags & flagsToShowBg) != 0, AnimatedFloat.VALUE, 1, 0));
 
             // Rotation button
             RotationButton rotationButton = new RotationButtonImpl(
@@ -258,6 +269,9 @@
         boolean isHomeDisabled = (sysUiStateFlags & SYSUI_STATE_HOME_DISABLED) != 0;
         boolean isRecentsDisabled = (sysUiStateFlags & SYSUI_STATE_OVERVIEW_DISABLED) != 0;
         boolean isBackDisabled = (sysUiStateFlags & SYSUI_STATE_BACK_DISABLED) != 0;
+        int shadeExpandedFlags = SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED
+                | SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
+        boolean isNotificationShadeExpanded = (sysUiStateFlags & shadeExpandedFlags) != 0;
 
         // TODO(b/202218289) we're getting IME as not visible on lockscreen from system
         updateStateForFlag(FLAG_IME_VISIBLE, isImeVisible);
@@ -266,6 +280,7 @@
         updateStateForFlag(FLAG_DISABLE_HOME, isHomeDisabled);
         updateStateForFlag(FLAG_DISABLE_RECENTS, isRecentsDisabled);
         updateStateForFlag(FLAG_DISABLE_BACK, isBackDisabled);
+        updateStateForFlag(FLAG_NOTIFICATION_SHADE_EXPANDED, isNotificationShadeExpanded);
 
         if (mA11yButton != null) {
             // Only used in 3 button
@@ -360,7 +375,8 @@
     }
 
     private void updateNavButtonTranslationY() {
-        mNavButtonsView.setTranslationY(mTaskbarNavButtonTranslationY.value);
+        mNavButtonsView.setTranslationY(mTaskbarNavButtonTranslationY.value
+                * mNavButtonTranslationYMultiplier.value);
     }
 
     private ImageView addButton(@DrawableRes int drawableId, @TaskbarButton int buttonType,
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
index 370496a..8ae661f 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
@@ -25,6 +25,7 @@
 import static com.android.systemui.shared.system.WindowManagerWrapper.ITYPE_BOTTOM_TAPPABLE_ELEMENT;
 import static com.android.systemui.shared.system.WindowManagerWrapper.ITYPE_EXTRA_NAVIGATION_BAR;
 
+import android.animation.AnimatorSet;
 import android.app.ActivityOptions;
 import android.content.ActivityNotFoundException;
 import android.content.Context;
@@ -328,10 +329,9 @@
         mControllers.navbarButtonsViewController.updateStateForSysuiFlags(systemUiStateFlags);
         mControllers.taskbarViewController.setImeIsVisible(
                 mControllers.navbarButtonsViewController.isImeVisible());
-        boolean panelExpanded = (systemUiStateFlags & SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED) != 0;
-        boolean inSettings = (systemUiStateFlags & SYSUI_STATE_QUICK_SETTINGS_EXPANDED) != 0;
-        mControllers.taskbarViewController.setNotificationShadeIsExpanded(
-                panelExpanded || inSettings);
+        int shadeExpandedFlags = SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED
+                | SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
+        onNotificationShadeExpandChanged((systemUiStateFlags & shadeExpandedFlags) != 0);
         mControllers.taskbarViewController.setRecentsButtonDisabled(
                 mControllers.navbarButtonsViewController.isRecentsDisabled());
         mControllers.stashedHandleViewController.setIsHomeButtonDisabled(
@@ -341,6 +341,21 @@
         mControllers.taskbarScrimViewController.updateStateForSysuiFlags(systemUiStateFlags);
     }
 
+    /**
+     * Hides the taskbar icons and background when the notication shade is expanded.
+     */
+    private void onNotificationShadeExpandChanged(boolean isExpanded) {
+        float alpha = isExpanded ? 0 : 1;
+        AnimatorSet anim = new AnimatorSet();
+        anim.play(mControllers.taskbarViewController.getTaskbarIconAlpha().getProperty(
+                TaskbarViewController.ALPHA_INDEX_NOTIFICATION_EXPANDED).animateToValue(alpha));
+        if (!isThreeButtonNav()) {
+            anim.play(mControllers.taskbarDragLayerController.getNotificationShadeBgTaskbar()
+                    .animateToValue(alpha));
+        }
+        anim.start();
+    }
+
     public void onRotationProposal(int rotation, boolean isValid) {
         mControllers.rotationButtonController.onRotationProposal(rotation, isValid);
     }
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java
index 05b0a11..cec892f 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java
@@ -42,6 +42,8 @@
     private final AnimatedFloat mBgTaskbar = new AnimatedFloat(this::updateBackgroundAlpha);
     private final AnimatedFloat mBgNavbar = new AnimatedFloat(this::updateBackgroundAlpha);
     private final AnimatedFloat mKeyguardBgTaskbar = new AnimatedFloat(this::updateBackgroundAlpha);
+    private final AnimatedFloat mNotificationShadeBgTaskbar = new AnimatedFloat(
+            this::updateBackgroundAlpha);
     // Used to hide our background color when someone else (e.g. ScrimView) is handling it.
     private final AnimatedFloat mBgOverride = new AnimatedFloat(this::updateBackgroundAlpha);
 
@@ -65,6 +67,7 @@
 
         mBgTaskbar.value = 1;
         mKeyguardBgTaskbar.value = 1;
+        mNotificationShadeBgTaskbar.value = 1;
         mBgOverride.value = 1;
         updateBackgroundAlpha();
     }
@@ -95,6 +98,10 @@
         return mKeyguardBgTaskbar;
     }
 
+    public AnimatedFloat getNotificationShadeBgTaskbar() {
+        return mNotificationShadeBgTaskbar;
+    }
+
     public AnimatedFloat getOverrideBackgroundAlpha() {
         return mBgOverride;
     }
@@ -105,7 +112,8 @@
 
     private void updateBackgroundAlpha() {
         final float bgNavbar = mBgNavbar.value;
-        final float bgTaskbar = mBgTaskbar.value * mKeyguardBgTaskbar.value;
+        final float bgTaskbar = mBgTaskbar.value * mKeyguardBgTaskbar.value
+                * mNotificationShadeBgTaskbar.value;
         mTaskbarDragLayer.setTaskbarBackgroundAlpha(
                 mBgOverride.value * Math.max(bgNavbar, bgTaskbar)
         );
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStateHandler.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStateHandler.java
deleted file mode 100644
index edd2a22..0000000
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStateHandler.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.launcher3.taskbar;
-
-import static com.android.launcher3.LauncherState.TASKBAR;
-import static com.android.launcher3.anim.Interpolators.LINEAR;
-
-import com.android.launcher3.BaseQuickstepLauncher;
-import com.android.launcher3.LauncherState;
-import com.android.launcher3.anim.PendingAnimation;
-import com.android.launcher3.anim.PropertySetter;
-import com.android.launcher3.statemanager.StateManager;
-import com.android.launcher3.states.StateAnimationConfig;
-import com.android.quickstep.AnimatedFloat;
-import com.android.quickstep.SystemUiProxy;
-
-/**
- * StateHandler to animate Taskbar according to Launcher's state machine.
- */
-public class TaskbarStateHandler implements StateManager.StateHandler<LauncherState> {
-
-    private final BaseQuickstepLauncher mLauncher;
-
-    private AnimatedFloat mNavbarButtonAlpha = new AnimatedFloat(this::updateNavbarButtonAlpha);
-
-    public TaskbarStateHandler(BaseQuickstepLauncher launcher) {
-        mLauncher = launcher;
-    }
-
-    @Override
-    public void setState(LauncherState state) {
-        setState(state, PropertySetter.NO_ANIM_PROPERTY_SETTER);
-        // Force update the alpha in case it was not initialized properly
-        updateNavbarButtonAlpha();
-    }
-
-    @Override
-    public void setStateWithAnimation(LauncherState toState, StateAnimationConfig config,
-            PendingAnimation animation) {
-        setState(toState, animation);
-    }
-
-    /**
-     * Sets the provided state
-     */
-    public void setState(LauncherState toState, PropertySetter setter) {
-        boolean isTaskbarVisible = (toState.getVisibleElements(mLauncher) & TASKBAR) != 0;
-        // Make the nav bar visible in states that taskbar isn't visible.
-        // TODO: We should draw our own handle instead of showing the nav bar.
-        float navbarButtonAlpha = isTaskbarVisible ? 0f : 1f;
-        setter.setFloat(mNavbarButtonAlpha, AnimatedFloat.VALUE, navbarButtonAlpha, LINEAR);
-    }
-
-
-    private void updateNavbarButtonAlpha() {
-        SystemUiProxy.INSTANCE.get(mLauncher).setNavBarButtonAlpha(mNavbarButtonAlpha.value, false);
-    }
-}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
index 08d2a06..09197c3 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
@@ -116,16 +116,6 @@
     }
 
     /**
-     * Should be called when the notification shade is expanded, so we can hide taskbar icons as
-     * well. Note that we are animating icons to appear / disappear.
-     */
-    public void setNotificationShadeIsExpanded(boolean isNotificationShadeExpanded) {
-        mTaskbarIconAlpha.getProperty(ALPHA_INDEX_NOTIFICATION_EXPANDED)
-                .animateToValue(isNotificationShadeExpanded ? 0 : 1)
-                .start();
-    }
-
-    /**
      * Should be called when the recents button is disabled, so we can hide taskbar icons as well.
      */
     public void setRecentsButtonDisabled(boolean isDisabled) {
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java b/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java
index d0d7f31..106375a 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/SplitScreenSelectState.java
@@ -44,7 +44,7 @@
     public float getSplitSelectTranslation(Launcher launcher) {
         RecentsView recentsView = launcher.getOverviewPanel();
         int splitPosition = recentsView.getSplitPlaceholder().getActiveSplitStagePosition();
-        if (!recentsView.shouldShiftThumbnailsForSplitSelect(splitPosition)) {
+        if (!recentsView.shouldShiftThumbnailsForSplitSelect()) {
             return 0f;
         }
         PagedOrientationHandler orientationHandler = recentsView.getPagedOrientationHandler();
diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
index 3ab73bb..e8aa2fa 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -444,6 +444,10 @@
                 mAnimationFactory = mActivityInterface.prepareRecentsUI(mDeviceState,
                         mWasLauncherAlreadyVisible, this::onAnimatorPlaybackControllerCreated);
                 maybeUpdateRecentsAttachedState(false /* animate */);
+                if (mGestureState.getEndTarget() != null) {
+                    // Update the end target in case the gesture ended before we init.
+                    mAnimationFactory.setEndTarget(mGestureState.getEndTarget());
+                }
             };
             if (mWasLauncherAlreadyVisible) {
                 // Launcher is visible, but might be about to stop. Thus, if we prepare recents
diff --git a/quickstep/src/com/android/quickstep/InputConsumer.java b/quickstep/src/com/android/quickstep/InputConsumer.java
index 3580ee5..0b09323 100644
--- a/quickstep/src/com/android/quickstep/InputConsumer.java
+++ b/quickstep/src/com/android/quickstep/InputConsumer.java
@@ -36,7 +36,7 @@
     int TYPE_SCREEN_PINNED = 1 << 6;
     int TYPE_OVERVIEW_WITHOUT_FOCUS = 1 << 7;
     int TYPE_RESET_GESTURE = 1 << 8;
-    int TYPE_OVERSCROLL = 1 << 9;
+    int TYPE_PROGRESS_DELEGATE = 1 << 9;
     int TYPE_SYSUI_OVERLAY = 1 << 10;
     int TYPE_ONE_HANDED = 1 << 11;
     int TYPE_TASKBAR_STASH = 1 << 12;
@@ -51,7 +51,7 @@
             "TYPE_SCREEN_PINNED",           // 6
             "TYPE_OVERVIEW_WITHOUT_FOCUS",  // 7
             "TYPE_RESET_GESTURE",           // 8
-            "TYPE_OVERSCROLL",              // 9
+            "TYPE_PROGRESS_DELEGATE",       // 9
             "TYPE_SYSUI_OVERLAY",           // 10
             "TYPE_ONE_HANDED",              // 11
             "TYPE_TASKBAR_STASH",           // 12
diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
index e2441ed..73d1424 100644
--- a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
+++ b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java
@@ -59,7 +59,6 @@
 import android.os.UserManager;
 import android.provider.Settings;
 import android.text.TextUtils;
-import android.util.DisplayMetrics;
 import android.view.MotionEvent;
 import android.view.Surface;
 
@@ -581,8 +580,7 @@
             final Info displayInfo = mDisplayController.getInfo();
             return (mRotationTouchHelper.touchInOneHandedModeRegion(ev)
                 && displayInfo.rotation != Surface.ROTATION_90
-                && displayInfo.rotation != Surface.ROTATION_270
-                && displayInfo.densityDpi < DisplayMetrics.DENSITY_600);
+                && displayInfo.rotation != Surface.ROTATION_270);
         }
         return false;
     }
diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java
index 1516b7a..ecc4b2b 100644
--- a/quickstep/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java
@@ -90,6 +90,7 @@
 import com.android.quickstep.inputconsumers.OtherActivityInputConsumer;
 import com.android.quickstep.inputconsumers.OverviewInputConsumer;
 import com.android.quickstep.inputconsumers.OverviewWithoutFocusInputConsumer;
+import com.android.quickstep.inputconsumers.ProgressDelegateInputConsumer;
 import com.android.quickstep.inputconsumers.ResetGestureInputConsumer;
 import com.android.quickstep.inputconsumers.ScreenPinnedInputConsumer;
 import com.android.quickstep.inputconsumers.SysUiOverlayInputConsumer;
@@ -119,6 +120,7 @@
 import java.io.PrintWriter;
 import java.util.Arrays;
 import java.util.LinkedList;
+import java.util.function.Function;
 
 /**
  * Service connected by system-UI for handling touch interaction.
@@ -298,6 +300,13 @@
         public OverviewCommandHelper getOverviewCommandHelper() {
             return mOverviewCommandHelper;
         }
+
+        /**
+         * Sets a proxy to bypass swipe up behavior
+         */
+        public void setSwipeUpProxy(Function<GestureState, AnimatedFloat> proxy) {
+            mSwipeUpProxyProvider = proxy != null ? proxy : (i -> null);
+        }
     }
 
     private static boolean sConnected = false;
@@ -336,6 +345,7 @@
     private DisplayManager mDisplayManager;
 
     private TaskbarManager mTaskbarManager;
+    private Function<GestureState, AnimatedFloat> mSwipeUpProxyProvider = i -> null;
 
     @Override
     public void onCreate() {
@@ -653,6 +663,12 @@
 
     private InputConsumer newConsumer(GestureState previousGestureState,
             GestureState newGestureState, MotionEvent event) {
+        AnimatedFloat progressProxy = mSwipeUpProxyProvider.apply(mGestureState);
+        if (progressProxy != null) {
+            return new ProgressDelegateInputConsumer(this, mTaskAnimationManager,
+                    mGestureState, mInputMonitorCompat, progressProxy);
+        }
+
         boolean canStartSystemGesture = mDeviceState.canStartSystemGesture();
 
         if (!mDeviceState.isUserUnlocked()) {
diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
index 765480c..7e8b83e 100644
--- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
+++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java
@@ -202,6 +202,10 @@
 
     @Override
     public void onStateTransitionStart(RecentsState toState) {
+        if (toState == HOME) {
+            // Clean-up logic that occurs when recents is no longer in use/visible.
+            reset();
+        }
         setOverviewStateEnabled(true);
         setOverviewGridEnabled(toState.displayOverviewTasksAsGrid(mActivity.getDeviceProfile()));
         setOverviewFullscreenEnabled(toState.isFullScreen());
@@ -210,10 +214,6 @@
 
     @Override
     public void onStateTransitionComplete(RecentsState finalState) {
-        if (finalState == HOME) {
-            // Clean-up logic that occurs when recents is no longer in use/visible.
-            reset();
-        }
         setOverlayEnabled(finalState == DEFAULT || finalState == MODAL_TASK);
         setFreezeViewVisibility(false);
     }
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java
new file mode 100644
index 0000000..c69b510
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quickstep.inputconsumers;
+
+import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity;
+import static com.android.launcher3.touch.BaseSwipeDetector.calculateDuration;
+import static com.android.launcher3.touch.SingleAxisSwipeDetector.DIRECTION_POSITIVE;
+import static com.android.launcher3.touch.SingleAxisSwipeDetector.VERTICAL;
+import static com.android.quickstep.MultiStateCallback.DEBUG_STATES;
+import static com.android.quickstep.util.ActiveGestureLog.INTENT_EXTRA_LOG_TRACE_ID;
+
+import android.animation.ObjectAnimator;
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Point;
+import android.view.MotionEvent;
+
+import com.android.launcher3.anim.AnimatorListeners;
+import com.android.launcher3.testing.TestLogging;
+import com.android.launcher3.testing.TestProtocol;
+import com.android.launcher3.touch.SingleAxisSwipeDetector;
+import com.android.launcher3.util.DisplayController;
+import com.android.quickstep.AnimatedFloat;
+import com.android.quickstep.GestureState;
+import com.android.quickstep.InputConsumer;
+import com.android.quickstep.MultiStateCallback;
+import com.android.quickstep.RecentsAnimationCallbacks;
+import com.android.quickstep.RecentsAnimationController;
+import com.android.quickstep.RecentsAnimationTargets;
+import com.android.quickstep.TaskAnimationManager;
+import com.android.systemui.shared.recents.model.ThumbnailData;
+import com.android.systemui.shared.system.InputMonitorCompat;
+
+/**
+ * Input consumer which delegates the swipe-progress handling
+ */
+public class ProgressDelegateInputConsumer implements InputConsumer,
+        RecentsAnimationCallbacks.RecentsAnimationListener,
+        SingleAxisSwipeDetector.Listener {
+
+    private static final float SWIPE_DISTANCE_THRESHOLD = 0.2f;
+
+    private static final String[] STATE_NAMES = DEBUG_STATES ? new String[3] : null;
+    private static int getFlagForIndex(int index, String name) {
+        if (DEBUG_STATES) {
+            STATE_NAMES[index] = name;
+        }
+        return 1 << index;
+    }
+
+    private static final int STATE_TARGET_RECEIVED =
+            getFlagForIndex(0, "STATE_TARGET_RECEIVED");
+    private static final int STATE_HANDLER_INVALIDATED =
+            getFlagForIndex(1, "STATE_HANDLER_INVALIDATED");
+    private static final int STATE_FLING_FINISHED =
+            getFlagForIndex(2, "STATE_FLING_FINISHED");
+
+    private final Context mContext;
+    private final TaskAnimationManager mTaskAnimationManager;
+    private final GestureState mGestureState;
+    private final InputMonitorCompat mInputMonitorCompat;
+    private final MultiStateCallback mStateCallback;
+
+    private final Point mDisplaySize;
+    private final SingleAxisSwipeDetector mSwipeDetector;
+
+    private final AnimatedFloat mProgress;
+
+    private boolean mDragStarted = false;
+
+    private RecentsAnimationController mRecentsAnimationController;
+    private Boolean mFlingEndsOnHome;
+
+    public ProgressDelegateInputConsumer(Context context,
+            TaskAnimationManager taskAnimationManager, GestureState gestureState,
+            InputMonitorCompat inputMonitorCompat, AnimatedFloat progress) {
+        mContext = context;
+        mTaskAnimationManager = taskAnimationManager;
+        mGestureState = gestureState;
+        mInputMonitorCompat = inputMonitorCompat;
+        mProgress = progress;
+
+        // Do not use DeviceProfile as the user data might be locked
+        mDisplaySize = DisplayController.INSTANCE.get(context).getInfo().currentSize;
+
+        // Init states
+        mStateCallback = new MultiStateCallback(STATE_NAMES);
+        mStateCallback.runOnceAtState(STATE_TARGET_RECEIVED | STATE_HANDLER_INVALIDATED,
+                this::endRemoteAnimation);
+        mStateCallback.runOnceAtState(STATE_TARGET_RECEIVED | STATE_FLING_FINISHED,
+                this::onFlingFinished);
+
+        mSwipeDetector = new SingleAxisSwipeDetector(mContext, this, VERTICAL);
+        mSwipeDetector.setDetectableScrollConditions(DIRECTION_POSITIVE, false);
+    }
+
+    @Override
+    public int getType() {
+        return TYPE_PROGRESS_DELEGATE;
+    }
+
+    @Override
+    public void onMotionEvent(MotionEvent ev) {
+        if (mFlingEndsOnHome == null) {
+            mSwipeDetector.onTouchEvent(ev);
+        }
+    }
+
+    @Override
+    public void onDragStart(boolean start, float startDisplacement) {
+        mDragStarted = true;
+        TestLogging.recordEvent(TestProtocol.SEQUENCE_PILFER, "pilferPointers");
+        mInputMonitorCompat.pilferPointers();
+        Intent intent = mGestureState.getHomeIntent()
+                .putExtra(INTENT_EXTRA_LOG_TRACE_ID, mGestureState.getGestureId());
+        mTaskAnimationManager.startRecentsAnimation(mGestureState, intent, this);
+    }
+
+    @Override
+    public boolean onDrag(float displacement) {
+        if (mDisplaySize.y > 0) {
+            mProgress.updateValue(displacement / -mDisplaySize.y);
+        }
+        return true;
+    }
+
+    @Override
+    public void onDragEnd(float velocity) {
+        final boolean willExit;
+        if (mSwipeDetector.isFling(velocity)) {
+            willExit = velocity < 0;
+        } else {
+            willExit = mProgress.value > SWIPE_DISTANCE_THRESHOLD;
+        }
+        float endValue = willExit ? 1 : 0;
+        long duration = calculateDuration(velocity, endValue - mProgress.value);
+        mFlingEndsOnHome = willExit;
+
+        ObjectAnimator anim = mProgress.animateToValue(endValue);
+        anim.setDuration(duration).setInterpolator(scrollInterpolatorForVelocity(velocity));
+        if (mRecentsAnimationController != null) {
+            anim.addListener(AnimatorListeners.forSuccessCallback(
+                    () -> mStateCallback.setState(STATE_FLING_FINISHED)));
+        }
+        anim.start();
+    }
+
+    private void onFlingFinished() {
+        if (mRecentsAnimationController != null) {
+            boolean endToRecents = mFlingEndsOnHome == null ? true : mFlingEndsOnHome;
+            mRecentsAnimationController.finishController(endToRecents /* toRecents */,
+                    null /* callback */, false /* sendUserLeaveHint */);
+        }
+    }
+
+    @Override
+    public void onRecentsAnimationStart(RecentsAnimationController controller,
+            RecentsAnimationTargets targets) {
+        mRecentsAnimationController = controller;
+        mStateCallback.setState(STATE_TARGET_RECEIVED);
+    }
+
+    @Override
+    public void onRecentsAnimationCanceled(ThumbnailData thumbnailData) {
+        mRecentsAnimationController = null;
+    }
+
+    private void endRemoteAnimation() {
+        onDragEnd(Float.MIN_VALUE);
+    }
+
+    @Override
+    public void onConsumerAboutToBeSwitched() {
+        mStateCallback.setState(STATE_HANDLER_INVALIDATED);
+    }
+
+    @Override
+    public boolean allowInterceptByParent() {
+        return !mDragStarted;
+    }
+}
diff --git a/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java b/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java
index f731cb3..272a9a1 100644
--- a/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java
+++ b/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java
@@ -15,10 +15,28 @@
  */
 package com.android.quickstep.interaction;
 
+import static com.android.launcher3.Utilities.mapBoundToRange;
+import static com.android.launcher3.Utilities.mapRange;
+import static com.android.launcher3.anim.Interpolators.LINEAR;
+
 import android.app.Activity;
+import android.app.ActivityManager.RunningTaskInfo;
+import android.content.Context;
 import android.content.Intent;
 import android.content.res.Configuration;
+import android.graphics.Canvas;
 import android.graphics.Color;
+import android.graphics.ColorFilter;
+import android.graphics.ColorMatrix;
+import android.graphics.ColorMatrixColorFilter;
+import android.graphics.Matrix;
+import android.graphics.Paint;
+import android.graphics.PixelFormat;
+import android.graphics.PointF;
+import android.graphics.RadialGradient;
+import android.graphics.Rect;
+import android.graphics.Shader.TileMode;
+import android.graphics.drawable.Drawable;
 import android.os.Bundle;
 import android.util.Log;
 import android.view.View;
@@ -29,9 +47,12 @@
 import android.widget.TextView;
 
 import androidx.annotation.Nullable;
+import androidx.core.graphics.ColorUtils;
 
 import com.android.launcher3.R;
 import com.android.launcher3.Utilities;
+import com.android.quickstep.AnimatedFloat;
+import com.android.quickstep.GestureState;
 import com.android.quickstep.TouchInteractionService.TISBinder;
 import com.android.quickstep.util.TISBindHelper;
 
@@ -49,13 +70,23 @@
     private static final String EXTRA_ACCENT_COLOR_DARK_MODE = "suwColorAccentDark";
     private static final String EXTRA_ACCENT_COLOR_LIGHT_MODE = "suwColorAccentLight";
 
+    private static final float HINT_BOTTOM_FACTOR = 1 - .94f;
+
     private TISBindHelper mTISBindHelper;
     private TISBinder mBinder;
 
+    private final AnimatedFloat mSwipeProgress = new AnimatedFloat(this::onSwipeProgressUpdate);
+    private BgDrawable mBackground;
+    private View mContentView;
+    private float mSwipeUpShift;
+
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_allset);
+        findViewById(R.id.root_view).setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+                | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+                | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
 
         int mode = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
         boolean isDarkTheme = mode == Configuration.UI_MODE_NIGHT_YES;
@@ -65,6 +96,11 @@
 
         ((ImageView) findViewById(R.id.icon)).getDrawable().mutate().setTint(accentColor);
 
+        mBackground = new BgDrawable(this);
+        findViewById(R.id.root_view).setBackground(mBackground);
+        mContentView = findViewById(R.id.content_view);
+        mSwipeUpShift = getResources().getDimension(R.dimen.allset_swipe_up_shift);
+
         TextView tv = findViewById(R.id.navigation_settings);
         tv.setTextColor(accentColor);
         tv.setOnClickListener(v -> {
@@ -86,19 +122,26 @@
         super.onResume();
         if (mBinder != null) {
             mBinder.getTaskbarManager().setSetupUIVisible(true);
+            mBinder.setSwipeUpProxy(this::createSwipeUpProxy);
         }
     }
 
     private void onTISConnected(TISBinder binder) {
         mBinder = binder;
         mBinder.getTaskbarManager().setSetupUIVisible(isResumed());
+        mBinder.setSwipeUpProxy(isResumed() ? this::createSwipeUpProxy : null);
     }
 
     @Override
     protected void onPause() {
         super.onPause();
+        clearBinderOverride();
+    }
+
+    private void clearBinderOverride() {
         if (mBinder != null) {
             mBinder.getTaskbarManager().setSetupUIVisible(false);
+            mBinder.setSwipeUpProxy(null);
         }
     }
 
@@ -106,6 +149,27 @@
     protected void onDestroy() {
         super.onDestroy();
         mTISBindHelper.onDestroy();
+        clearBinderOverride();
+    }
+
+    private AnimatedFloat createSwipeUpProxy(GestureState state) {
+        if (!state.getHomeIntent().getComponent().getPackageName().equals(getPackageName())) {
+            return null;
+        }
+        RunningTaskInfo rti = state.getRunningTask();
+        if (rti == null || !rti.topActivity.equals(getComponentName())) {
+            return null;
+        }
+        mSwipeProgress.updateValue(0);
+        return mSwipeProgress;
+    }
+
+    private void onSwipeProgressUpdate() {
+        mBackground.setProgress(mSwipeProgress.value);
+        float alpha = Utilities.mapBoundToRange(mSwipeProgress.value, 0, HINT_BOTTOM_FACTOR,
+                1, 0, LINEAR);
+        mContentView.setAlpha(alpha);
+        mContentView.setTranslationY((alpha - 1) * mSwipeUpShift);
     }
 
     /**
@@ -132,4 +196,79 @@
             return super.performAccessibilityAction(host, action, args);
         }
     }
+
+    private static class BgDrawable extends Drawable {
+
+        private static final float START_SIZE_FACTOR = .5f;
+        private static final float END_SIZE_FACTOR = 2;
+        private static final float GRADIENT_END_PROGRESS = .5f;
+
+        private final Paint mPaint = new Paint();
+        private final RadialGradient mMaskGrad;
+        private final Matrix mMatrix = new Matrix();
+
+        private final ColorMatrix mColorMatrix = new ColorMatrix();
+        private final ColorMatrixColorFilter mColorFilter =
+                new ColorMatrixColorFilter(mColorMatrix);
+
+        private final int mColor;
+        private float mProgress = 0;
+
+        BgDrawable(Context context) {
+            mColor = context.getColor(R.color.all_set_page_background);
+            mMaskGrad = new RadialGradient(0, 0, 1,
+                    new int[] {ColorUtils.setAlphaComponent(mColor, 0), mColor},
+                    new float[]{0, 1}, TileMode.CLAMP);
+
+            mPaint.setShader(mMaskGrad);
+            mPaint.setColorFilter(mColorFilter);
+        }
+
+        @Override
+        public void draw(Canvas canvas) {
+            if (mProgress <= 0) {
+                canvas.drawColor(mColor);
+                return;
+            }
+
+            // Update the progress to half the size only.
+            float progress = mapBoundToRange(mProgress,
+                    0, GRADIENT_END_PROGRESS, 0, 1, LINEAR);
+            Rect bounds = getBounds();
+            float x = bounds.exactCenterX();
+            float height = bounds.height();
+
+            float size = PointF.length(x, height);
+            float radius = size * mapRange(progress, START_SIZE_FACTOR, END_SIZE_FACTOR);
+            float y = mapRange(progress, height + radius , height / 2);
+            mMatrix.setTranslate(x, y);
+            mMatrix.postScale(radius, radius, x, y);
+            mMaskGrad.setLocalMatrix(mMatrix);
+
+            // Change the alpha-addition-component (index 19) so that every pixel is updated
+            // accordingly
+            mColorMatrix.getArray()[19] = mapBoundToRange(mProgress, 0, 1, 0, -255, LINEAR);
+            mColorFilter.setColorMatrix(mColorMatrix);
+
+            canvas.drawPaint(mPaint);
+        }
+
+        public void setProgress(float progress) {
+            if (mProgress != progress) {
+                mProgress = progress;
+                invalidateSelf();
+            }
+        }
+
+        @Override
+        public int getOpacity() {
+            return PixelFormat.TRANSLUCENT;
+        }
+
+        @Override
+        public void setAlpha(int i) { }
+
+        @Override
+        public void setColorFilter(ColorFilter colorFilter) { }
+    }
 }
diff --git a/quickstep/src/com/android/quickstep/interaction/AnimatedTaskbarView.java b/quickstep/src/com/android/quickstep/interaction/AnimatedTaskbarView.java
new file mode 100644
index 0000000..e8cc45b
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/interaction/AnimatedTaskbarView.java
@@ -0,0 +1,368 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.quickstep.interaction;
+
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.AnimatorSet;
+import android.animation.ObjectAnimator;
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.constraintlayout.widget.ConstraintLayout;
+
+import com.android.launcher3.R;
+
+import java.util.ArrayList;
+
+
+/**
+ * Helper View for the gesture tutorial mock taskbar view.
+ *
+ * This helper class allows animating this mock taskview to and from a mock hotseat and the bottom
+ * of the screen.
+ */
+public class AnimatedTaskbarView extends ConstraintLayout {
+
+    private View mBackground;
+    private View mIconContainer;
+    private View mIcon1;
+    private View mIcon2;
+    private View mIcon3;
+    private View mIcon4;
+    private View mIcon5;
+    private View mIcon6;
+
+    @Nullable private Animator mRunningAnimator;
+
+    public AnimatedTaskbarView(@NonNull Context context) {
+        super(context);
+    }
+
+    public AnimatedTaskbarView(@NonNull Context context,
+            @Nullable AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public AnimatedTaskbarView(@NonNull Context context, @Nullable AttributeSet attrs,
+            int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+    }
+
+    public AnimatedTaskbarView(@NonNull Context context, @Nullable AttributeSet attrs,
+            int defStyleAttr,
+            int defStyleRes) {
+        super(context, attrs, defStyleAttr, defStyleRes);
+    }
+
+    @Override
+    protected void onFinishInflate() {
+        super.onFinishInflate();
+
+        mBackground = findViewById(R.id.taskbar_background);
+        mIconContainer = findViewById(R.id.icon_container);
+        mIcon1 = findViewById(R.id.taskbar_icon_1);
+        mIcon2 = findViewById(R.id.taskbar_icon_2);
+        mIcon3 = findViewById(R.id.taskbar_icon_3);
+        mIcon4 = findViewById(R.id.taskbar_icon_4);
+        mIcon5 = findViewById(R.id.taskbar_icon_5);
+        mIcon6 = findViewById(R.id.taskbar_icon_6);
+    }
+
+    /**
+     * Animates this fake taskbar's disappearance into the given hotseat view.
+     */
+    public void animateDisappearanceToHotseat(ViewGroup hotseat) {
+        ArrayList<Animator> animators = new ArrayList<>();
+        int hotseatTop = hotseat.getTop();
+
+        animators.add(ObjectAnimator.ofFloat(
+                mBackground, View.TRANSLATION_Y, 0, mBackground.getHeight()));
+        animators.add(ObjectAnimator.ofFloat(mBackground, View.ALPHA, 1f, 0f));
+        animators.add(createIconDisappearanceToHotseatAnimator(
+                mIcon1, hotseat.findViewById(R.id.hotseat_icon_1), hotseatTop));
+        animators.add(createIconDisappearanceToHotseatAnimator(
+                mIcon2, hotseat.findViewById(R.id.hotseat_icon_2), hotseatTop));
+        animators.add(createIconDisappearanceToHotseatAnimator(
+                mIcon3, hotseat.findViewById(R.id.hotseat_icon_3), hotseatTop));
+        animators.add(createIconDisappearanceToHotseatAnimator(
+                mIcon4, hotseat.findViewById(R.id.hotseat_icon_4), hotseatTop));
+        animators.add(createIconDisappearanceToHotseatAnimator(
+                mIcon5, hotseat.findViewById(R.id.hotseat_icon_5), hotseatTop));
+        animators.add(createIconDisappearanceToHotseatAnimator(
+                mIcon6, hotseat.findViewById(R.id.hotseat_icon_6), hotseatTop));
+
+        AnimatorSet animatorSet = new AnimatorSet();
+
+        animatorSet.playTogether(animators);
+        animatorSet.addListener(new AnimatorListenerAdapter() {
+            @Override
+            public void onAnimationEnd(Animator animation) {
+                super.onAnimationEnd(animation);
+                setVisibility(INVISIBLE);
+            }
+
+            @Override
+            public void onAnimationStart(Animator animation) {
+                super.onAnimationStart(animation);
+                setVisibility(VISIBLE);
+            }
+        });
+
+        start(animatorSet);
+    }
+
+    /**
+     * Animates this fake taskbar's appearance from the given hotseat view.
+     */
+    public void animateAppearanceFromHotseat(ViewGroup hotseat) {
+        ArrayList<Animator> animators = new ArrayList<>();
+        int hotseatTop = hotseat.getTop();
+
+        animators.add(ObjectAnimator.ofFloat(
+                mBackground, View.TRANSLATION_Y, mBackground.getHeight(), 0));
+        animators.add(ObjectAnimator.ofFloat(mBackground, View.ALPHA, 0f, 1f));
+        animators.add(createIconAppearanceFromHotseatAnimator(
+                mIcon1, hotseat.findViewById(R.id.hotseat_icon_1), hotseatTop));
+        animators.add(createIconAppearanceFromHotseatAnimator(
+                mIcon2, hotseat.findViewById(R.id.hotseat_icon_2), hotseatTop));
+        animators.add(createIconAppearanceFromHotseatAnimator(
+                mIcon3, hotseat.findViewById(R.id.hotseat_icon_3), hotseatTop));
+        animators.add(createIconAppearanceFromHotseatAnimator(
+                mIcon4, hotseat.findViewById(R.id.hotseat_icon_4), hotseatTop));
+        animators.add(createIconAppearanceFromHotseatAnimator(
+                mIcon5, hotseat.findViewById(R.id.hotseat_icon_5), hotseatTop));
+        animators.add(createIconAppearanceFromHotseatAnimator(
+                mIcon6, hotseat.findViewById(R.id.hotseat_icon_6), hotseatTop));
+
+        AnimatorSet animatorSet = new AnimatorSet();
+
+        animatorSet.playTogether(animators);
+        animatorSet.addListener(new AnimatorListenerAdapter() {
+            @Override
+            public void onAnimationStart(Animator animation) {
+                super.onAnimationStart(animation);
+                setVisibility(VISIBLE);
+            }
+        });
+
+        start(animatorSet);
+    }
+
+    /**
+     * Animates this fake taskbar's disappearance to the bottom of the screen.
+     */
+    public void animateDisappearanceToBottom() {
+        ArrayList<Animator> animators = new ArrayList<>();
+
+        animators.add(ObjectAnimator.ofFloat(
+                mBackground, View.TRANSLATION_Y, 0, mBackground.getHeight()));
+        animators.add(ObjectAnimator.ofFloat(mBackground, View.ALPHA, 1f, 0f));
+        animators.add(ObjectAnimator.ofFloat(mIconContainer, View.SCALE_X, 1f, 0f));
+        animators.add(ObjectAnimator.ofFloat(mIconContainer, View.SCALE_Y, 1f, 0f));
+
+        initializeIconContainerPivot();
+
+        AnimatorSet animatorSet = new AnimatorSet();
+
+        animatorSet.playTogether(animators);
+        animatorSet.addListener(new AnimatorListenerAdapter() {
+            @Override
+            public void onAnimationEnd(Animator animation) {
+                super.onAnimationEnd(animation);
+                setVisibility(INVISIBLE);
+                resetIconContainerPivot();
+            }
+
+            @Override
+            public void onAnimationCancel(Animator animation) {
+                super.onAnimationCancel(animation);
+                resetIconContainerPivot();
+            }
+
+            @Override
+            public void onAnimationStart(Animator animation) {
+                super.onAnimationStart(animation);
+                setVisibility(VISIBLE);
+            }
+        });
+
+        start(animatorSet);
+    }
+
+    /**
+     * Animates this fake taskbar's appearance from the bottom of the screen.
+     */
+    public void animateAppearanceFromBottom() {
+        ArrayList<Animator> animators = new ArrayList<>();
+
+        animators.add(ObjectAnimator.ofFloat(
+                mBackground, View.TRANSLATION_Y, mBackground.getHeight(), 0));
+        animators.add(ObjectAnimator.ofFloat(mBackground, View.ALPHA, 0f, 1f));
+        animators.add(ObjectAnimator.ofFloat(mIconContainer, View.SCALE_X, 0f, 1f));
+        animators.add(ObjectAnimator.ofFloat(mIconContainer, View.SCALE_Y, 0f, 1f));
+
+        initializeIconContainerPivot();
+
+        AnimatorSet animatorSet = new AnimatorSet();
+
+        animatorSet.playTogether(animators);
+        animatorSet.addListener(new AnimatorListenerAdapter() {
+            @Override
+            public void onAnimationStart(Animator animation) {
+                super.onAnimationStart(animation);
+                setVisibility(VISIBLE);
+            }
+
+            @Override
+            public void onAnimationEnd(Animator animation) {
+                super.onAnimationEnd(animation);
+                resetIconContainerPivot();
+            }
+
+            @Override
+            public void onAnimationCancel(Animator animation) {
+                super.onAnimationCancel(animation);
+                resetIconContainerPivot();
+            }
+        });
+
+        start(animatorSet);
+    }
+
+    private void initializeIconContainerPivot() {
+        mIconContainer.setPivotX(getWidth() / 2f);
+        mIconContainer.setPivotY(getHeight() * 0.8f);
+    }
+
+    private void resetIconContainerPivot() {
+        mIconContainer.resetPivot();
+        mIconContainer.setScaleX(1f);
+        mIconContainer.setScaleY(1f);
+    }
+
+    private void start(Animator animator) {
+        if (mRunningAnimator != null) {
+            mRunningAnimator.cancel();
+        }
+
+        animator.addListener(new AnimatorListenerAdapter() {
+            @Override
+            public void onAnimationCancel(Animator animation) {
+                super.onAnimationCancel(animation);
+                mRunningAnimator = null;
+            }
+
+            @Override
+            public void onAnimationEnd(Animator animation) {
+                super.onAnimationEnd(animation);
+                mRunningAnimator = null;
+            }
+
+            @Override
+            public void onAnimationStart(Animator animation) {
+                super.onAnimationStart(animation);
+                mRunningAnimator = animator;
+            }
+        });
+
+        animator.start();
+    }
+
+    private Animator createIconDisappearanceToHotseatAnimator(
+            View taskbarIcon, View hotseatIcon, int hotseatTop) {
+        ArrayList<Animator> animators = new ArrayList<>();
+
+        animators.add(ObjectAnimator.ofFloat(
+                taskbarIcon,
+                View.TRANSLATION_Y,
+                0,
+                (hotseatTop + hotseatIcon.getTop()) - (getTop() + taskbarIcon.getTop())));
+        animators.add(ObjectAnimator.ofFloat(
+                taskbarIcon, View.TRANSLATION_X, 0, hotseatIcon.getLeft() - taskbarIcon.getLeft()));
+        animators.add(ObjectAnimator.ofFloat(
+                taskbarIcon,
+                View.SCALE_X,
+                1f,
+                (float) hotseatIcon.getWidth() / (float) taskbarIcon.getWidth()));
+        animators.add(ObjectAnimator.ofFloat(
+                taskbarIcon,
+                View.SCALE_Y,
+                1f,
+                (float) hotseatIcon.getHeight() / (float) taskbarIcon.getHeight()));
+        animators.add(ObjectAnimator.ofFloat(taskbarIcon, View.ALPHA, 1f, 0f));
+
+        AnimatorSet animatorSet = new AnimatorSet();
+
+        animatorSet.playTogether(animators);
+        animatorSet.addListener(new AnimatorListenerAdapter() {
+            @Override
+            public void onAnimationEnd(Animator animation) {
+                super.onAnimationEnd(animation);
+                taskbarIcon.setVisibility(INVISIBLE);
+            }
+
+            @Override
+            public void onAnimationStart(Animator animation) {
+                super.onAnimationStart(animation);
+                taskbarIcon.setVisibility(VISIBLE);
+            }
+        });
+
+        return animatorSet;
+    }
+
+    private Animator createIconAppearanceFromHotseatAnimator(
+            View taskbarIcon, View hotseatIcon, int hotseatTop) {
+        ArrayList<Animator> animators = new ArrayList<>();
+
+        animators.add(ObjectAnimator.ofFloat(
+                taskbarIcon,
+                View.TRANSLATION_Y,
+                (hotseatTop + hotseatIcon.getTop()) - (getTop() + taskbarIcon.getTop()),
+                0));
+        animators.add(ObjectAnimator.ofFloat(
+                taskbarIcon, View.TRANSLATION_X, hotseatIcon.getLeft() - taskbarIcon.getLeft(), 0));
+        animators.add(ObjectAnimator.ofFloat(
+                taskbarIcon,
+                View.SCALE_X,
+                (float) hotseatIcon.getWidth() / (float) taskbarIcon.getWidth(),
+                1f));
+        animators.add(ObjectAnimator.ofFloat(
+                taskbarIcon,
+                View.SCALE_Y,
+                (float) hotseatIcon.getHeight() / (float) taskbarIcon.getHeight(),
+                1f));
+        animators.add(ObjectAnimator.ofFloat(taskbarIcon, View.ALPHA, 0f, 1f));
+
+        AnimatorSet animatorSet = new AnimatorSet();
+
+        animatorSet.playTogether(animators);
+        animatorSet.addListener(new AnimatorListenerAdapter() {
+            @Override
+            public void onAnimationStart(Animator animation) {
+                super.onAnimationStart(animation);
+                taskbarIcon.setVisibility(VISIBLE);
+            }
+        });
+
+        return animatorSet;
+    }
+}
diff --git a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java
index a45f273..bbb22e6 100644
--- a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialController.java
@@ -95,8 +95,10 @@
                         showFeedback(R.string.home_gesture_feedback_swipe_too_far_from_edge);
                         break;
                     case OVERVIEW_GESTURE_COMPLETED:
-                        fadeOutFakeTaskView(true, true, () ->
-                                showFeedback(R.string.home_gesture_feedback_overview_detected));
+                        fadeOutFakeTaskView(true, true, () -> {
+                            showFeedback(R.string.home_gesture_feedback_overview_detected);
+                            showFakeTaskbar(/* animateFromHotseat= */ false);
+                        });
                         break;
                     case HOME_OR_OVERVIEW_NOT_STARTED_WRONG_SWIPE_DIRECTION:
                     case HOME_OR_OVERVIEW_CANCELLED:
diff --git a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialFragment.java b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialFragment.java
index dcae07d..423e66f 100644
--- a/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialFragment.java
+++ b/quickstep/src/com/android/quickstep/interaction/HomeGestureTutorialFragment.java
@@ -61,7 +61,7 @@
             @Override
             public void onAnimationEnd(Animator animation) {
                 super.onAnimationEnd(animation);
-                controller.resetFakeTaskView();
+                controller.resetFakeTaskView(true);
             }
         });
         ArrayList<Animator> animators = new ArrayList<>();
@@ -76,7 +76,7 @@
             @Override
             public void onAnimationCancel(Animator animation) {
                 super.onAnimationCancel(animation);
-                controller.resetFakeTaskView();
+                controller.resetFakeTaskView(true);
             }
         });
         finalAnimation.playSequentially(animators);
diff --git a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java
index 24ef1fa..0fea0d7 100644
--- a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java
@@ -93,8 +93,8 @@
                 switch (result) {
                     case HOME_GESTURE_COMPLETED: {
                         animateFakeTaskViewHome(finalVelocity, () -> {
-                            resetFakeTaskView();
                             showFeedback(R.string.overview_gesture_feedback_home_detected);
+                            resetFakeTaskView(true);
                         });
                         break;
                     }
@@ -146,6 +146,7 @@
 
         AnimatorSet animset = new AnimatorSet();
         animset.playTogether(animators);
+        hideFakeTaskbar(/* animateToHotseat= */ false);
         animset.start();
         mRunningWindowAnim = SwipeUpAnimationLogic.RunningWindowAnim.wrap(animset);
     }
diff --git a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialFragment.java b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialFragment.java
index 57a76ca..f63a945 100644
--- a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialFragment.java
+++ b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialFragment.java
@@ -72,7 +72,7 @@
             @Override
             public void onAnimationEnd(Animator animation) {
                 super.onAnimationEnd(animation);
-                controller.resetFakeTaskView();
+                controller.resetFakeTaskView(false);
             }
         });
         ArrayList<Animator> animators = new ArrayList<>();
@@ -88,7 +88,7 @@
             @Override
             public void onAnimationCancel(Animator animation) {
                 super.onAnimationCancel(animation);
-                controller.resetFakeTaskView();
+                controller.resetFakeTaskView(false);
             }
         });
         finalAnimation.playSequentially(animators);
diff --git a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
index a923519..68df208 100644
--- a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java
@@ -198,11 +198,12 @@
             }
         }
         AnimatorSet animset = anim.buildAnim();
+        hideFakeTaskbar(/* animateToHotseat= */ false);
         animset.start();
         mRunningWindowAnim = RunningWindowAnim.wrap(animset);
     }
 
-    void resetFakeTaskView() {
+    void resetFakeTaskView(boolean animateFromHome) {
         mFakeTaskView.setVisibility(View.VISIBLE);
         PendingAnimation anim = new PendingAnimation(300);
         anim.setFloat(mTaskViewSwipeUpAnimation
@@ -210,12 +211,14 @@
         anim.setViewAlpha(mFakeTaskView, 1, ACCEL);
         anim.addListener(mResetTaskView);
         AnimatorSet animset = anim.buildAnim();
+        showFakeTaskbar(animateFromHome);
         animset.start();
         mRunningWindowAnim = RunningWindowAnim.wrap(animset);
     }
 
     void animateFakeTaskViewHome(PointF finalVelocity, @Nullable Runnable onEndRunnable) {
         cancelRunningAnimation();
+        hideFakeTaskbar(/* animateToHotseat= */ true);
         mFakePreviousTaskView.setVisibility(View.INVISIBLE);
         mFakeHotseatView.setVisibility(View.VISIBLE);
         mShowPreviousTasks = false;
diff --git a/quickstep/src/com/android/quickstep/interaction/TutorialController.java b/quickstep/src/com/android/quickstep/interaction/TutorialController.java
index 9c1ff4d..a59b0d7 100644
--- a/quickstep/src/com/android/quickstep/interaction/TutorialController.java
+++ b/quickstep/src/com/android/quickstep/interaction/TutorialController.java
@@ -89,6 +89,7 @@
     @Nullable View mHotseatIconView;
     final ClipIconView mFakeIconView;
     final FrameLayout mFakeTaskView;
+    final AnimatedTaskbarView mFakeTaskbarView;
     final AnimatedTaskView mFakePreviousTaskView;
     final View mRippleView;
     final RippleDrawable mRippleDrawable;
@@ -104,6 +105,7 @@
     private final Runnable mTitleViewCallback;
     @Nullable private Runnable mFeedbackViewCallback;
     @Nullable private Runnable mFakeTaskViewCallback;
+    @Nullable private Runnable mFakeTaskbarViewCallback;
     private final Runnable mShowFeedbackRunnable;
 
     TutorialController(TutorialFragment tutorialFragment, TutorialType tutorialType) {
@@ -122,6 +124,7 @@
         mFakeHotseatView = rootView.findViewById(R.id.gesture_tutorial_fake_hotseat_view);
         mFakeIconView = rootView.findViewById(R.id.gesture_tutorial_fake_icon_view);
         mFakeTaskView = rootView.findViewById(R.id.gesture_tutorial_fake_task_view);
+        mFakeTaskbarView = rootView.findViewById(R.id.gesture_tutorial_fake_taskbar_view);
         mFakePreviousTaskView =
                 rootView.findViewById(R.id.gesture_tutorial_fake_previous_task_view);
         mRippleView = rootView.findViewById(R.id.gesture_tutorial_ripple_view);
@@ -319,6 +322,10 @@
             mFakeTaskView.removeCallbacks(mFakeTaskViewCallback);
             mFakeTaskViewCallback = null;
         }
+        if (mFakeTaskbarViewCallback != null) {
+            mFakeTaskbarView.removeCallbacks(mFakeTaskbarViewCallback);
+            mFakeTaskbarViewCallback = null;
+        }
         mFeedbackTitleView.removeCallbacks(mTitleViewCallback);
     }
 
@@ -429,6 +436,38 @@
         mActionButton.setOnClickListener(this::onActionButtonClicked);
     }
 
+    void hideFakeTaskbar(boolean animateToHotseat) {
+        if (!mTutorialFragment.isLargeScreen()) {
+            return;
+        }
+        if (mFakeTaskbarViewCallback != null) {
+            mFakeTaskbarView.removeCallbacks(mFakeTaskbarViewCallback);
+        }
+        if (animateToHotseat) {
+            mFakeTaskbarViewCallback = () ->
+                    mFakeTaskbarView.animateDisappearanceToHotseat(mFakeHotseatView);
+        } else {
+            mFakeTaskbarViewCallback = mFakeTaskbarView::animateDisappearanceToBottom;
+        }
+        mFakeTaskbarView.post(mFakeTaskbarViewCallback);
+    }
+
+    void showFakeTaskbar(boolean animateFromHotseat) {
+        if (!mTutorialFragment.isLargeScreen()) {
+            return;
+        }
+        if (mFakeTaskbarViewCallback != null) {
+            mFakeTaskbarView.removeCallbacks(mFakeTaskbarViewCallback);
+        }
+        if (animateFromHotseat) {
+            mFakeTaskbarViewCallback = () ->
+                    mFakeTaskbarView.animateAppearanceFromHotseat(mFakeHotseatView);
+        } else {
+            mFakeTaskbarViewCallback = mFakeTaskbarView::animateAppearanceFromBottom;
+        }
+        mFakeTaskbarView.post(mFakeTaskbarViewCallback);
+    }
+
     void updateFakeAppTaskViewLayout(@LayoutRes int mockAppTaskLayoutResId) {
         updateFakeViewLayout(mFakeTaskView, mockAppTaskLayoutResId);
     }
@@ -480,6 +519,8 @@
                     mTutorialFragment.isLargeScreen()
                             ? R.dimen.gesture_tutorial_foldable_feedback_margin_start_end
                             : R.dimen.gesture_tutorial_feedback_margin_start_end));
+
+            mFakeTaskbarView.setVisibility(mTutorialFragment.isLargeScreen() ? View.VISIBLE : GONE);
         }
     }
 
diff --git a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
index 5ca5c94..715d30e 100644
--- a/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/LauncherRecentsView.java
@@ -90,6 +90,10 @@
 
     @Override
     public void onStateTransitionStart(LauncherState toState) {
+        if (toState == NORMAL || toState == SPRING_LOADED) {
+            // Clean-up logic that occurs when recents is no longer in use/visible.
+            reset();
+        }
         setOverviewStateEnabled(toState.overviewUi);
         setOverviewGridEnabled(toState.displayOverviewTasksAsGrid(mActivity.getDeviceProfile()));
         setOverviewFullscreenEnabled(toState.getOverviewFullscreenProgress() == 1);
@@ -98,10 +102,6 @@
 
     @Override
     public void onStateTransitionComplete(LauncherState finalState) {
-        if (finalState == NORMAL || finalState == SPRING_LOADED) {
-            // Clean-up logic that occurs when recents is no longer in use/visible.
-            reset();
-        }
         setOverlayEnabled(finalState == OVERVIEW || finalState == OVERVIEW_MODAL_TASK);
         setFreezeViewVisibility(false);
     }
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 5cad31d..687a13a 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -47,6 +47,8 @@
 import static com.android.launcher3.touch.PagedOrientationHandler.CANVAS_TRANSLATE;
 import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
 import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
+import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
+import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;
 import static com.android.launcher3.util.SystemUiController.UI_STATE_FULLSCREEN_TASK;
 import static com.android.quickstep.TaskUtils.checkCurrentOrManagedUserId;
 import static com.android.quickstep.views.ClearAllButton.DISMISS_ALPHA;
@@ -1014,11 +1016,6 @@
         }
     }
 
-    private boolean isLastGridTaskVisible() {
-        TaskView lastTaskView = getLastGridTaskView();
-        return lastTaskView != null && lastTaskView.isVisibleToUser();
-    }
-
     private TaskView getLastGridTaskView() {
         IntArray topRowIdArray = getTopRowIdArray();
         IntArray bottomRowIdArray = getBottomRowIdArray();
@@ -1900,6 +1897,7 @@
 
     public void reset() {
         setCurrentTask(-1);
+        mCurrentPageScrollDiff = 0;
         mIgnoreResetTaskId = -1;
         mTaskListChangeId = -1;
         mFocusedTaskViewId = -1;
@@ -2758,7 +2756,13 @@
         float dismissTranslationInterpolationEnd = 1;
         boolean closeGapBetweenClearAll = false;
         boolean isClearAllHidden = isClearAllHidden();
-        if (showAsGrid && isLastGridTaskVisible()) {
+        boolean snapToLastTask = false;
+        boolean isLandscapeSplit =
+                mActivity.getDeviceProfile().isLandscape && isSplitSelectionActive();
+        boolean isSplitPlaceholderFirstInGrid = isSplitPlaceholderFirstInGrid();
+        boolean isSplitPlaceholderLastInGrid = isSplitPlaceholderLastInGrid();
+        TaskView lastGridTaskView = showAsGrid ? getLastGridTaskView() : null;
+        if (lastGridTaskView != null && lastGridTaskView.isVisibleToUser()) {
             // After dismissal, animate translation of the remaining tasks to fill any gap left
             // between the end of the grid and the clear all button. Only animate if the clear
             // all button is visible or would become visible after dismissal.
@@ -2784,13 +2788,29 @@
                     longGridRowWidthDiff += mIsRtl ? -gapWidth : gapWidth;
                     if (isClearAllHidden) {
                         // If ClearAllButton isn't fully shown, snap to the last task.
-                        longGridRowWidthDiff += getSnapToLastTaskScrollDiff();
+                        snapToLastTask = true;
                     }
                 } else {
                     // If only focused task will be left, snap to focused task instead.
                     longGridRowWidthDiff += getSnapToFocusedTaskScrollDiff(isClearAllHidden);
                 }
             }
+            if (mClearAllButton.getAlpha() != 0f && isLandscapeSplit) {
+                // ClearAllButton will not be available in split select, snap to last task instead.
+                snapToLastTask = true;
+            }
+            if (snapToLastTask) {
+                longGridRowWidthDiff += getSnapToLastTaskScrollDiff();
+                if (isSplitPlaceholderLastInGrid) {
+                    // Shift all the tasks to make space for split placeholder.
+                    longGridRowWidthDiff += mIsRtl ? mSplitPlaceholderSize : -mSplitPlaceholderSize;
+                }
+            } else if (isLandscapeSplit && getScrollForPage(mCurrentPage)
+                    == getScrollForPage(indexOfChild(lastGridTaskView))) {
+                // Use last task as reference point for scroll diff and snapping calculation as it's
+                // the only invariant point in landscape split screen.
+                snapToLastTask = true;
+            }
 
             // If we need to animate the grid to compensate the clear all gap, we split the second
             // half of the dismiss pending animation (in which the non-dismissed tasks slide into
@@ -2947,6 +2967,20 @@
                 } else {
                     float primaryTranslation =
                             nextFocusedTaskView != null ? nextFocusedTaskWidth : dismissedTaskWidth;
+                    if (isFocusedTaskDismissed && nextFocusedTaskView == null) {
+                        // Moves less if focused task is not in scroll position.
+                        int focusedTaskScroll = getScrollForPage(dismissedIndex);
+                        int primaryScroll = mOrientationHandler.getPrimaryScroll(this);
+                        int focusedTaskScrollDiff = primaryScroll - focusedTaskScroll;
+                        primaryTranslation +=
+                                mIsRtl ? focusedTaskScrollDiff : -focusedTaskScrollDiff;
+                        if (isSplitPlaceholderFirstInGrid) {
+                            // Moves less if split placeholder is at the start.
+                            primaryTranslation +=
+                                    mIsRtl ? -mSplitPlaceholderSize : mSplitPlaceholderSize;
+                        }
+                    }
+
                     anim.setFloat(taskView, taskView.getPrimaryDismissTranslationProperty(),
                             mIsRtl ? primaryTranslation : -primaryTranslation,
                             clampToProgress(LINEAR, animationStartProgress,
@@ -2967,6 +3001,8 @@
         mPendingAnimation = anim;
         final TaskView finalNextFocusedTaskView = nextFocusedTaskView;
         final boolean finalCloseGapBetweenClearAll = closeGapBetweenClearAll;
+        final boolean finalSnapToLastTask = snapToLastTask;
+        final boolean finalIsFocusedTaskDismissed = isFocusedTaskDismissed;
         mPendingAnimation.addEndListener(new Consumer<Boolean>() {
             @Override
             public void accept(Boolean success) {
@@ -3006,14 +3042,11 @@
                     int taskViewIdToSnapTo = -1;
                     if (showAsGrid) {
                         if (finalCloseGapBetweenClearAll) {
-                            if (taskCount > 2) {
+                            if (finalSnapToLastTask) {
+                                // Last task will be determined after removing dismissed task.
+                                pageToSnapTo = -1;
+                            } else if (taskCount > 2) {
                                 pageToSnapTo = indexOfChild(mClearAllButton);
-                                if (isClearAllHidden) {
-                                    int clearAllWidth = mOrientationHandler.getPrimarySize(
-                                            mClearAllButton);
-                                    mCurrentPageScrollDiff =
-                                            isRtl() ? clearAllWidth : -clearAllWidth;
-                                }
                             } else if (isClearAllHidden) {
                                 // Snap to focused task if clear all is hidden.
                                 pageToSnapTo = 0;
@@ -3023,13 +3056,19 @@
                             // page's relative position as the order of indices change over time due
                             // to dismissals.
                             TaskView snappedTaskView = getTaskViewAt(mCurrentPage);
-                            if (snappedTaskView != null) {
+                            boolean calculateScrollDiff = true;
+                            if (snappedTaskView != null && !finalSnapToLastTask) {
                                 if (snappedTaskView.getTaskViewId() == mFocusedTaskViewId) {
                                     if (finalNextFocusedTaskView != null) {
                                         taskViewIdToSnapTo =
                                                 finalNextFocusedTaskView.getTaskViewId();
-                                    } else {
+                                    } else if (dismissedTaskViewId != mFocusedTaskViewId) {
                                         taskViewIdToSnapTo = mFocusedTaskViewId;
+                                    } else {
+                                        // Won't focus next task in split select, so snap to the
+                                        // first task.
+                                        pageToSnapTo = 0;
+                                        calculateScrollDiff = false;
                                     }
                                 } else {
                                     int snappedTaskViewId = snappedTaskView.getTaskViewId();
@@ -3061,10 +3100,20 @@
                                 }
                             }
 
-                            int primaryScroll = mOrientationHandler.getPrimaryScroll(
-                                    RecentsView.this);
-                            int currentPageScroll = getScrollForPage(pageToSnapTo);
-                            mCurrentPageScrollDiff = primaryScroll - currentPageScroll;
+                            if (calculateScrollDiff) {
+                                int primaryScroll = mOrientationHandler.getPrimaryScroll(
+                                        RecentsView.this);
+                                int currentPageScroll = getScrollForPage(mCurrentPage);
+                                mCurrentPageScrollDiff = primaryScroll - currentPageScroll;
+                                // Compensate for coordinate shift by split placeholder.
+                                if (isSplitPlaceholderFirstInGrid && !finalSnapToLastTask) {
+                                    mCurrentPageScrollDiff +=
+                                            mIsRtl ? -mSplitPlaceholderSize : mSplitPlaceholderSize;
+                                } else if (isSplitPlaceholderLastInGrid && finalSnapToLastTask) {
+                                    mCurrentPageScrollDiff +=
+                                            mIsRtl ? mSplitPlaceholderSize : -mSplitPlaceholderSize;
+                                }
+                            }
                         }
                     } else if (dismissedIndex < pageToSnapTo || pageToSnapTo == taskCount - 1) {
                         pageToSnapTo--;
@@ -3077,10 +3126,14 @@
                         startHome();
                     } else {
                         // Update focus task and its size.
-                        if (finalNextFocusedTaskView != null) {
-                            mFocusedTaskViewId = finalNextFocusedTaskView.getTaskViewId();
-                            mTopRowIdSet.remove(mFocusedTaskViewId);
-                            finalNextFocusedTaskView.animateIconScaleAndDimIntoView();
+                        if (finalIsFocusedTaskDismissed) {
+                            if (finalNextFocusedTaskView != null) {
+                                mFocusedTaskViewId = finalNextFocusedTaskView.getTaskViewId();
+                                mTopRowIdSet.remove(mFocusedTaskViewId);
+                                finalNextFocusedTaskView.animateIconScaleAndDimIntoView();
+                            } else {
+                                mFocusedTaskViewId = -1;
+                            }
                         }
                         updateTaskSize(/*isTaskDismissal=*/ true);
                         updateChildTaskOrientations();
@@ -3093,7 +3146,7 @@
                             if (highestVisibleTaskIndex < Integer.MAX_VALUE) {
                                 TaskView taskView = getTaskViewAt(highestVisibleTaskIndex);
 
-                                boolean shouldRebalance = false;
+                                boolean shouldRebalance;
                                 int screenStart = mOrientationHandler.getPrimaryScroll(
                                         RecentsView.this);
                                 int taskStart = mOrientationHandler.getChildStart(taskView)
@@ -3124,9 +3177,12 @@
                                 }
                             }
 
-                            // If snapping to another page due to indices rearranging, find the new
-                            // index after dismissal & rearrange using the task view id.
-                            if (taskViewIdToSnapTo != -1) {
+                            if (finalSnapToLastTask) {
+                                // If snapping to last task, find the last task after dismissal.
+                                pageToSnapTo = indexOfChild(getLastGridTaskView());
+                            } else if (taskViewIdToSnapTo != -1) {
+                                // If snapping to another page due to indices rearranging, find
+                                // the new index after dismissal & rearrange using the task view id.
                                 pageToSnapTo = indexOfChild(
                                         getTaskViewFromTaskViewId(taskViewIdToSnapTo));
                             }
@@ -3245,43 +3301,11 @@
     }
 
     /**
-     * @return {@code true} if one of the task thumbnails would intersect/overlap with the
-     *         {@link #mFirstFloatingTaskView}
+     * Returns {@code true} if one of the task thumbnails would intersect/overlap with the
+     * {@link #mFirstFloatingTaskView}.
      */
-    public boolean shouldShiftThumbnailsForSplitSelect(@StagePosition int stagePosition) {
-        if (!mActivity.getDeviceProfile().isTablet) {
-            // Never enough space on phones
-            return true;
-        } else if (!mActivity.getDeviceProfile().isLandscape) {
-            return true;
-        }
-
-        Rect splitBounds = new Rect();
-        // This acts as a best approximation on where the splitplaceholder view would be,
-        // doesn't need to be exact necessarily. This also doesn't need to take translations
-        // into account since placeholder view is not translated
-        if (stagePosition == SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT) {
-            splitBounds.set(getWidth() - mSplitPlaceholderSize, 0, getWidth(), getHeight());
-        } else {
-            splitBounds.set(0, 0, mSplitPlaceholderSize, getHeight());
-        }
-        Rect taskBounds = new Rect();
-        int taskCount = getTaskViewCount();
-        for (int i = 0; i < taskCount; i++) {
-            TaskView taskView = getTaskViewAt(i);
-            if (taskView == mSplitHiddenTaskView
-                    && !(showAsGrid() && taskView == getFocusedTaskView())) {
-                // Case where the hidden task view would have overlapped w/ placeholder,
-                // but because it's going to hide we don't care
-                // TODO (b/187312247) edge case for thumbnails that are off screen but scroll on
-                continue;
-            }
-            taskView.getBoundsOnScreen(taskBounds);
-            if (Rect.intersects(taskBounds, splitBounds)) {
-                return true;
-            }
-        }
-        return false;
+    public boolean shouldShiftThumbnailsForSplitSelect() {
+        return !mActivity.getDeviceProfile().isTablet;
     }
 
     protected void onDismissAnimationEnds() {
@@ -3773,37 +3797,44 @@
      * Apply scroll offset to children of RecentsView when entering split select.
      */
     public void applySplitPrimaryScrollOffset() {
-        if (!mActivity.getDeviceProfile().isLandscape || !showAsGrid()) {
-            return;
-        }
-
-        @StagePosition int position = mSplitSelectStateController.getActiveSplitStagePosition();
-        boolean shouldShiftThumbnailsForSplitSelect = shouldShiftThumbnailsForSplitSelect(
-                position);
-        boolean expandLeft = false;
-        boolean expandRight = false;
-        if (mIsRtl) {
-            if (position == SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT
-                    && shouldShiftThumbnailsForSplitSelect) {
-                expandLeft = true;
-            } else if (position == SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT) {
-                if (shouldShiftThumbnailsForSplitSelect) {
-                    expandRight = true;
-                } else {
-                    expandLeft = true;
-                }
-            }
-        } // TODO(b/200537659): Handle system RTL.
-        if (expandRight) {
+        if (isSplitPlaceholderFirstInGrid()) {
             for (int i = 0; i < getTaskViewCount(); i++) {
                 getTaskViewAt(i).setSplitScrollOffsetPrimary(mSplitPlaceholderSize);
             }
-        } else if (expandLeft) {
+        } else if (isSplitPlaceholderLastInGrid()) {
             mClearAllButton.setSplitSelectScrollOffsetPrimary(-mSplitPlaceholderSize);
         }
     }
 
     /**
+     * Returns if split placeholder is at the beginning of RecentsView. Always returns {@code false}
+     * if RecentsView is in portrait or RecentsView isn't shown as grid.
+     */
+    private boolean isSplitPlaceholderFirstInGrid() {
+        if (!mActivity.getDeviceProfile().isLandscape || !showAsGrid()) {
+            return false;
+        }
+        @StagePosition int position = mSplitSelectStateController.getActiveSplitStagePosition();
+        return mIsRtl
+                ? position == STAGE_POSITION_BOTTOM_OR_RIGHT
+                : position == STAGE_POSITION_TOP_OR_LEFT;
+    }
+
+    /**
+     * Returns if split placeholder is at the end of RecentsView. Always returns {@code false} if
+     * RecentsView is in portrait or RecentsView isn't shown as grid.
+     */
+    private boolean isSplitPlaceholderLastInGrid() {
+        if (!mActivity.getDeviceProfile().isLandscape || !showAsGrid()) {
+            return false;
+        }
+        @StagePosition int position = mSplitSelectStateController.getActiveSplitStagePosition();
+        return mIsRtl
+                ? position == STAGE_POSITION_TOP_OR_LEFT
+                : position == STAGE_POSITION_BOTTOM_OR_RIGHT;
+    }
+
+    /**
      * Reset scroll offset on children of RecentsView when exiting split select.
      */
     public void resetSplitPrimaryScrollOffset() {
@@ -4439,36 +4470,34 @@
 
     @Override
     protected int computeMinScroll() {
-        if (getTaskViewCount() > 0) {
-            if (mIsRtl) {
-                // If we aren't showing the clear all button, use the rightmost task as the min
-                // scroll.
-                return getScrollForPage(mDisallowScrollToClearAll ? indexOfChild(
-                        getTaskViewAt(getTaskViewCount() - 1)) : indexOfChild(mClearAllButton));
-            } else {
-                TaskView focusedTaskView = mShowAsGridLastOnLayout ? getFocusedTaskView() : null;
-                return getScrollForPage(focusedTaskView != null ? indexOfChild(focusedTaskView)
-                        : 0);
-            }
+        if (getTaskViewCount() <= 0) {
+            return super.computeMinScroll();
         }
-        return super.computeMinScroll();
+
+        return getScrollForPage(mIsRtl ? getLastViewIndex() : getFirstViewIndex());
     }
 
     @Override
     protected int computeMaxScroll() {
-        if (getTaskViewCount() > 0) {
-            if (mIsRtl) {
-                TaskView focusedTaskView = mShowAsGridLastOnLayout ? getFocusedTaskView() : null;
-                return getScrollForPage(focusedTaskView != null ? indexOfChild(focusedTaskView)
-                        : 0);
-            } else {
-                // If we aren't showing the clear all button, use the leftmost task as the min
-                // scroll.
-                return getScrollForPage(mDisallowScrollToClearAll ? indexOfChild(
-                        getTaskViewAt(getTaskViewCount() - 1)) : indexOfChild(mClearAllButton));
-            }
+        if (getTaskViewCount() <= 0) {
+            return super.computeMaxScroll();
         }
-        return super.computeMaxScroll();
+
+        return getScrollForPage(mIsRtl ? getFirstViewIndex() : getLastViewIndex());
+    }
+
+    private int getFirstViewIndex() {
+        return mShowAsGridLastOnLayout && mFocusedTaskViewId != -1
+                ? indexOfChild(getFocusedTaskView())
+                : 0;
+    }
+
+    private int getLastViewIndex() {
+        return mDisallowScrollToClearAll
+                ? mShowAsGridLastOnLayout
+                    ? indexOfChild(getLastGridTaskView())
+                    : getTaskViewCount() - 1
+                : indexOfChild(mClearAllButton);
     }
 
     /**
diff --git a/quickstep/tests/src/com/android/quickstep/AbstractQuickStepTest.java b/quickstep/tests/src/com/android/quickstep/AbstractQuickStepTest.java
index ca47de3..189dff8 100644
--- a/quickstep/tests/src/com/android/quickstep/AbstractQuickStepTest.java
+++ b/quickstep/tests/src/com/android/quickstep/AbstractQuickStepTest.java
@@ -44,7 +44,7 @@
     protected void onLauncherActivityClose(Launcher launcher) {
         RecentsView recentsView = launcher.getOverviewPanel();
         if (recentsView != null) {
-            recentsView.finishRecentsAnimation(true, null);
+            recentsView.finishRecentsAnimation(false /* toRecents */, null);
         }
     }
 
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
index 710afe0..4895b10 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
@@ -43,7 +43,6 @@
 
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -289,7 +288,6 @@
 
     @Test
     @PortraitLandscape
-    @Ignore("b/203781041")
     public void testOverviewForTablet() throws Exception {
         if (!mLauncher.isTablet()) {
             return;
diff --git a/src/com/android/launcher3/ButtonDropTarget.java b/src/com/android/launcher3/ButtonDropTarget.java
index 477dcf8..38d5077 100644
--- a/src/com/android/launcher3/ButtonDropTarget.java
+++ b/src/com/android/launcher3/ButtonDropTarget.java
@@ -108,8 +108,8 @@
         // We do not set the drawable in the xml as that inflates two drawables corresponding to
         // drawableLeft and drawableStart.
         mDrawable = getContext().getDrawable(resId).mutate();
-        mDrawable.setBounds(0, 0, mDrawableSize, mDrawableSize);
         mDrawable.setTintList(getTextColors());
+        centerIcon();
         setCompoundDrawablesRelative(mDrawable, null, null, null);
     }
 
@@ -277,7 +277,7 @@
         }
 
         final int top = to.top + (getMeasuredHeight() - height) / 2;
-        final int bottom = top +  height;
+        final int bottom = top + height;
 
         to.set(left, top, right, bottom);
 
@@ -289,6 +289,12 @@
         return to;
     }
 
+    private void centerIcon() {
+        int x = mTextVisible ? 0
+                : (getWidth() - getPaddingLeft() - getPaddingRight()) / 2 - mDrawableSize / 2;
+        mDrawable.setBounds(x, 0, x + mDrawableSize, mDrawableSize);
+    }
+
     @Override
     public void onClick(View v) {
         mLauncher.getAccessibilityDelegate().handleAccessibleDrop(this, null, null);
@@ -299,12 +305,19 @@
         if (mTextVisible != isVisible || !TextUtils.equals(newText, getText())) {
             mTextVisible = isVisible;
             setText(newText);
+            centerIcon();
             setCompoundDrawablesRelative(mDrawable, null, null, null);
             int drawablePadding = mTextVisible ? mDrawablePadding : 0;
             setCompoundDrawablePadding(drawablePadding);
         }
     }
 
+    @Override
+    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
+        super.onSizeChanged(w, h, oldw, oldh);
+        centerIcon();
+    }
+
     public void setToolTipLocation(int location) {
         mToolTipLocation = location;
         hideTooltip();
diff --git a/src/com/android/launcher3/DropTargetBar.java b/src/com/android/launcher3/DropTargetBar.java
index eb42a65..9fb14f6 100644
--- a/src/com/android/launcher3/DropTargetBar.java
+++ b/src/com/android/launcher3/DropTargetBar.java
@@ -275,8 +275,12 @@
     @Override
     protected void onVisibilityChanged(@NonNull View changedView, int visibility) {
         super.onVisibilityChanged(changedView, visibility);
-        if (TestProtocol.sDebugTracing && visibility == VISIBLE) {
-            Log.d(TestProtocol.NO_DROP_TARGET, "9");
+        if (TestProtocol.sDebugTracing) {
+            if (visibility == VISIBLE) {
+                Log.d(TestProtocol.NO_DROP_TARGET, "9");
+            } else {
+                Log.d(TestProtocol.NO_DROP_TARGET, "Hiding drop target", new Exception());
+            }
         }
     }
 }
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 8095280..fc717c9 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -651,14 +651,6 @@
             if (isTwoPanelEnabled() && !(mDragSourceInternal.getParent() instanceof Hotseat)) {
                 int pagePairScreenId = getScreenPair(dragObject.dragInfo.screenId);
                 CellLayout pagePair = mWorkspaceScreens.get(pagePairScreenId);
-                if (pagePair == null) {
-                    // TODO: after http://b/198820019 is fixed, remove this
-                    throw new IllegalStateException("Page pair is null, "
-                            + "dragScreenId: " + dragObject.dragInfo.screenId
-                            + ", pagePairScreenId: " + pagePairScreenId
-                            + ", mScreenOrder: " + mScreenOrder.toConcatString()
-                    );
-                }
                 dragSourceChildCount += pagePair.getShortcutsAndWidgets().getChildCount();
             }
 
diff --git a/src/com/android/launcher3/model/LoaderCursor.java b/src/com/android/launcher3/model/LoaderCursor.java
index 8a5a9bf..47df538 100644
--- a/src/com/android/launcher3/model/LoaderCursor.java
+++ b/src/com/android/launcher3/model/LoaderCursor.java
@@ -190,6 +190,7 @@
         String resourceName = itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT
                 ? getString(iconResourceIndex) : null;
         byte[] iconBlob = itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT
+                || itemType == Favorites.ITEM_TYPE_DEEP_SHORTCUT
                 || restoreFlag != 0
                 ? getBlob(iconIndex) : null;
 
diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java
index 872adec..8b7ad46 100644
--- a/src/com/android/launcher3/views/FloatingIconView.java
+++ b/src/com/android/launcher3/views/FloatingIconView.java
@@ -70,6 +70,8 @@
 
     // Manages loading the icon on a worker thread
     private static @Nullable IconLoadResult sIconLoadResult;
+    private static long sFetchIconId = 0;
+    private static long sRecycledFetchIconId = sFetchIconId;
 
     public static final float SHAPE_PROGRESS_DURATION = 0.10f;
     private static final RectF sTmpRectF = new RectF();
@@ -519,8 +521,13 @@
         IconLoadResult result = new IconLoadResult(info,
                 btvIcon == null ? false : btvIcon.isThemed());
 
-        MODEL_EXECUTOR.getHandler().postAtFrontOfQueue(() ->
-                getIconResult(l, v, info, position, btvIcon, result));
+        final long fetchIconId = sFetchIconId++;
+        MODEL_EXECUTOR.getHandler().postAtFrontOfQueue(() -> {
+            if (fetchIconId < sRecycledFetchIconId) {
+                return;
+            }
+            getIconResult(l, v, info, position, btvIcon, result);
+        });
 
         sIconLoadResult = result;
         return result;
@@ -622,6 +629,7 @@
         mOnTargetChangeRunnable = null;
         mBadge = null;
         sTmpObjArray[0] = null;
+        sRecycledFetchIconId = sFetchIconId;
         mIconLoadResult = null;
         mClipIconView.recycle();
         mBtvDrawable.setBackground(null);
diff --git a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
index 0e3b501..d5479fb 100644
--- a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
+++ b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
@@ -54,18 +54,14 @@
     }
 
     private void flingForwardImpl() {
-        flingForwardImpl(0);
-    }
-
-    private void flingForwardImpl(int rightMargin) {
         try (LauncherInstrumentation.Closable c =
                      mLauncher.addContextLayer("want to fling forward in overview")) {
             LauncherInstrumentation.log("Overview.flingForward before fling");
             final UiObject2 overview = verifyActiveContainer();
             final int leftMargin =
                     mLauncher.getTargetInsets().left + mLauncher.getEdgeSensitivityWidth();
-            mLauncher.scroll(overview, Direction.LEFT, new Rect(leftMargin + 1, 0, rightMargin, 0),
-                    20, false);
+            mLauncher.scroll(overview, Direction.LEFT, new Rect(leftMargin + 1, 0, 0, 0), 20,
+                    false);
             try (LauncherInstrumentation.Closable c2 =
                          mLauncher.addContextLayer("flung forwards")) {
                 verifyActiveContainer();
@@ -131,7 +127,7 @@
 
             OverviewTask task = getCurrentTask();
             mLauncher.assertNotNull("current task is null", task);
-            flingForwardImpl(task.getTaskCenterX());
+            mLauncher.scrollLeftByDistance(verifyActiveContainer(), task.getVisibleWidth());
 
             try (LauncherInstrumentation.Closable c2 =
                          mLauncher.addContextLayer("scrolled task off screen")) {
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index 9ee0e25..7ffdf4c 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -1190,10 +1190,19 @@
         return getVisibleBounds(container).bottom - bottomGestureStartOnScreen;
     }
 
+    int getRightGestureMarginInContainer(UiObject2 container) {
+        final int rightGestureStartOnScreen = getRightGestureStartOnScreen();
+        return getVisibleBounds(container).right - rightGestureStartOnScreen;
+    }
+
     int getBottomGestureStartOnScreen() {
         return getRealDisplaySize().y - getBottomGestureSize();
     }
 
+    int getRightGestureStartOnScreen() {
+        return getRealDisplaySize().x - getWindowInsets().right;
+    }
+
     void clickLauncherObject(UiObject2 object) {
         waitForObjectEnabled(object, "clickLauncherObject");
         expectEvent(TestProtocol.SEQUENCE_MAIN, LauncherInstrumentation.EVENT_TOUCH_DOWN);
@@ -1235,6 +1244,21 @@
                 true);
     }
 
+    void scrollLeftByDistance(UiObject2 container, int distance) {
+        final Rect containerRect = getVisibleBounds(container);
+        final int rightGestureMarginInContainer = getRightGestureMarginInContainer(container);
+        scroll(
+                container,
+                Direction.LEFT,
+                new Rect(
+                        0,
+                        containerRect.width() - distance - rightGestureMarginInContainer,
+                        0,
+                        rightGestureMarginInContainer),
+                10,
+                true);
+    }
+
     void scroll(
             UiObject2 container, Direction direction, Rect margins, int steps, boolean slowDown) {
         final Rect rect = getVisibleBounds(container);
diff --git a/tests/tapl/com/android/launcher3/tapl/OverviewTask.java b/tests/tapl/com/android/launcher3/tapl/OverviewTask.java
index 15bddd7..a860e7d 100644
--- a/tests/tapl/com/android/launcher3/tapl/OverviewTask.java
+++ b/tests/tapl/com/android/launcher3/tapl/OverviewTask.java
@@ -53,6 +53,10 @@
         return mTask.getVisibleBounds().height();
     }
 
+    int getVisibleWidth() {
+        return mTask.getVisibleBounds().width();
+    }
+
     int getTaskCenterX() {
         return mTask.getVisibleCenter().x;
     }