<color name="all_apps_caret_shadow_color">#22000000</color>
<color name="all_apps_container_color">#FFF2F2F2</color>
<color name="all_apps_navbar_color">#28000000</color>
+ <color name="all_apps_light_navbar_color">#AAF2F2F2</color>
<color name="spring_loaded_panel_color">#40FFFFFF</color>
<color name="spring_loaded_highlighted_panel_border_color">#FFF</color>
mWorkspace.getPageIndicator().updateColor(mExtractedColors);
// It's possible that All Apps is visible when this is run,
// so always use light status bar in that case.
- activateLightStatusBar(isAllAppsVisible());
+ activateLightStatusBar(isAllAppsVisible(), false);
}
}
+ // TODO: use platform flag on API >= 26
+ private static final int SYSTEM_UI_FLAG_LIGHT_NAV_BAR = 0x10;
+
/**
* Sets the status bar to be light or not. Light status bar means dark icons.
* @param activate if true, make sure the status bar is light, otherwise base on wallpaper.
+ * @param changeNavBar make sure the nav bar is light only if this param and {@param activate}
+ * is also true.
*/
- public void activateLightStatusBar(boolean activate) {
+ public void activateLightStatusBar(boolean activate, boolean changeNavBar) {
boolean lightStatusBar = activate || (FeatureFlags.LIGHT_STATUS_BAR
&& mExtractedColors.getColor(ExtractedColors.STATUS_BAR_INDEX,
ExtractedColors.DEFAULT_DARK) == ExtractedColors.DEFAULT_LIGHT);
int oldSystemUiFlags = getWindow().getDecorView().getSystemUiVisibility();
int newSystemUiFlags = oldSystemUiFlags;
if (lightStatusBar) {
- newSystemUiFlags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
+ newSystemUiFlags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR ;
} else {
newSystemUiFlags &= ~(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}
+ if (Utilities.isAtLeastO() && activate) {
+ if (changeNavBar) {
+ newSystemUiFlags |= SYSTEM_UI_FLAG_LIGHT_NAV_BAR;
+ } else {
+ newSystemUiFlags &= ~(SYSTEM_UI_FLAG_LIGHT_NAV_BAR);
+ }
+ }
if (newSystemUiFlags != oldSystemUiFlags) {
getWindow().getDecorView().setSystemUiVisibility(newSystemUiFlags);
}
setLayoutParams(mlp);
} else {
View navBarBg = findViewById(R.id.nav_bar_bg);
+ if (Utilities.isAtLeastO()) {
+ navBarBg.setBackgroundColor(getResources().getColor(
+ R.color.all_apps_light_navbar_color));
+ }
ViewGroup.LayoutParams navBarBgLp = navBarBg.getLayoutParams();
navBarBgLp.height = insets.bottom;
navBarBg.setLayoutParams(navBarBgLp);
// Use a light status bar (dark icons) if all apps is behind at least half of the status
// bar. If the status bar is already light due to wallpaper extraction, keep it that way.
boolean forceLight = shift <= mStatusBarHeight / 2;
- mLauncher.activateLightStatusBar(forceLight);
+ mLauncher.activateLightStatusBar(forceLight, forceLight);
}
/**