Commit 6f2a9c85 authored by dtrainor@chromium.org's avatar dtrainor@chromium.org

[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
parent d9e358e5
......@@ -16,4 +16,8 @@
<alpha android:interpolator="@android:anim/linear_interpolator"
android:fromAlpha="0" android:toAlpha="1"
android:duration="200" />
<translate android:interpolator="@interpolator/transform_curve_interpolator"
android:fromYDelta="@dimen/menu_negative_software_vertical_offset"
android:toYDelta="0"
android:duration="200" />
</set>
\ No newline at end of file
......@@ -7,5 +7,5 @@
<resources>
<!-- Menu Dimensions -->
<!-- Necessary to align the menu icon with the actual button. -->
<dimen name="menu_software_vertical_offset">-6dp</dimen>
<dimen name="menu_negative_software_vertical_offset">6dp</dimen>
</resources>
\ No newline at end of file
......@@ -17,7 +17,7 @@
<!-- Custom Menu dimensions -->
<dimen name="menu_width">258dp</dimen>
<dimen name="menu_software_vertical_offset">0dp</dimen>
<dimen name="menu_negative_software_vertical_offset">0dp</dimen>
<!-- The amount to fade the edges of the menu to indicate more content is available
via scrolling. -->
<dimen name="menu_vertical_fade_distance">15dp</dimen>
......
......@@ -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 @@ public class AppMenu implements OnItemClickListener, OnKeyListener {
} 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);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment