diff options
author | John Spurlock <jspurlock@google.com> | 2014-01-14 14:51:23 -0500 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2014-03-04 10:03:53 -0500 |
commit | 88a9ce42096d6bb324c169633db709ff171972fc (patch) | |
tree | de51f8e3ff486ca6d7d98de64511f23b1ee69596 /packages/SystemUI/src/com | |
parent | 81479358decb0a2cefbb8245e0f56ed0e966d697 (diff) | |
download | frameworks_base-88a9ce42096d6bb324c169633db709ff171972fc.zip frameworks_base-88a9ce42096d6bb324c169633db709ff171972fc.tar.gz frameworks_base-88a9ce42096d6bb324c169633db709ff171972fc.tar.bz2 |
Allow lights-out + bar icon dimming on low-end devices.
Maintain fallback to OPAQUE mode on low-end devices in place of the
translucent modes.
Bug: 12546110
Change-Id: Ia3582c305cb09aadd56c6aa58b039a174675c79a
Diffstat (limited to 'packages/SystemUI/src/com')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java | 17 |
1 files changed, 11 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 cb17ac6..eb63a54 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java @@ -37,6 +37,8 @@ public class BarTransitions { private static final boolean DEBUG = false; private static final boolean DEBUG_COLORS = false; + public static final boolean HIGH_END = ActivityManager.isHighEndGfx(); + public static final int MODE_OPAQUE = 0; public static final int MODE_SEMI_TRANSPARENT = 1; public static final int MODE_TRANSLUCENT = 2; @@ -48,7 +50,6 @@ public class BarTransitions { private final String mTag; private final View mView; - private final boolean mSupportsTransitions = ActivityManager.isHighEndGfx(); private final BarBackgroundDrawable mBarBackground; private int mMode; @@ -57,7 +58,7 @@ public class BarTransitions { mTag = "BarTransitions." + view.getClass().getSimpleName(); mView = view; mBarBackground = new BarBackgroundDrawable(mView.getContext(), gradientResourceId); - if (mSupportsTransitions) { + if (HIGH_END) { mView.setBackground(mBarBackground); } } @@ -67,18 +68,22 @@ 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)) { + mode = MODE_OPAQUE; + } if (mMode == mode) return; int oldMode = mMode; mMode = mode; if (DEBUG) Log.d(mTag, String.format("%s -> %s animate=%s", modeToString(oldMode), modeToString(mode), animate)); - if (mSupportsTransitions) { - onTransition(oldMode, mMode, animate); - } + onTransition(oldMode, mMode, animate); } protected void onTransition(int oldMode, int newMode, boolean animate) { - applyModeBackground(oldMode, newMode, animate); + if (HIGH_END) { + applyModeBackground(oldMode, newMode, animate); + } } protected void applyModeBackground(int oldMode, int newMode, boolean animate) { |