diff options
author | Adrian Roos <roosa@google.com> | 2014-05-15 20:38:55 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-05-15 20:39:17 +0000 |
commit | e78e6f923774ac2cadee43fbf09b4df6b2b4ee87 (patch) | |
tree | 8c9907fd44c135ef4e50e61507264b527ffdd0ef /packages/SystemUI/src | |
parent | ca2624122c4ea4c22f305aec670f7841771c00ee (diff) | |
parent | ea56251d92050e9a672d1f66d0d4621e4dd4136e (diff) | |
download | frameworks_base-e78e6f923774ac2cadee43fbf09b4df6b2b4ee87.zip frameworks_base-e78e6f923774ac2cadee43fbf09b4df6b2b4ee87.tar.gz frameworks_base-e78e6f923774ac2cadee43fbf09b4df6b2b4ee87.tar.bz2 |
Merge "Colorize SystemUI"
Diffstat (limited to 'packages/SystemUI/src')
5 files changed, 16 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java index eb63a54..a41ec22 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java @@ -43,6 +43,7 @@ public class BarTransitions { public static final int MODE_SEMI_TRANSPARENT = 1; public static final int MODE_TRANSLUCENT = 2; public static final int MODE_LIGHTS_OUT = 3; + public static final int MODE_TRANSPARENT = 4; public static final int LIGHTS_IN_DURATION = 250; public static final int LIGHTS_OUT_DURATION = 750; @@ -69,7 +70,8 @@ public class BarTransitions { public void transitionTo(int mode, boolean animate) { // low-end devices do not support translucent modes, fallback to opaque - if (!HIGH_END && (mode == MODE_SEMI_TRANSPARENT || mode == MODE_TRANSLUCENT)) { + if (!HIGH_END && (mode == MODE_SEMI_TRANSPARENT || mode == MODE_TRANSLUCENT + || mode == MODE_TRANSPARENT)) { mode = MODE_OPAQUE; } if (mMode == mode) return; @@ -97,6 +99,7 @@ public class BarTransitions { if (mode == MODE_SEMI_TRANSPARENT) return "MODE_SEMI_TRANSPARENT"; if (mode == MODE_TRANSLUCENT) return "MODE_TRANSLUCENT"; if (mode == MODE_LIGHTS_OUT) return "MODE_LIGHTS_OUT"; + if (mode == MODE_TRANSPARENT) return "MODE_TRANSPARENT"; throw new IllegalArgumentException("Unknown mode " + mode); } @@ -111,6 +114,7 @@ public class BarTransitions { private static class BarBackgroundDrawable extends Drawable { private final int mOpaque; private final int mSemiTransparent; + private final int mTransparent; private final Drawable mGradient; private final TimeInterpolator mInterpolator; @@ -130,9 +134,11 @@ public class BarTransitions { if (DEBUG_COLORS) { mOpaque = 0xff0000ff; mSemiTransparent = 0x7f0000ff; + mTransparent = 0x2f0000ff; } else { mOpaque = res.getColor(R.color.system_bar_background_opaque); mSemiTransparent = res.getColor(R.color.system_bar_background_semi_transparent); + mTransparent = res.getColor(R.color.system_bar_background_transparent); } mGradient = res.getDrawable(gradientResourceId); mInterpolator = new LinearInterpolator(); @@ -184,9 +190,11 @@ public class BarTransitions { public void draw(Canvas canvas) { int targetGradientAlpha = 0, targetColor = 0; if (mMode == MODE_TRANSLUCENT) { - targetGradientAlpha = 0xff; + targetColor = mSemiTransparent; } else if (mMode == MODE_SEMI_TRANSPARENT) { targetColor = mSemiTransparent; + } else if (mMode == MODE_TRANSPARENT) { + targetColor = mTransparent; } else { targetColor = mOpaque; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarTransitions.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarTransitions.java index a0582ee..c83b479 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarTransitions.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarTransitions.java @@ -61,7 +61,7 @@ public final class NavigationBarTransitions extends BarTransitions { @Override public void transitionTo(int mode, boolean animate) { mRequestedMode = mode; - if (mVertical && mode == MODE_TRANSLUCENT) { + if (mVertical && (mode == MODE_TRANSLUCENT || mode == MODE_TRANSPARENT)) { // translucent mode not allowed when vertical mode = MODE_OPAQUE; } 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 23b0594..d3b5f96 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -26,6 +26,7 @@ import static com.android.systemui.statusbar.phone.BarTransitions.MODE_LIGHTS_OU import static com.android.systemui.statusbar.phone.BarTransitions.MODE_OPAQUE; import static com.android.systemui.statusbar.phone.BarTransitions.MODE_SEMI_TRANSPARENT; import static com.android.systemui.statusbar.phone.BarTransitions.MODE_TRANSLUCENT; +import static com.android.systemui.statusbar.phone.BarTransitions.MODE_TRANSPARENT; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -1870,6 +1871,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, private int barMode(int vis, int transientFlag, int translucentFlag) { return (vis & transientFlag) != 0 ? MODE_SEMI_TRANSPARENT : (vis & translucentFlag) != 0 ? MODE_TRANSLUCENT + : (vis & View.SYSTEM_UI_TRANSPARENT) != 0 ? MODE_TRANSPARENT : (vis & View.SYSTEM_UI_FLAG_LOW_PROFILE) != 0 ? MODE_LIGHTS_OUT : MODE_OPAQUE; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarTransitions.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarTransitions.java index 8406565..8520f40 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarTransitions.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarTransitions.java @@ -68,7 +68,8 @@ public final class PhoneStatusBarTransitions extends BarTransitions { } private boolean isOpaque(int mode) { - return !(mode == MODE_SEMI_TRANSPARENT || mode == MODE_TRANSLUCENT); + return !(mode == MODE_SEMI_TRANSPARENT || mode == MODE_TRANSLUCENT + || mode == MODE_TRANSPARENT); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java index 46a637b..b7bf6cd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java @@ -75,8 +75,7 @@ public class StatusBarWindowManager { | WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING | WindowManager.LayoutParams.FLAG_SPLIT_TOUCH | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH - | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION - | WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, + | WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, PixelFormat.TRANSLUCENT); mLp.flags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED; mLp.gravity = Gravity.TOP; |