Commit f83f7f1b authored by Theresa's avatar Theresa Committed by Commit Bot

Remove nav bar divider line when nav bar color is black

This effectively removes the grey navigation bar divider line when the
navigation bar color is black on Android P+.

BUG=844173

Change-Id: I5147f63aadd9d79d084fa582284e46fb2c6b6fe9
Reviewed-on: https://chromium-review.googlesource.com/1119369
Commit-Queue: Theresa <twellington@chromium.org>
Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571335}
parent be44dc6b
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
package org.chromium.chrome.browser; package org.chromium.chrome.browser;
import android.annotation.SuppressLint;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.Color; import android.graphics.Color;
...@@ -139,9 +140,21 @@ public class NavigationBarColorController implements VrModeObserver { ...@@ -139,9 +140,21 @@ public class NavigationBarColorController implements VrModeObserver {
mResources, R.color.bottom_system_nav_color) mResources, R.color.bottom_system_nav_color)
: Color.BLACK); : Color.BLACK);
setNavigationBarColor(useLightNavigation);
updateSystemUiVisibility(useLightNavigation); updateSystemUiVisibility(useLightNavigation);
} }
@SuppressLint("NewApi")
private void setNavigationBarColor(boolean useLightNavigation) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
mWindow.setNavigationBarDividerColor(useLightNavigation
? ApiCompatibilityUtils.getColor(
mResources, R.color.bottom_system_nav_divider_color)
: Color.BLACK);
}
}
private void updateSystemUiVisibility(boolean useLightNavigation) { private void updateSystemUiVisibility(boolean useLightNavigation) {
int visibility = mRootView.getSystemUiVisibility(); int visibility = mRootView.getSystemUiVisibility();
if (useLightNavigation) { if (useLightNavigation) {
......
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