Merge "Crossfading splashscreen if icon is themed" into sc-dev
diff --git a/go/quickstep/res/values-gu/strings.xml b/go/quickstep/res/values-gu/strings.xml
new file mode 100644
index 0000000..e9fbdc2
--- /dev/null
+++ b/go/quickstep/res/values-gu/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="app_share_drop_target_label" msgid="5804774105974539508">"ઍપ શેર કરો"</string>
+    <string name="action_listen" msgid="2370304050784689486">"સાંભળો"</string>
+    <string name="action_translate" msgid="8028378961867277746">"Translate"</string>
+    <string name="action_search" msgid="6269564710943755464">"Lens"</string>
+</resources>
diff --git a/quickstep/res/drawable/task_menu_bg.xml b/quickstep/res/drawable/task_menu_bg.xml
index a60defc..be1b387 100644
--- a/quickstep/res/drawable/task_menu_bg.xml
+++ b/quickstep/res/drawable/task_menu_bg.xml
@@ -16,5 +16,6 @@
 -->
 
 <shape xmlns:android="http://schemas.android.com/apk/res/android">
-    <solid android:color="?attr/popupColorPrimary" />
+    <solid android:color="@android:color/transparent"/>
+    <corners android:radius="@dimen/task_menu_corner_radius"/>
 </shape>
diff --git a/quickstep/res/layout/task_menu.xml b/quickstep/res/layout/task_menu.xml
index a219bca..96a94ba 100644
--- a/quickstep/res/layout/task_menu.xml
+++ b/quickstep/res/layout/task_menu.xml
@@ -20,18 +20,20 @@
     android:layout_height="wrap_content"
     android:animateLayoutChanges="true"
     android:background="@drawable/task_menu_bg"
-    android:paddingBottom="@dimen/task_card_menu_shadow_height"
     android:orientation="vertical"
     android:visibility="invisible">
 
     <TextView
         android:id="@+id/task_name"
+        android:background="?android:attr/textColorPrimary"
+        android:textColor="?android:attr/textColorPrimaryInverse"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:gravity="center_horizontal"
-        android:layout_marginTop="16dp"
-        android:layout_marginBottom="16dp"
-        android:textSize="12sp"/>
+        android:layout_height="match_parent"
+        android:gravity="center"
+        android:layout_marginBottom="2dp"
+        android:paddingTop="@dimen/task_card_menu_option_vertical_padding"
+        android:paddingBottom="@dimen/task_card_menu_option_vertical_padding"
+        android:textSize="24sp"/>
 
     <LinearLayout
         android:id="@+id/menu_option_layout"
@@ -39,6 +41,6 @@
         android:layout_height="wrap_content"
         android:orientation="horizontal"
         android:divider="@drawable/all_apps_divider"
-        android:showDividers="beginning" />
+        android:showDividers="middle" />
 
 </com.android.quickstep.views.TaskMenuView>
\ No newline at end of file
diff --git a/quickstep/res/layout/task_view_menu_option.xml b/quickstep/res/layout/task_view_menu_option.xml
index a7d6e89..59c7263 100644
--- a/quickstep/res/layout/task_view_menu_option.xml
+++ b/quickstep/res/layout/task_view_menu_option.xml
@@ -21,7 +21,7 @@
     android:orientation="vertical"
     android:paddingTop="@dimen/task_card_menu_option_vertical_padding"
     android:paddingBottom="@dimen/task_card_menu_option_vertical_padding"
-    android:background="?android:attr/selectableItemBackground"
+    android:background="?android:attr/textColorPrimary"
     android:theme="@style/PopupItem" >
 
     <View
@@ -30,7 +30,7 @@
       android:layout_height="@dimen/system_shortcut_icon_size"
       android:layout_marginStart="@dimen/task_menu_option_start_margin"
       android:layout_gravity="center_horizontal"
-      android:backgroundTint="?android:attr/textColorTertiary"/>
+      android:backgroundTint="?android:attr/textColorPrimaryInverse"/>
 
     <TextView
         style="@style/BaseIcon"
@@ -38,9 +38,8 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginStart="@dimen/task_menu_option_start_margin"
-        android:textSize="12sp"
-        android:textColor="?android:attr/textColorPrimary"
-        android:fontFamily="sans-serif"
+        android:textSize="14sp"
+        android:textColor="?android:attr/textColorPrimaryInverse"
         android:focusable="false" />
 
 </LinearLayout>
diff --git a/quickstep/res/values-gu/strings.xml b/quickstep/res/values-gu/strings.xml
index a02e5eb..9ddde2b 100644
--- a/quickstep/res/values-gu/strings.xml
+++ b/quickstep/res/values-gu/strings.xml
@@ -77,14 +77,10 @@
     <string name="gesture_tutorial_try_again" msgid="65962545858556697">"ફરી પ્રયાસ કરો"</string>
     <string name="gesture_tutorial_nice" msgid="2936275692616928280">"સરસ!"</string>
     <string name="gesture_tutorial_step" msgid="1279786122817620968">"ટ્યૂટૉરિઅલ <xliff:g id="CURRENT">%1$d</xliff:g>/<xliff:g id="TOTAL">%2$d</xliff:g>"</string>
-    <!-- no translation found for allset_title (5021126669778966707) -->
-    <skip />
-    <!-- no translation found for allset_hint (459504134589971527) -->
-    <skip />
-    <!-- no translation found for allset_description (6350320429953234580) -->
-    <skip />
-    <!-- no translation found for allset_navigation_settings (417773244979225071) -->
-    <skip />
+    <string name="allset_title" msgid="5021126669778966707">"બધું સેટ થઈ ગયું!"</string>
+    <string name="allset_hint" msgid="459504134589971527">"હોમ પર જવા માટે ઉપરની તરફ સ્વાઇપ કરો"</string>
+    <string name="allset_description" msgid="6350320429953234580">"તમે તમારા ફોનનો ઉપયોગ કરવા માટે તૈયાર છો"</string>
+    <string name="allset_navigation_settings" msgid="417773244979225071"><annotation id="link">"ઍક્સેસિબિલિટી માટે નૅવિગેશન સેટિંગ"</annotation></string>
     <string name="action_share" msgid="2648470652637092375">"શેર કરો"</string>
     <string name="action_screenshot" msgid="8171125848358142917">"સ્ક્રીનશૉટ"</string>
     <string name="blocked_by_policy" msgid="2071401072261365546">"ઍપ કે તમારી સંસ્થા દ્વારા આ ક્રિયા કરવાની મંજૂરી નથી"</string>
diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml
index 50453ac..ffd83b1 100644
--- a/quickstep/res/values/dimens.xml
+++ b/quickstep/res/values/dimens.xml
@@ -22,15 +22,17 @@
     <!-- For Launchers that want to override the default dialog corner radius -->
     <dimen name="task_corner_radius_override">-1dp</dimen>
 
+    <!--  Task Menu View  -->
+    <dimen name="task_menu_corner_radius">22dp</dimen>
     <dimen name="overview_proactive_row_height">48dp</dimen>
     <dimen name="overview_proactive_row_bottom_margin">16dp</dimen>
 
-    <dimen name="overview_minimum_next_prev_size">48dp</dimen>
+    <dimen name="overview_minimum_next_prev_size">50dp</dimen>
     <dimen name="overview_task_margin">16dp</dimen>
 
     <!-- Overrideable in overlay that provides the Overview Actions. -->
     <dimen name="overview_actions_height">48dp</dimen>
-    <dimen name="overview_actions_bottom_margin_gesture">12dp</dimen>
+    <dimen name="overview_actions_bottom_margin_gesture">28dp</dimen>
     <dimen name="overview_actions_bottom_margin_three_button">8dp</dimen>
     <dimen name="overview_actions_horizontal_margin">16dp</dimen>
 
@@ -73,6 +75,7 @@
     <!-- Total space (start + end) between the task card and the edge of the screen
          in various configurations -->
     <dimen name="task_card_menu_option_vertical_padding">8dp</dimen>
+    <dimen name="task_card_margin">8dp</dimen>
     <dimen name="task_card_menu_shadow_height">3dp</dimen>
     <dimen name="task_menu_option_start_margin">12dp</dimen>
     <!-- Copied from framework resource:
diff --git a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
index 0b41f15..4720f55 100644
--- a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
+++ b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
@@ -253,6 +253,7 @@
                 new SplitSelectStateController(mHandler, SystemUiProxy.INSTANCE.get(this))
         );
         overviewPanel.init(mActionsView, mSplitPlaceholderView);
+        mActionsView.setDp(getDeviceProfile());
         mActionsView.updateVerticalMargin(SysUINavigationMode.getMode(this));
 
         mAppTransitionManager = new QuickstepTransitionManager(this);
diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java
index 86bf119..2696cbe 100644
--- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java
+++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java
@@ -59,6 +59,7 @@
 import com.android.quickstep.util.ActivityInitListener;
 import com.android.quickstep.util.AnimatorControllerWithResistance;
 import com.android.quickstep.util.SplitScreenBounds;
+import com.android.quickstep.views.OverviewActionsView;
 import com.android.quickstep.views.RecentsView;
 import com.android.quickstep.views.TaskView;
 import com.android.systemui.shared.recents.model.ThumbnailData;
@@ -212,7 +213,7 @@
         } else {
             int taskMargin = dp.overviewTaskMarginPx;
             int proactiveRowAndMargin;
-            if (dp.isVerticalBarLayout()) {
+            if (!TaskView.SHOW_PROACTIVE_ACTIONS || dp.isVerticalBarLayout()) {
                 // In Vertical Bar Layout the proactive row doesn't have its own space, it's inside
                 // the actions row.
                 proactiveRowAndMargin = 0;
@@ -223,7 +224,7 @@
             }
             calculateTaskSizeInternal(context, dp,
                     dp.overviewTaskThumbnailTopMarginPx,
-                    proactiveRowAndMargin + getOverviewActionsHeight(context) + taskMargin,
+                    proactiveRowAndMargin + getOverviewActionsHeight(context, dp),
                     res.getDimensionPixelSize(R.dimen.overview_minimum_next_prev_size) + taskMargin,
                     outRect);
         }
@@ -314,23 +315,16 @@
         calculateTaskSizeInternal(
                 context, dp,
                 dp.overviewTaskMarginPx,
-                getOverviewActionsHeight(context) + dp.overviewTaskMarginPx,
+                getOverviewActionsHeight(context, dp),
                 dp.overviewTaskMarginPx,
                 outRect);
     }
 
     /** Gets the space that the overview actions will take, including bottom margin. */
-    public final int getOverviewActionsHeight(Context context) {
+    private int getOverviewActionsHeight(Context context, DeviceProfile dp) {
         Resources res = context.getResources();
-        int actionsBottomMargin = 0;
-        if (getMode(context) == Mode.THREE_BUTTONS) {
-            actionsBottomMargin = res.getDimensionPixelSize(
-                    R.dimen.overview_actions_bottom_margin_three_button);
-        } else {
-            actionsBottomMargin = res.getDimensionPixelSize(
-                    R.dimen.overview_actions_bottom_margin_gesture);
-        }
-        return actionsBottomMargin
+        return OverviewActionsView.getOverviewActionsBottomMarginPx(getMode(context), dp)
+                + OverviewActionsView.getOverviewActionsTopMarginPx(getMode(context), dp)
                 + res.getDimensionPixelSize(R.dimen.overview_actions_height);
     }
 
diff --git a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
index 9adeea4..8c115e5 100644
--- a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
+++ b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
@@ -93,6 +93,8 @@
     private float mModalness;
     private float mModalTransformY;
 
+    protected DeviceProfile mDp;
+
     public OverviewActionsView(Context context) {
         this(context, null);
     }
@@ -205,36 +207,25 @@
 
     /** Updates vertical margins for different navigation mode or configuration changes. */
     public void updateVerticalMargin(Mode mode) {
+        if (mDp == null) {
+            return;
+        }
         LayoutParams actionParams = (LayoutParams) findViewById(
                 R.id.action_buttons).getLayoutParams();
         actionParams.setMargins(
-                actionParams.leftMargin, actionParams.topMargin, actionParams.rightMargin,
-                getBottomVerticalMargin(mode));
+                actionParams.leftMargin, getOverviewActionsTopMarginPx(mode, mDp),
+                actionParams.rightMargin, getOverviewActionsBottomMarginPx(mode, mDp));
     }
 
     /**
      * Set the device profile for this view to draw with.
      */
     public void setDp(DeviceProfile dp) {
+        mDp = dp;
+        updateVerticalMargin(SysUINavigationMode.getMode(getContext()));
         requestLayout();
     }
 
