Commit 495b732d authored by Matthew Jones's avatar Matthew Jones Committed by Commit Bot

Reland "Fix startup grey status bar on < M devices"

This is a reland of 27d290e8

Original change's description:
> Fix startup grey status bar on < M devices
> 
> This patch moves the white status bar theme to a version specific
> v23 directory to prevent L and below devices from using the flashing
> between colors. Logic has also been added to ChromeActivity to prevent
> these devices from using the grey (darkened version of white) color on
> startup.
> 
> Bug: 881239
> Change-Id: I41e5d959fab96623d254f4ff2dd0ea15cb6f9abc
> Reviewed-on: https://chromium-review.googlesource.com/1228496
> Commit-Queue: Matthew Jones <mdjones@chromium.org>
> Reviewed-by: Theresa <twellington@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#591857}

Bug: 881239
Change-Id: I96efe736dd6080ba01de2e5c87dca20deac99bf7
Reviewed-on: https://chromium-review.googlesource.com/1230699Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Matthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592489}
parent 6a5858fb
...@@ -54,13 +54,11 @@ ...@@ -54,13 +54,11 @@
</style> </style>
<style name="TabbedModeThemeBase" parent="MainTheme"> <style name="TabbedModeThemeBase" parent="MainTheme">
<item name="android:statusBarColor" tools:targetApi="21">@color/modern_primary_color</item>
</style>
<style name="TabbedModeTheme" parent="TabbedModeThemeBase">
<item name="android:windowBackground">@android:color/white</item> <item name="android:windowBackground">@android:color/white</item>
</style> </style>
<style name="TabbedModeTheme" parent="TabbedModeThemeBase" />
<style name="FirstRunTheme" parent="DialogWhenLarge"> <style name="FirstRunTheme" parent="DialogWhenLarge">
</style> </style>
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="TabbedModeTheme" parent="TabbedModeThemeBase">
<item name="android:statusBarColor">@color/modern_primary_color</item>
<item name="android:windowLightStatusBar">true</item>
</style>
</resources>
...@@ -559,10 +559,7 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent> ...@@ -559,10 +559,7 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
protected void onInitialLayoutInflationComplete() { protected void onInitialLayoutInflationComplete() {
mInflateInitialLayoutEndMs = SystemClock.elapsedRealtime(); mInflateInitialLayoutEndMs = SystemClock.elapsedRealtime();
// Set the status bar color to white by default. // Set the status bar color to white by default.
setStatusBarColor(null, setStatusBarColor(ColorUtils.getDefaultThemeColor(getResources(), false), true);
DeviceFormFactor.isNonMultiDisplayContextOnTablet(this)
? Color.BLACK
: ColorUtils.getDefaultThemeColor(getResources(), false));
ViewGroup rootView = (ViewGroup) getWindow().getDecorView().getRootView(); ViewGroup rootView = (ViewGroup) getWindow().getDecorView().getRootView();
mCompositorViewHolder = (CompositorViewHolder) findViewById(R.id.compositor_view_holder); mCompositorViewHolder = (CompositorViewHolder) findViewById(R.id.compositor_view_holder);
......
...@@ -896,6 +896,11 @@ public class WebappActivity extends SingleTabActivity { ...@@ -896,6 +896,11 @@ public class WebappActivity extends SingleTabActivity {
// Intentionally do nothing as WebappActivity explicitly sets status bar color. // Intentionally do nothing as WebappActivity explicitly sets status bar color.
} }
@Override
protected void setStatusBarColor(int color, boolean isDefaultThemeColor) {
// Intentionally do nothing as WebappActivity explicitly sets status bar color.
}
@Override @Override
public boolean onMenuOrKeyboardAction(int id, boolean fromMenu) { public boolean onMenuOrKeyboardAction(int id, boolean fromMenu) {
if (id == R.id.open_in_browser_id) { if (id == R.id.open_in_browser_id) {
......
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