Adjust app chip menu top margin.

Include adjusting gap of menu when expanding app chip.

Fix: 313648444
Test: OverviewImageTest
Flag: ACONFIG com.android.launcher3.enable_overview_icon_menu TEAMFOOD
Change-Id: Iea8ea76873ac008b90b6a8f183dc99cba9237041
diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml
index 295074a..2c454dd 100644
--- a/quickstep/res/values/dimens.xml
+++ b/quickstep/res/values/dimens.xml
@@ -73,9 +73,9 @@
     <!--  The margin at the start of the task icon menu  -->
     <dimen name="task_thumbnail_icon_menu_start_margin">12dp</dimen>
     <!--  The margin at the top of the task icon menu  -->
-    <dimen name="task_thumbnail_icon_menu_top_margin">6dp</dimen>
-    <!--  The margin at the top of the task icon menu when expanded  -->
-    <dimen name="task_thumbnail_icon_menu_top_margin_expanded">4dp</dimen>
+    <dimen name="task_thumbnail_icon_menu_top_margin">12dp</dimen>
+    <!--  The gap at the top of the task icon menu when expanded  -->
+    <dimen name="task_thumbnail_icon_menu_expanded_gap">6dp</dimen>
     <!--  The margin at the start of the task icon view in the icon menu  -->
     <dimen name="task_thumbnail_icon_view_start_margin">6dp</dimen>
     <!--  The space around the task icon arrow within the icon menu  -->
diff --git a/quickstep/src/com/android/quickstep/views/TaskMenuView.java b/quickstep/src/com/android/quickstep/views/TaskMenuView.java
index 0c816b8..cf89d2e 100644
--- a/quickstep/src/com/android/quickstep/views/TaskMenuView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskMenuView.java
@@ -311,14 +311,14 @@
                         - mActivity.getDeviceProfile().getOverviewActionsClaimedSpaceBelow();
                 float midpoint = (taskBottom + taskbarTop) / 2f;
                 additionalTranslationY = -Math.max(menuBottom - midpoint, 0);
-            } else {
-                // Animate the menu to leave a small margin at the top of the task.
-                additionalTranslationY = getResources().getDimensionPixelSize(
-                        R.dimen.task_thumbnail_icon_menu_top_margin_expanded);
             }
+            // Translate the menu to account for the expansion of the app chip menu as well.
+            float expandOffsetTranslationY = getResources().getDimensionPixelSize(
+                    R.dimen.task_thumbnail_icon_menu_expanded_gap);
             ObjectAnimator translationYAnim = ObjectAnimator.ofFloat(this, TRANSLATION_Y,
                     closing ? mMenuTranslationYBeforeOpen
-                            : mMenuTranslationYBeforeOpen + additionalTranslationY);
+                            : mMenuTranslationYBeforeOpen + additionalTranslationY
+                                    + expandOffsetTranslationY);
             translationYAnim.setInterpolator(EMPHASIZED);
 
             ObjectAnimator menuTranslationYAnim = ObjectAnimator.ofFloat(