-    protected int getBottomVerticalMargin(Mode mode) {
-        int bottomMargin;
-        int orientation = getResources().getConfiguration().orientation;
-        if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
-            bottomMargin = 0;
-        } else if (mode == Mode.THREE_BUTTONS) {
-            bottomMargin = getResources()
-                    .getDimensionPixelSize(R.dimen.overview_actions_bottom_margin_three_button);
-        } else {
-            bottomMargin = getResources()
-                    .getDimensionPixelSize(R.dimen.overview_actions_bottom_margin_gesture);
-        }
-        bottomMargin += mInsets.bottom;
-        return bottomMargin;
-    }
-
     /**
      * The current task is fully modal (modalness = 1) when it is shown on its own in a modal
      * way. Modalness 0 means the task is shown in context with all the other tasks.
@@ -257,4 +248,35 @@
         float progress = ACCEL_DEACCEL.getInterpolation(mModalness);
         return Utilities.mapRange(progress, 0, endTranslation);
     }
+
+    /** Get the top margin associated with the action buttons in Overview. */
+    public static int getOverviewActionsTopMarginPx(
+            SysUINavigationMode.Mode mode, DeviceProfile dp) {
+        // In vertical bar, use the smaller task margin for the top regardless of mode
+        if (dp.isVerticalBarLayout()) {
+            return dp.overviewTaskMarginPx;
+        }
+
+        if (mode == SysUINavigationMode.Mode.THREE_BUTTONS) {
+            return dp.overviewActionsMarginThreeButtonPx;
+        }
+
+        return dp.overviewActionsMarginGesturePx;
+    }
+
+    /** Get the bottom margin associated with the action buttons in Overview. */
+    public static int getOverviewActionsBottomMarginPx(
+            SysUINavigationMode.Mode mode, DeviceProfile dp) {
+        int inset = dp.getInsets().bottom;
+
+        if (dp.isVerticalBarLayout()) {
+            return inset;
+        }
+
+        if (mode == SysUINavigationMode.Mode.THREE_BUTTONS) {
+            return dp.overviewActionsMarginThreeButtonPx + inset;
+        }
+
+        return dp.overviewActionsMarginGesturePx + inset;
+    }
 }
diff --git a/quickstep/src/com/android/quickstep/views/TaskMenuView.java b/quickstep/src/com/android/quickstep/views/TaskMenuView.java
index bff1013..d5816b5 100644
--- a/quickstep/src/com/android/quickstep/views/TaskMenuView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskMenuView.java
@@ -24,6 +24,7 @@
 import android.animation.ObjectAnimator;
 import android.content.Context;
 import android.graphics.Outline;
+import android.graphics.PointF;
 import android.graphics.Rect;
 import android.util.AttributeSet;
 import android.view.Gravity;
@@ -195,7 +196,7 @@
     private void addMenuOptions(TaskView taskView) {
         mTaskName.setText(TaskUtils.getTitle(getContext(), taskView.getTask()));
         mTaskName.setOnClickListener(v -> close(true));
-
+        
         TaskOverlayFactory.getEnabledShortcuts(taskView, mActivity.getDeviceProfile())
                 .forEach(this::addMenuOption);
     }
