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

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

Issue 2759433006: [Android] Fix flashing ripple on tab switch toolbar button (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6cd6e19e0a03ae45952c97e54015218abffe12f1..328bb774e7df35d198cc6b63e48f992129025e3e 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
@@ -28,6 +28,7 @@
import android.support.v4.view.animation.FastOutSlowInInterpolator;
import android.util.AttributeSet;
import android.util.Property;
+import android.util.TypedValue;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
@@ -1465,6 +1466,7 @@ private void updateViewsForTabSwitcherMode() {
updateProgressBarVisibility();
updateVisualsForToolbarState();
+ updateTabSwitcherButtonRipple();
}
private void updateProgressBarVisibility() {
@@ -1527,6 +1529,22 @@ protected void setTabSwitcherMode(
postInvalidateOnAnimation();
}
+ /**
+ * Enables or disables the tab switcher ripple depending on whether we are in or out of the tab
+ * switcher mode.
+ */
+ private void updateTabSwitcherButtonRipple() {
+ if (mTabSwitcherState == ENTERING_TAB_SWITCHER) {
+ mToggleTabStackButton.setBackgroundColor(
+ ApiCompatibilityUtils.getColor(getResources(), android.R.color.transparent));
+ } else {
+ TypedValue outValue = new TypedValue();
+ // the linked style here will have to be changed if it is updated in the XML.
+ getContext().getTheme().resolveAttribute(R.style.ToolbarButton, outValue, true);
+ mToggleTabStackButton.setBackgroundResource(outValue.resourceId);
+ }
+ }
+
@Override
protected void onTabSwitcherTransitionFinished() {
setAlpha(1.f);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698