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

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

Issue 1352133002: Let Custom Tabs Use Light Progressbar for Dark Toolbar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed init() in ClipDrawableProgressbar Created 5 years, 3 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/CustomTabToolbar.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java
index 13394f0a741e18645378e8fb714d884644918ad4..e0df5be491e69f16a3ab4bcc2eadb85bd27dff9e 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/CustomTabToolbar.java
@@ -60,9 +60,11 @@ public class CustomTabToolbar extends ToolbarLayout implements LocationBar,
private ImageButton mCustomActionButton;
private int mSecurityIconType;
private boolean mShouldShowTitle;
- private boolean mUseDarkColors;
private ImageButton mCloseButton;
+ // Whether dark tint should be applied to icons and text.
+ private boolean mUseDarkColors;
+
private CustomTabToolbarAnimationDelegate mAnimDelegate;
private boolean mBackgroundColorSet;
@@ -293,10 +295,17 @@ public class CustomTabToolbar extends ToolbarLayout implements LocationBar,
mTitleBar.setTextColor(titleTextColor);
if (getProgressBar() != null) {
- int progressBarBackgroundColorResource = mUseDarkColors
- ? R.color.progress_bar_background : R.color.progress_bar_background_white;
- getProgressBar().setBackgroundColor(
- ApiCompatibilityUtils.getColor(resources, progressBarBackgroundColorResource));
+ if (mBackgroundColorSet && !mUseDarkColors) {
+ getProgressBar().setBackgroundColor(ColorUtils
+ .getLightProgressbarBackground(getToolbarDataProvider().getPrimaryColor()));
+ getProgressBar().setForegroundColor(ApiCompatibilityUtils.getColor(resources,
+ R.color.progress_bar_foreground_white));
+ } else {
+ int progressBarBackgroundColorResource = mUseDarkColors
+ ? R.color.progress_bar_background : R.color.progress_bar_background_white;
+ getProgressBar().setBackgroundColor(ApiCompatibilityUtils.getColor(resources,
+ progressBarBackgroundColorResource));
Ted C 2015/09/21 20:00:39 ah...the visuals can never change for a custom tab
Ian Wen 2015/09/21 20:44:47 Yes, the background color of the toolbar won't cha
+ }
}
}
@@ -371,11 +380,11 @@ public class CustomTabToolbar extends ToolbarLayout implements LocationBar,
@Override
protected void onPrimaryColorChanged() {
if (mBackgroundColorSet) return;
+ mBackgroundColorSet = true;
int primaryColor = getToolbarDataProvider().getPrimaryColor();
getBackground().setColor(primaryColor);
mUseDarkColors = !ColorUtils.shoudUseLightForegroundOnBackground(primaryColor);
updateVisualsForState();
- mBackgroundColorSet = true;
}
@Override
« no previous file with comments | « chrome/android/java/res/values/colors.xml ('k') | chrome/android/java/src/org/chromium/chrome/browser/util/ColorUtils.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698