@@ -227,18 +228,24 @@
     private void orientAroundTaskView(TaskView taskView) {
         PagedOrientationHandler orientationHandler = taskView.getPagedOrientationHandler();
         measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
+        float taskInsetMargin = getResources().getDimension(R.dimen.task_card_margin);
+        orientationHandler.setTaskMenuAroundTaskView(this, taskInsetMargin);
         mActivity.getDragLayer().getDescendantRectRelativeToSelf(taskView, sTempRect);
         Rect insets = mActivity.getDragLayer().getInsets();
         BaseDragLayer.LayoutParams params = (BaseDragLayer.LayoutParams) getLayoutParams();
-        // TODO(b/186583656) Move the entire menu to the center/make smaller than thumbnail width
-        params.width = orientationHandler.getTaskMenuWidth(taskView.getThumbnail());
+        int padding = getResources()
+                .getDimensionPixelSize(R.dimen.task_card_menu_option_vertical_padding);
+        params.width = orientationHandler.getTaskMenuWidth(taskView.getThumbnail()) - (2 * padding);
         // Gravity set to Left instead of Start as sTempRect.left measures Left distance not Start
         params.gravity = Gravity.LEFT;
         setLayoutParams(params);
         setScaleX(taskView.getScaleX());
         setScaleY(taskView.getScaleY());
-        orientationHandler.setTaskMenuLayoutOrientation(
+        orientationHandler.setTaskOptionsMenuLayoutOrientation(
                 mActivity.getDeviceProfile(), mOptionLayout);
+        PointF additionalInset = orientationHandler.getAdditionalInsetForTaskMenu(taskInsetMargin);
+        insets.left += additionalInset.x;
+        insets.top += additionalInset.y;
         setPosition(sTempRect.left - insets.left, sTempRect.top - insets.top, 0);
     }
 
diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java
index cfac32c..b2a7b1b 100644
--- a/quickstep/src/com/android/quickstep/views/TaskView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskView.java
@@ -132,6 +132,12 @@
     @IntDef({FLAG_UPDATE_ALL, FLAG_UPDATE_ICON, FLAG_UPDATE_THUMBNAIL})
     public @interface TaskDataChanges {}
 
+    /**
+     * Should the layout account for space for a proactive action (or chip) to be added under
+     * the task.
+     */
+    public static final boolean SHOW_PROACTIVE_ACTIONS = false;
+
     /** The maximum amount that a task view can be scrimmed, dimmed or tinted. */
     public static final float MAX_PAGE_SCRIM_ALPHA = 0.4f;
 
diff --git a/res/drawable/all_apps_divider.xml b/res/drawable/all_apps_divider.xml
index 4bd274d..53d3522 100644
--- a/res/drawable/all_apps_divider.xml
+++ b/res/drawable/all_apps_divider.xml
@@ -15,6 +15,6 @@
 -->
 <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle">
-    <solid android:color="?android:attr/colorControlHighlight" />
-    <size android:height="1dp" />
+    <solid android:color="@android:color/transparent" />
+    <size android:height="2dp" />
 </shape>
\ No newline at end of file
diff --git a/res/layout/widgets_list_row_header.xml b/res/layout/widgets_list_row_header.xml
index 278d3dc..8ab086c 100644
--- a/res/layout/widgets_list_row_header.xml
+++ b/res/layout/widgets_list_row_header.xml
@@ -49,6 +49,8 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_gravity="start|center_vertical"
+            android:ellipsize="end"
+            android:maxLines="1"
             android:textColor="?android:attr/textColorPrimary"
             android:textSize="16sp"
             tools:text="App name" />
diff --git a/res/values-gu/strings.xml b/res/values-gu/strings.xml
index 55eceee..3a25705 100644
--- a/res/values-gu/strings.xml
+++ b/res/values-gu/strings.xml
@@ -97,8 +97,7 @@
     <string name="folder_name_format_exact" msgid="8626242716117004803">"ફોલ્ડર: <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="SIZE">%2$d</xliff:g> આઇટમ"</string>
     <string name="folder_name_format_overflow" msgid="4270108890534995199">"ફોલ્ડર: <xliff:g id="NAME">%1$s</xliff:g>, <xliff:g id="SIZE">%2$d</xliff:g> કે વધુ આઇટમ"</string>
     <string name="wallpaper_button_text" msgid="8404103075899945851">"વૉલપેપર"</string>
-    <!-- no translation found for styles_wallpaper_button_text (8216961355289236794) -->
-    <skip />
+    <string name="styles_wallpaper_button_text" msgid="8216961355289236794">"વૉલપેપર અને શૈલી"</string>
     <string name="settings_button_text" msgid="8873672322605444408">"હોમ સેટિંગ"</string>
     <string name="msg_disabled_by_admin" msgid="6898038085516271325">"તમારા વ્યવસ્થાપક દ્વારા અક્ષમ કરેલ"</string>
     <string name="allow_rotation_title" msgid="7728578836261442095">"હોમ સ્ક્રીનને ફેરવવાની મંજૂરી આપો"</string>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 2882b1f..394aecb 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -296,6 +296,8 @@
     <dimen name="task_thumbnail_icon_size">0dp</dimen>
     <dimen name="task_thumbnail_icon_size_grid">0dp</dimen>
     <dimen name="overview_task_margin">0dp</dimen>
+    <dimen name="overview_actions_bottom_margin_gesture">0dp</dimen>
+    <dimen name="overview_actions_bottom_margin_three_button">0dp</dimen>
 
 <!-- Workspace grid visualization parameters -->
     <dimen name="grid_visualization_rounding_radius">22dp</dimen>
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 8126673..cdc09f1 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -170,6 +170,8 @@
     public int overviewTaskMarginPx;
     public int overviewTaskIconSizePx;
     public int overviewTaskThumbnailTopMarginPx;
+    public final int overviewActionsMarginThreeButtonPx;
+    public final int overviewActionsMarginGesturePx;
 
     // Widgets
     public final PointF appWidgetScale = new PointF(1.0f, 1.0f);
@@ -338,6 +340,10 @@
                         R.dimen.task_thumbnail_icon_size_grid) : res.getDimensionPixelSize(
                         R.dimen.task_thumbnail_icon_size);
         overviewTaskThumbnailTopMarginPx = overviewTaskIconSizePx + overviewTaskMarginPx * 2;
