From 1d6740f643389e4528079adfc865a8139ec84b9d Mon Sep 17 00:00:00 2001 From: "ianwen@chromium.org" Date: Tue, 1 Jul 2014 21:12:00 +0000 Subject: Update setupImageButton() in AppMenuAdapter to restore drawable's level after button.setImageDrawable() is called. BUG=386526 NOTRY=true Review URL: https://codereview.chromium.org/343183006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@280882 0039d316-1c4b-4281-b951-d872f2087c98 --- .../java/src/org/chromium/chrome/browser/appmenu/AppMenuAdapter.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuAdapter.java index 93c5ca5..37f6f97 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/appmenu/AppMenuAdapter.java @@ -209,7 +209,11 @@ class AppMenuAdapter extends BaseAdapter { } private void setupImageButton(ImageButton button, final MenuItem item) { + // Store and recover the level of image as button.setimageDrawable + // resets drawable to default level. + int currentLevel = item.getIcon().getLevel(); button.setImageDrawable(item.getIcon()); + item.getIcon().setLevel(currentLevel); button.setContentDescription(item.getTitle()); button.setEnabled(item.isEnabled()); button.setFocusable(item.isEnabled()); -- cgit v1.1