Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4718)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java

Issue 2779543005: Add support for highlighting menu items (Closed)
Patch Set: Debugged drawable issues Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java
index f49b9d20ebc3a6f984c761d7007b66d941af54f0..f70bd765770dee7f1e52376fb60f4a6f0137a2d1 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarPhone.java
@@ -1454,6 +1454,7 @@ public class ToolbarPhone extends ToolbarLayout
}
}
+ // TODO(dtrainor): This is always true when in the tab switcher (crbug.com/710750).
private boolean isTabSwitcherAnimationRunning() {
return mTabSwitcherState == ENTERING_TAB_SWITCHER
|| mTabSwitcherState == EXITING_TAB_SWITCHER;
@@ -2137,6 +2138,7 @@ public class ToolbarPhone extends ToolbarLayout
mMenuButton.setTint(mUseLightToolbarDrawables ? mLightModeTint : mDarkModeTint);
+ setMenuButtonHighlightDrawable(mHighlightingMenu);
if (mShowMenuBadge && inOrEnteringStaticTab) {
setAppMenuUpdateBadgeDrawable(mUseLightToolbarDrawables);
}
@@ -2180,6 +2182,19 @@ public class ToolbarPhone extends ToolbarLayout
}
@Override
+ public boolean useLightDrawables() {
+ return mUseLightToolbarDrawables;
+ }
+
+ @Override
+ protected void setMenuButtonHighlightDrawable(boolean highlighting) {
+ System.out.println("dtrainor: tab switcher anim " + isTabSwitcherAnimationRunning() + ", "
Ted C 2017/04/12 18:05:57 ?
David Trainor- moved to gerrit 2017/04/12 18:59:37 Sorry... logging from figuring out why this wasn't
+ + highlighting);
+ highlighting &= !isTabSwitcherAnimationRunning();
+ super.setMenuButtonHighlightDrawable(highlighting);
+ }
+
+ @Override
public void showAppMenuUpdateBadge() {
super.showAppMenuUpdateBadge();

Powered by Google App Engine
This is Rietveld 408576698