Commit c074827a authored by Matthew Jones's avatar Matthew Jones Committed by Commit Bot

Use consistent status bar theming in webapps

This patch changes WebappActivity to use the status bar theming
methods in the parent ChromeActivity rather than directly calling
the api compat method. As a result, webapps will have status bar
theming logic consistent with other chrome activities. The overrides
now ignore incoming theme colors in favor of it's own brand color.

Bug: 801474
Change-Id: I1f21de0465aea5262ea30d1912153461f71e41bc
Reviewed-on: https://chromium-review.googlesource.com/c/1435914Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Matthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626124}
parent c59ce391
...@@ -767,7 +767,7 @@ public class WebappActivity extends SingleTabActivity { ...@@ -767,7 +767,7 @@ public class WebappActivity extends SingleTabActivity {
int statusBarColor = Color.BLACK; int statusBarColor = Color.BLACK;
if (mBrandColor != null && mWebappInfo.displayMode() != WebDisplayMode.FULLSCREEN) { if (mBrandColor != null && mWebappInfo.displayMode() != WebDisplayMode.FULLSCREEN) {
taskDescriptionColor = mBrandColor; taskDescriptionColor = mBrandColor;
statusBarColor = ColorUtils.getDarkenedColorForStatusBar(mBrandColor); statusBarColor = mBrandColor;
if (getToolbarManager() != null) { if (getToolbarManager() != null) {
getToolbarManager().onThemeColorChanged(mBrandColor, false); getToolbarManager().onThemeColorChanged(mBrandColor, false);
} }
...@@ -775,17 +775,21 @@ public class WebappActivity extends SingleTabActivity { ...@@ -775,17 +775,21 @@ public class WebappActivity extends SingleTabActivity {
ApiCompatibilityUtils.setTaskDescription(this, title, icon, ApiCompatibilityUtils.setTaskDescription(this, title, icon,
ColorUtils.getOpaqueColor(taskDescriptionColor)); ColorUtils.getOpaqueColor(taskDescriptionColor));
ApiCompatibilityUtils.setStatusBarColor(getWindow(), statusBarColor); setStatusBarColor(statusBarColor, statusBarColor != Color.BLACK);
} }
@Override @Override
protected void setStatusBarColor(Tab tab, int color) { protected void setStatusBarColor(Tab tab, int color) {
// Intentionally do nothing as WebappActivity explicitly sets status bar color. // Ignore any color that is not the brand color.
super.setStatusBarColor(
mBrandColor == null ? Color.BLACK : mBrandColor, mBrandColor == null);
} }
@Override @Override
protected void setStatusBarColor(int color, boolean isDefaultThemeColor) { protected void setStatusBarColor(int color, boolean isDefaultThemeColor) {
// Intentionally do nothing as WebappActivity explicitly sets status bar color. // Ignore any color that is not the brand color.
super.setStatusBarColor(
mBrandColor == null ? Color.BLACK : mBrandColor, mBrandColor == null);
} }
@Override @Override
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment