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

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

Issue 2761273004: [Home] Improve exit tab switcher animation (Closed)
Patch Set: rebase 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
Index: chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java
index 28a392fcea1f3a3d126060cbd71f79610a45c6e9..caf50c4d94ebfe4af871239f0e489cffd61eb9e8 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java
@@ -95,11 +95,11 @@ public class BottomToolbarPhone extends ToolbarPhone {
super(context, attrs);
int defaultHandleColor =
- ApiCompatibilityUtils.getColor(getResources(), R.color.google_grey_500);
+ ApiCompatibilityUtils.getColor(getResources(), R.color.black_alpha_40);
mHandleDark = generateHandleBitmap(defaultHandleColor);
int lightHandleColor =
- ApiCompatibilityUtils.getColor(getResources(), R.color.semi_opaque_white);
+ ApiCompatibilityUtils.getColor(getResources(), R.color.white_alpha_50);
mHandleLight = generateHandleBitmap(lightHandleColor);
}
@@ -201,10 +201,11 @@ public class BottomToolbarPhone extends ToolbarPhone {
protected void updateVisualsForToolbarState() {
super.updateVisualsForToolbarState();
- // The handle should not show in tab switcher mode.
- mToolbarHandleView.setVisibility(
- mTabSwitcherState != ToolbarPhone.STATIC_TAB ? View.INVISIBLE : View.VISIBLE);
- mToolbarHandleView.setImageBitmap(mUseLightToolbarDrawables ? mHandleLight : mHandleDark);
+ // The tab switcher's background color should not affect the toolbar handle; it should only
+ // switch color based on the static tab's theme color. This is done so fade in/out looks
+ // correct.
+ boolean isLight = ColorUtils.shouldUseLightForegroundOnBackground(getTabThemeColor());
+ mToolbarHandleView.setImageBitmap(isLight ? mHandleLight : mHandleDark);
}
@Override
@@ -252,6 +253,7 @@ public class BottomToolbarPhone extends ToolbarPhone {
mNewTabButton.setAlpha(progress);
mLocationBar.setAlpha(1f - progress);
+ mToolbarHandleView.setAlpha(1f - progress);
int tabSwitcherThemeColor = getToolbarColorForVisualState(VisualState.TAB_SWITCHER_NORMAL);

Powered by Google App Engine
This is Rietveld 408576698