From 6f2a9c8524cf5a0e92bffeb63550be0321bacfbb Mon Sep 17 00:00:00 2001 From: "dtrainor@chromium.org" Date: Wed, 20 Aug 2014 05:57:11 +0000 Subject: [PATCH] [Android] Fix overflow menu enter tablet animation - On tablets the new anchor point was 6dp off due to the new shadow assets. To fix this add a 6dp translate to the enter animation that will move the asset into the correct location as the scale animation runs. This effectively mimics the old animation but allows the offset to be included. BUG=405352 Review URL: https://codereview.chromium.org/488863002 Cr-Commit-Position: refs/heads/master@{#290773} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290773 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/android/java/res/anim/menu_enter.xml | 4 ++++ chrome/android/java/res/values-sw600dp/dimens.xml | 2 +- chrome/android/java/res/values/dimens.xml | 2 +- .../src/org/chromium/chrome/browser/appmenu/AppMenu.java | 8 ++++---- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/chrome/android/java/res/anim/menu_enter.xml b/chrome/android/java/res/anim/menu_enter.xml index 63194a97931e1..e6c49367c375f 100644 --- a/chrome/android/java/res/anim/menu_enter.xml +++ b/chrome/android/java/res/anim/menu_enter.xml @@ -16,4 +16,8 @@ + \ No newline at end of file diff --git a/chrome/android/java/res/values-sw600dp/dimens.xml b/chrome/android/java/res/values-sw600dp/dimens.xml index d8fed332584f2..ba5395e9bc189 100644 --- a/chrome/android/java/res/values-sw600dp/dimens.xml +++ b/chrome/android/java/res/values-sw600dp/dimens.xml @@ -7,5 +7,5 @@ - -6dp + 6dp \ No newline at end of file diff --git a/chrome/android/java/res/values/dimens.xml b/chrome/android/java/res/values/dimens.xml index 72172f29d3cc0..fa87b1342ecd6 100644 --- a/chrome/android/java/res/values/dimens.xml +++ b/chrome/android/java/res/values/dimens.xml @@ -17,7 +17,7 @@ 258dp - 0dp + 0dp 15dp diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu.java index af48e841b38dc..b3d1cfe44567e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenu.java @@ -46,7 +46,7 @@ public class AppMenu implements OnItemClickListener, OnKeyListener { private final int mItemRowHeight; private final int mItemDividerHeight; private final int mVerticalFadeDistance; - private final int mAdditionalVerticalOffset; + private final int mNegativeSoftwareVerticalOffset; private ListPopupWindow mPopup; private AppMenuAdapter mAdapter; private AppMenuHandler mHandler; @@ -73,8 +73,8 @@ public class AppMenu implements OnItemClickListener, OnKeyListener { mItemDividerHeight = itemDividerHeight; assert mItemDividerHeight >= 0; - mAdditionalVerticalOffset = - res.getDimensionPixelSize(R.dimen.menu_software_vertical_offset); + mNegativeSoftwareVerticalOffset = + res.getDimensionPixelSize(R.dimen.menu_negative_software_vertical_offset); mVerticalFadeDistance = res.getDimensionPixelSize(R.dimen.menu_vertical_fade_distance); } @@ -207,7 +207,7 @@ private void setPopupOffset(ListPopupWindow popup, int screenRotation, Rect appR } else { // The menu is displayed over and below the anchored view, so shift the menu up by the // height of the anchor view. - popup.setVerticalOffset(mAdditionalVerticalOffset - anchorHeight); + popup.setVerticalOffset(-mNegativeSoftwareVerticalOffset - anchorHeight); } }