summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2016-12-09 13:56:15 -0800
committerHyunyoung Song <hyunyoungs@google.com>2016-12-12 14:34:10 -0800
commitdf9f14746c41950a18a3ce02e7742a1764c264ff (patch)
treefe9be2a6fecd2ceb0db6b122cc2eead18d6dbbe9
parent4633be64e863a96c63f814a2386b23b02d43910b (diff)
downloadandroid_packages_apps_Trebuchet-df9f14746c41950a18a3ce02e7742a1764c264ff.tar.gz
android_packages_apps_Trebuchet-df9f14746c41950a18a3ce02e7742a1764c264ff.tar.bz2
android_packages_apps_Trebuchet-df9f14746c41950a18a3ce02e7742a1764c264ff.zip
nav bar on all apps container should use light theme.
b/33553066 Change-Id: Ic9eb796a01eaa8d00fbeedeb5456876b668e6db2
-rw-r--r--res/values/colors.xml1
-rw-r--r--src/com/android/launcher3/Launcher.java18
-rw-r--r--src/com/android/launcher3/allapps/AllAppsContainerView.java4
-rw-r--r--src/com/android/launcher3/allapps/AllAppsTransitionController.java2
4 files changed, 21 insertions, 4 deletions
diff --git a/res/values/colors.xml b/res/values/colors.xml
index d5ce78607..ccbae58d9 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -40,6 +40,7 @@
<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>
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);
}
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index 5fc1d972c..f98e0275f 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -489,6 +489,10 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
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);
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
index adfad0813..42f1875d4 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -282,7 +282,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);
+ mLauncher.activateLightStatusBar(forceLight, forceLight);
}
/**