diff options
author | aurimas@chromium.org <aurimas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-16 18:53:28 +0000 |
---|---|---|
committer | aurimas@chromium.org <aurimas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-16 18:53:28 +0000 |
commit | 27c9bd718a1861afd352f6792cdf6cde4869d775 (patch) | |
tree | 08cae19755ca33a5e2b2c681bcd91e3df2198cb7 /chrome/android | |
parent | d63bcef346e62298f50f32f7ac6bb935bac3c0db (diff) | |
download | chromium_src-27c9bd718a1861afd352f6792cdf6cde4869d775.zip chromium_src-27c9bd718a1861afd352f6792cdf6cde4869d775.tar.gz chromium_src-27c9bd718a1861afd352f6792cdf6cde4869d775.tar.bz2 |
[Android] Do not consume ACTION_CANCEL and ACTION_UP on the menu button.
NOTRY=true
BUG=369680
Review URL: https://codereview.chromium.org/290143004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271069 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/android')
-rw-r--r-- | chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuButtonHelper.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuButtonHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuButtonHelper.java index baad099..f89dca7 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuButtonHelper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuButtonHelper.java @@ -103,9 +103,13 @@ public class AppMenuButtonHelper extends SimpleOnGestureListener implements OnTo @Override public boolean onTouch(View view, MotionEvent event) { + // isMenuButtonReleased is a workaround for some versions of Android that do not + // reset pressed animations correctly on mMenuButton.setPressed(false). + boolean isMenuButtonReleased = false; if (event.getActionMasked() == MotionEvent.ACTION_CANCEL || event.getActionMasked() == MotionEvent.ACTION_UP) { mMenuButton.setPressed(false); + isMenuButtonReleased = true; } // This will take care of showing app menu. @@ -118,6 +122,6 @@ public class AppMenuButtonHelper extends SimpleOnGestureListener implements OnTo if (dragHelper != null && !isTouchEventConsumed) { isTouchEventConsumed |= dragHelper.handleDragging(event); } - return isTouchEventConsumed; + return !isMenuButtonReleased && isTouchEventConsumed; } }
\ No newline at end of file |