+        overviewActionsMarginGesturePx = res.getDimensionPixelSize(
+                R.dimen.overview_actions_bottom_margin_gesture);
+        overviewActionsMarginThreeButtonPx = res.getDimensionPixelSize(
+                R.dimen.overview_actions_bottom_margin_three_button);
 
         // Calculate all of the remaining variables.
         extraSpace = updateAvailableDimensions(res);
diff --git a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
index 44e55e1..11c9649 100644
--- a/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
+++ b/src/com/android/launcher3/touch/LandscapePagedViewHandler.java
@@ -41,6 +41,7 @@
 import com.android.launcher3.R;
 import com.android.launcher3.Utilities;
 import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
+import com.android.launcher3.views.BaseDragLayer;
 
 import java.util.Collections;
 import java.util.List;
@@ -267,7 +268,7 @@
     }
 
     @Override
-    public void setTaskMenuLayoutOrientation(DeviceProfile deviceProfile,
+    public void setTaskOptionsMenuLayoutOrientation(DeviceProfile deviceProfile,
         LinearLayout taskMenuLayout) {
         taskMenuLayout.setOrientation(LinearLayout.HORIZONTAL);
     }
@@ -284,6 +285,17 @@
         Utilities.setStartMarginForView(viewGroup.findViewById(R.id.icon), 0);
     }
 
+    @Override
+    public void setTaskMenuAroundTaskView(LinearLayout taskView, float margin) {
+        BaseDragLayer.LayoutParams lp = (BaseDragLayer.LayoutParams) taskView.getLayoutParams();
+        lp.topMargin += margin;
+    }
+
+    @Override
+    public PointF getAdditionalInsetForTaskMenu(float margin) {
+        return new PointF(margin, 0);
+    }
+
     /* ---------- The following are only used by TaskViewTouchHandler. ---------- */
 
     @Override
diff --git a/src/com/android/launcher3/touch/PagedOrientationHandler.java b/src/com/android/launcher3/touch/PagedOrientationHandler.java
index 6811438..e0b89c7 100644
--- a/src/com/android/launcher3/touch/PagedOrientationHandler.java
+++ b/src/com/android/launcher3/touch/PagedOrientationHandler.java
@@ -109,16 +109,37 @@
     float getSecondaryValue(float x, float y);
 
     boolean isLayoutNaturalToLauncher();
