diff options
author | Tony Wickham <twickham@google.com> | 2017-03-21 15:28:53 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-03-21 15:28:53 +0000 |
commit | e28fb8354e1e69ffff5bf051f60797c15b0834e0 (patch) | |
tree | f491c0b65e91e47a2298387cbb84ad3b6c5b88b9 /src/com/android/launcher3 | |
parent | df67e08789524c6158f182fa96fc20afb8cd1970 (diff) | |
parent | ed68728b1f22bc849e0567f2be3aeaf6798440ca (diff) | |
download | android_packages_apps_Trebuchet-e28fb8354e1e69ffff5bf051f60797c15b0834e0.tar.gz android_packages_apps_Trebuchet-e28fb8354e1e69ffff5bf051f60797c15b0834e0.tar.bz2 android_packages_apps_Trebuchet-e28fb8354e1e69ffff5bf051f60797c15b0834e0.zip |
Add support for making nav bar light separately from status bar
am: ed68728b1f
Change-Id: Idfc723333b6186e84125894c822e1d820294d3d6
Diffstat (limited to 'src/com/android/launcher3')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 25 | ||||
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsTransitionController.java | 2 |
2 files changed, 16 insertions, 11 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 43ff28ac3..cc757c556 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -483,7 +483,7 @@ public class Launcher extends BaseActivity // It's possible that All Apps is visible when this is run, // so always use light status bar in that case. Only change nav bar color to status bar // color when All Apps is visible. - activateLightStatusBar(lightStatusBar || isAllAppsVisible(), isAllAppsVisible()); + activateLightSystemBars(lightStatusBar || isAllAppsVisible(), true, isAllAppsVisible()); } } @@ -491,21 +491,26 @@ public class Launcher extends BaseActivity 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 lightStatusBar make sure the status bar is light - * @param changeNavBar if true, make the nav bar theme in sync with status bar. + * Sets the status and/or nav bar to be light or not. Light status bar means dark icons. + * @param isLight make sure the system bar is light. + * @param statusBar if true, make the status bar theme match the isLight param. + * @param navBar if true, make the nav bar theme match the isLight param. */ - public void activateLightStatusBar(boolean lightStatusBar, boolean changeNavBar) { + public void activateLightSystemBars(boolean isLight, boolean statusBar, boolean navBar) { int oldSystemUiFlags = getWindow().getDecorView().getSystemUiVisibility(); int newSystemUiFlags = oldSystemUiFlags; - if (lightStatusBar) { - newSystemUiFlags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR ; - if (changeNavBar && Utilities.isAtLeastO()) { + if (isLight) { + if (statusBar) { + newSystemUiFlags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; + } + if (navBar && Utilities.isAtLeastO()) { newSystemUiFlags |= SYSTEM_UI_FLAG_LIGHT_NAV_BAR; } } else { - newSystemUiFlags &= ~(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); - if (changeNavBar && Utilities.isAtLeastO()) { + if (statusBar) { + newSystemUiFlags &= ~(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + } + if (navBar && Utilities.isAtLeastO()) { newSystemUiFlags &= ~(SYSTEM_UI_FLAG_LIGHT_NAV_BAR); } } diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java index 3b370bd3e..30ed180e7 100644 --- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java +++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java @@ -260,7 +260,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul // 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, true); + mLauncher.activateLightSystemBars(forceLight, true /* statusBar */, true /* navBar */); } /** |