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

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: 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..18c19a233852a501439a1cbd63f65c919955f520 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 useLight If the handle color should be light.
+ */
+ public void updateHandleTint(boolean useLight) {
+ mToolbarHandleView.setImageDrawable(useLight ? mHandleLight : mHandleDark);
+ }
+
+ /**
+ * @return Whether or not the toolbar currently uses light drawables.
+ */
+ public boolean usesLightDrawables() {
+ 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(usesLightDrawables() ? mHandleLight : mHandleDark);
}
@Override

Powered by Google App Engine
This is Rietveld 408576698