+    FloatProperty getSplitSelectTaskOffset(FloatProperty primary, FloatProperty secondary,
+            DeviceProfile deviceProfile);
+    int getDistanceToBottomOfRect(DeviceProfile dp, Rect rect);
+    List<SplitPositionOption> getSplitPositionOptions(DeviceProfile dp);
+
+    // Overview TaskMenuView methods
     float getTaskMenuX(float x, View thumbnailView, int overScroll);
     float getTaskMenuY(float y, View thumbnailView, int overScroll);
     int getTaskMenuWidth(View view);
-    void setTaskMenuLayoutOrientation(DeviceProfile deviceProfile, LinearLayout taskMenuLayout);
+    /**
+     * Sets linear layout orientation for {@link com.android.launcher3.popup.SystemShortcut} items
+     * inside task menu view.
+     */
+    void setTaskOptionsMenuLayoutOrientation(DeviceProfile deviceProfile,
+            LinearLayout taskMenuLayout);
+    /**
+     * Sets layout param attributes for {@link com.android.launcher3.popup.SystemShortcut} child
+     * views inside task menu view.
+     */
     void setLayoutParamsForTaskMenuOptionItem(LinearLayout.LayoutParams lp,
             LinearLayout viewGroup, DeviceProfile deviceProfile);
-    int getDistanceToBottomOfRect(DeviceProfile dp, Rect rect);
-    List<SplitPositionOption> getSplitPositionOptions(DeviceProfile dp);
-    FloatProperty getSplitSelectTaskOffset(FloatProperty primary, FloatProperty secondary,
-            DeviceProfile deviceProfile);
+    /**
+     * Adjusts margins for the entire task menu view itself, which comprises of both app title and
+     * shortcut options.
+     */
+    void setTaskMenuAroundTaskView(LinearLayout taskView, float margin);
+    /**
+     * Since the task menu layout is manually positioned on top of recents view, this method returns
+     * additional adjustments to the positioning based on fake land/seascape
+     */
+    PointF getAdditionalInsetForTaskMenu(float margin);
 
     // The following are only used by TaskViewTouchHandler.
     /** @return Either VERTICAL or HORIZONTAL. */
diff --git a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
index d3d77fd..dcbb7ca 100644
--- a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
+++ b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java
@@ -39,6 +39,7 @@
 import com.android.launcher3.R;
 import com.android.launcher3.Utilities;
 import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
+import com.android.launcher3.views.BaseDragLayer;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -272,7 +273,7 @@
     }
 
     @Override
