diff options
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 9160a012e..ee8ddfd46 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -475,25 +475,37 @@ public class Launcher extends Activity 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); } |