summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorAdrian Roos <roosa@google.com>2014-05-17 02:35:33 +0200
committerAdrian Roos <roosa@google.com>2014-05-17 03:13:11 +0200
commit34e65445510ecd2523d8b6f3a1e07fe5a2b71ec6 (patch)
tree5ec6951c7ffaa10c460e08051978671525deaaec /policy
parentb0650e8ff3113f9b9dbb6d249339dbd7921b4517 (diff)
downloadframeworks_base-34e65445510ecd2523d8b6f3a1e07fe5a2b71ec6.zip
frameworks_base-34e65445510ecd2523d8b6f3a1e07fe5a2b71ec6.tar.gz
frameworks_base-34e65445510ecd2523d8b6f3a1e07fe5a2b71ec6.tar.bz2
Implement system bar color runtime API
Change-Id: Iacf36c6d92a2f779eb933218817721c8ed3c3344
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindow.java24
1 files changed, 20 insertions, 4 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
index 1b96f1f..e204cb2 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
@@ -204,6 +204,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
private int mTextColor = 0;
private int mStatusBarColor = 0;
private int mNavigationBarColor = 0;
+ private boolean mForcedStatusBarColor = false;
+ private boolean mForcedNavigationBarColor = false;
private CharSequence mTitle = null;
@@ -3084,8 +3086,12 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
}
decor.setOnSystemUiVisibilityChangeListener(decor);
}
- mStatusBarColor = a.getColor(R.styleable.Window_statusBarColor, 0xFF000000);
- mNavigationBarColor = a.getColor(R.styleable.Window_navigationBarColor, 0xFF000000);
+ if (!mForcedStatusBarColor) {
+ mStatusBarColor = a.getColor(R.styleable.Window_statusBarColor, 0xFF000000);
+ }
+ if (!mForcedNavigationBarColor) {
+ mNavigationBarColor = a.getColor(R.styleable.Window_navigationBarColor, 0xFF000000);
+ }
if (mAlwaysReadCloseOnTouchAttr || getContext().getApplicationInfo().targetSdkVersion
>= android.os.Build.VERSION_CODES.HONEYCOMB) {
@@ -4245,19 +4251,29 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
@Override
public int getStatusBarColor() {
- return 0;
+ return mStatusBarColor;
}
@Override
public void setStatusBarColor(int color) {
+ mStatusBarColor = color;
+ mForcedStatusBarColor = true;
+ if (mDecor != null) {
+ mDecor.updateColorViews(null);
+ }
}
@Override
public int getNavigationBarColor() {
- return 0;
+ return mNavigationBarColor;
}
@Override
public void setNavigationBarColor(int color) {
+ mNavigationBarColor = color;
+ mForcedNavigationBarColor = true;
+ if (mDecor != null) {
+ mDecor.updateColorViews(null);
+ }
}
}