-    public void setTaskMenuLayoutOrientation(DeviceProfile deviceProfile,
+    public void setTaskOptionsMenuLayoutOrientation(DeviceProfile deviceProfile,
         LinearLayout taskMenuLayout) {
         if (deviceProfile.isLandscape && !deviceProfile.isTablet) {
             // Phone landscape
@@ -302,6 +303,18 @@
         lp.height = LinearLayout.LayoutParams.WRAP_CONTENT;
     }
 
+    @Override
+    public void setTaskMenuAroundTaskView(LinearLayout taskView, float margin) {
+        BaseDragLayer.LayoutParams lp = (BaseDragLayer.LayoutParams) taskView.getLayoutParams();
+        lp.topMargin += margin;
+        lp.leftMargin += margin;
+    }
+
+    @Override
+    public PointF getAdditionalInsetForTaskMenu(float margin) {
+        return new PointF(0, 0);
+    }
+
     /* ---------- The following are only used by TaskViewTouchHandler. ---------- */
 
     @Override
diff --git a/src/com/android/launcher3/touch/SeascapePagedViewHandler.java b/src/com/android/launcher3/touch/SeascapePagedViewHandler.java
index 893a274..91d44bd 100644
--- a/src/com/android/launcher3/touch/SeascapePagedViewHandler.java
+++ b/src/com/android/launcher3/touch/SeascapePagedViewHandler.java
@@ -26,11 +26,13 @@
 import android.graphics.Rect;
 import android.view.Surface;
 import android.view.View;
+import android.widget.LinearLayout;
 
 import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.R;
 import com.android.launcher3.Utilities;
 import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
+import com.android.launcher3.views.BaseDragLayer;
 
 import java.util.Collections;
 import java.util.List;
@@ -89,6 +91,17 @@
     }
 
     @Override
+    public void setTaskMenuAroundTaskView(LinearLayout taskView, float margin) {
+        BaseDragLayer.LayoutParams lp = (BaseDragLayer.LayoutParams) taskView.getLayoutParams();
+        lp.bottomMargin += margin;
+    }
+
+    @Override
+    public PointF getAdditionalInsetForTaskMenu(float margin) {
+        return new PointF(-margin, margin);
+    }
+
+    @Override
     public int getDistanceToBottomOfRect(DeviceProfile dp, Rect rect) {
         return dp.widthPx - rect.right;
     }
diff --git a/src/com/android/launcher3/widget/picker/WidgetsRecyclerView.java b/src/com/android/launcher3/widget/picker/WidgetsRecyclerView.java
index e981906..e30e245 100644
--- a/src/com/android/launcher3/widget/picker/WidgetsRecyclerView.java
+++ b/src/com/android/launcher3/widget/picker/WidgetsRecyclerView.java
@@ -49,10 +49,10 @@
     private final int mScrollbarTop;
 
     private final Point mFastScrollerOffset = new Point();
-    private final int mEstimatedWidgetListHeaderHeight;
     private boolean mTouchDownOnScroller;
     private HeaderViewDimensionsProvider mHeaderViewDimensionsProvider;
     private int mLastVisibleWidgetContentTableHeight = 0;
+    private int mWidgetHeaderHeight = 0;
     @Nullable private OnContentChangeListener mOnContentChangeListener;
 
     public WidgetsRecyclerView(Context context) {
@@ -71,9 +71,6 @@
 
         ActivityContext activity = ActivityContext.lookupContext(getContext());
         DeviceProfile grid = activity.getDeviceProfile();
-        mEstimatedWidgetListHeaderHeight = grid.iconSizePx
-                + 2 * context.getResources().getDimensionPixelSize(
-                        R.dimen.widget_list_header_view_vertical_padding);
     }
 
     @Override
@@ -164,6 +161,14 @@
             if (view instanceof TableLayout) {
                 // This assumes there is ever only one content shown in this recycler view.
                 mLastVisibleWidgetContentTableHeight = view.getMeasuredHeight();
+            } else if (view instanceof WidgetsListHeader
+                    && mLastVisibleWidgetContentTableHeight == 0
+                    && view.getMeasuredHeight() > 0) {
+                // This assumes all header views are of the same height.
+                RecyclerView.LayoutParams layoutParams =
+                        (RecyclerView.LayoutParams) view.getLayoutParams();
+                mWidgetHeaderHeight = view.getMeasuredHeight() + layoutParams.topMargin
+                    + layoutParams.bottomMargin;
             }
         }
 
@@ -262,7 +267,7 @@
             WidgetsListBaseEntry entry = mAdapter.getItems().get(i);
             if (entry instanceof WidgetsListHeaderEntry
                     || entry instanceof WidgetsListSearchHeaderEntry) {
-                totalItemsHeight += mEstimatedWidgetListHeaderHeight;
+                totalItemsHeight += mWidgetHeaderHeight;
             } else if (entry instanceof WidgetsListContentEntry) {
                 totalItemsHeight += mLastVisibleWidgetContentTableHeight;
             } else {
diff --git a/src/com/android/launcher3/workprofile/PersonalWorkSlidingTabStrip.java b/src/com/android/launcher3/workprofile/PersonalWorkSlidingTabStrip.java
index c7cbde8..8f9cdc8 100644
--- a/src/com/android/launcher3/workprofile/PersonalWorkSlidingTabStrip.java
+++ b/src/com/android/launcher3/workprofile/PersonalWorkSlidingTabStrip.java
@@ -127,7 +127,6 @@
     public void setActiveMarker(int activePage) {
         updateTabTextColor(activePage);
         if (mOnActivePageChangedListener != null && mLastActivePage != activePage) {
-            updateIndicatorPosition(activePage);
             mOnActivePageChangedListener.onActivePageChanged(activePage);
         }
         mLastActivePage = activePage;