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

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

Issue 1372653002: Start caching tinting ColorStateLists in Toolbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarLayout.java » ('j') | 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/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 70f4f1ae14743e1d705f8367cc9e93de9510db7d..fff337003b9d72bd01fae150779be342c2877226 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
@@ -7,7 +7,6 @@ package org.chromium.chrome.browser.toolbar;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
-import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.drawable.ColorDrawable;
@@ -303,15 +302,14 @@ public class CustomTabToolbar extends ToolbarLayout implements LocationBar,
}
private void updateButtonsTint() {
- Resources resources = getResources();
- ColorStateList colorStateList = ApiCompatibilityUtils.getColorStateList(resources,
- mUseDarkColors ? R.color.dark_mode_tint : R.color.light_mode_tint);
- mMenuButton.setTint(colorStateList);
+ mMenuButton.setTint(mUseDarkColors ? mDarkModeTint : mLightModeTint);
if (mCloseButton.getDrawable() instanceof TintedDrawable) {
- ((TintedDrawable) mCloseButton.getDrawable()).setTint(colorStateList);
+ ((TintedDrawable) mCloseButton.getDrawable()).setTint(
+ mUseDarkColors ? mDarkModeTint : mLightModeTint);
}
if (mCustomActionButton.getDrawable() instanceof TintedDrawable) {
- ((TintedDrawable) mCustomActionButton.getDrawable()).setTint(colorStateList);
+ ((TintedDrawable) mCustomActionButton.getDrawable()).setTint(
+ mUseDarkColors ? mDarkModeTint : mLightModeTint);
}
}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarLayout.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698