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

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

Issue 2833573002: 🏠 Allow bottom sheet content to update handle color (Closed)
Patch Set: nits 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/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 314eebe2bd766bfa110b50a5931c18c92c441b49..26b0d8cbbee9b276ff2aef0d1bdb2465f73487d4 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
@@ -119,6 +119,21 @@ public class BottomToolbarPhone extends ToolbarPhone {
context.getResources(), R.drawable.toolbar_handle_light);
}
+ /**
+ * Set the color of the pull handle used by the toolbar.
+ * @param useLightDrawable If the handle color should be light.
+ */
+ public void updateHandleTint(boolean useLightDrawable) {
+ mToolbarHandleView.setImageDrawable(useLightDrawable ? mHandleLight : mHandleDark);
+ }
+
+ /**
+ * @return Whether or not the toolbar is currently using a light theme color.
+ */
+ public boolean isLightTheme() {
+ return !ColorUtils.shouldUseLightForegroundOnBackground(getTabThemeColor());
+ }
+
@Override
protected int getProgressBarTopMargin() {
// In the case where the toolbar is at the bottom of the screen, the progress bar should
@@ -235,8 +250,7 @@ public class BottomToolbarPhone extends ToolbarPhone {
// 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.setImageDrawable(isLight ? mHandleLight : mHandleDark);
+ mToolbarHandleView.setImageDrawable(isLightTheme() ? mHandleDark : mHandleLight);
}
@Override

Powered by Google App Engine
This is Rietveld 408576698