summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorAdrian Roos <roosa@google.com>2015-01-27 20:21:44 +0100
committerAdrian Roos <roosa@google.com>2015-02-04 14:28:14 +0100
commit75fa38539d1343eb7d4360c3a183e295a18185a8 (patch)
tree022561de99f52732d3fb75a36e86669b4ed3304b /packages/SystemUI
parent3bef2929fa45fb10b9238d83970ae4d2a54f9274 (diff)
downloadframeworks_base-75fa38539d1343eb7d4360c3a183e295a18185a8.zip
frameworks_base-75fa38539d1343eb7d4360c3a183e295a18185a8.tar.gz
frameworks_base-75fa38539d1343eb7d4360c3a183e295a18185a8.tar.bz2
Add API for light status bar
Adds a systemUiVisibility flag and links it to the status bar icon controller. Also adds a theme attribute for setting the flag. Bug: 19233606 Change-Id: I8a89a10cf2746cefa2feba50dc60c5eccd2ab28d
Diffstat (limited to 'packages/SystemUI')
-rw-r--r--packages/SystemUI/res/values/colors.xml1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java15
2 files changed, 16 insertions, 0 deletions
diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml
index 5cb956f..4c0cea8 100644
--- a/packages/SystemUI/res/values/colors.xml
+++ b/packages/SystemUI/res/values/colors.xml
@@ -129,4 +129,5 @@
<color name="segmented_button_selected">#FFFFFFFF</color>
<color name="segmented_button_unselected">#B3B0BEC5</color><!-- 70% blue grey 200 -->
<color name="volume_panel_divider">#1FFFFFFF</color><!-- 12% white -->
+ <color name="light_mode_icon_color">#FF616161</color><!-- grey 700 -->
</resources>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 4ffe9b1..f3ad46e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -49,6 +49,7 @@ import android.content.res.Resources;
import android.database.ContentObserver;
import android.graphics.Bitmap;
import android.graphics.Canvas;
+import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.PixelFormat;
import android.graphics.Point;
@@ -225,6 +226,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
/** Allow some time inbetween the long press for back and recents. */
private static final int LOCK_TO_APP_GESTURE_TOLERENCE = 200;
+ private int mLightModeIconColor;
+
PhoneStatusBarPolicy mIconPolicy;
// These are no longer handled by the policy, because we need custom strategies for them
@@ -531,6 +534,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
updateDisplaySize();
mScrimSrcModeEnabled = mContext.getResources().getBoolean(
R.bool.config_status_bar_scrim_behind_use_src);
+ mLightModeIconColor = mContext.getResources().getColor(R.color.light_mode_icon_color,
+ mContext.getTheme());
+
super.start(); // calls createAndAddWindows()
mMediaSessionManager
@@ -2223,6 +2229,15 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
mSystemUiVisibility &= ~View.NAVIGATION_BAR_UNHIDE;
}
+ if ((diff & View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR) != 0 || sbModeChanged) {
+ boolean allowLight = (sbMode == MODE_TRANSPARENT
+ || sbMode == MODE_LIGHTS_OUT_TRANSPARENT);
+ boolean light = (vis & View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR) != 0;
+
+ mIconController.setIconTint(
+ (allowLight && light) ? mLightModeIconColor : Color.WHITE);
+
+ }
// restore the recents bit
if (wasRecentsVisible) {
mSystemUiVisibility |= View.RECENT_APPS_VISIBLE;