summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2013-09-14 11:58:55 -0400
committerJohn Spurlock <jspurlock@google.com>2013-09-14 16:58:57 -0400
commit7edfbca5d00cbc376fda790b50a3fedb9c6070ab (patch)
tree484c6041beb66429f2976dfcdeefe97de852eebe /policy
parent276e6c7a89ed91dbf3e4fe9f46d19e82656d8fd9 (diff)
downloadframeworks_base-7edfbca5d00cbc376fda790b50a3fedb9c6070ab.zip
frameworks_base-7edfbca5d00cbc376fda790b50a3fedb9c6070ab.tar.gz
frameworks_base-7edfbca5d00cbc376fda790b50a3fedb9c6070ab.tar.bz2
Promote lights-out to a bar transition mode.
Move all visual application of the legacy lights-out behind a new mode managed by BarTransitions for better coordination. Remove unused "hidden" state in NavigationBarView. Improve window state (showing/hiding/hidden) calculation, affecting whether or not sysui thinks it should animate. Removes invalid interim mode changes causing needless flashing during some transitions. Consider WINDOW_STATE_HIDING a state in which we ought to animate, since at least part of the window is visible throughout. Make the status/nav bar transition helper classes real boys. Animate KeyButtonView drawing alpha transition, cancel existing animations when resetting to avoid needless and unsightly "recovery". Bug:10746803 Change-Id: Ibd883da9041d071b6a4ff5b42cf96efba7696e9c
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/BarController.java42
1 files changed, 25 insertions, 17 deletions
diff --git a/policy/src/com/android/internal/policy/impl/BarController.java b/policy/src/com/android/internal/policy/impl/BarController.java
index 41b2fd1..57c9675 100644
--- a/policy/src/com/android/internal/policy/impl/BarController.java
+++ b/policy/src/com/android/internal/policy/impl/BarController.java
@@ -33,7 +33,7 @@ import java.io.PrintWriter;
* Controls state/behavior specific to a system bar window.
*/
public class BarController {
- private static final boolean DEBUG = true;
+ private static final boolean DEBUG = false;
private static final int TRANSIENT_BAR_NONE = 0;
private static final int TRANSIENT_BAR_SHOWING = 1;
@@ -106,24 +106,32 @@ public class BarController {
mPendingShow = true;
return false;
}
- final boolean oldVis = mWin.isVisibleLw();
- final boolean oldAnim = mWin.isAnimatingLw();
- final boolean rt = show ? mWin.showLw(true) : mWin.hideLw(true);
- final int state = computeState(oldVis, oldAnim, mWin.isVisibleLw(), mWin.isAnimatingLw());
- if (state > -1 && mWin.hasDrawnLw()) {
- updateState(state);
+ final boolean wasVis = mWin.isVisibleLw();
+ final boolean wasAnim = mWin.isAnimatingLw();
+ final boolean change = show ? mWin.showLw(true) : mWin.hideLw(true);
+ final int state = computeStateLw(wasVis, wasAnim, mWin, change);
+ updateStateLw(state);
+ return change;
+ }
+
+ private int computeStateLw(boolean wasVis, boolean wasAnim, WindowState win, boolean change) {
+ if (win.hasDrawnLw()) {
+ final boolean vis = win.isVisibleLw();
+ final boolean anim = win.isAnimatingLw();
+ if (mState == StatusBarManager.WINDOW_STATE_HIDING && !change && !vis) {
+ return StatusBarManager.WINDOW_STATE_HIDDEN;
+ } else if (change) {
+ if (wasVis && vis && !wasAnim && anim) {
+ return StatusBarManager.WINDOW_STATE_HIDING;
+ } else {
+ return StatusBarManager.WINDOW_STATE_SHOWING;
+ }
+ }
}
- return rt;
- }
-
- private int computeState(boolean oldVis, boolean oldAnim, boolean newVis, boolean newAnim) {
- return (!newVis && !newAnim) ? StatusBarManager.WINDOW_STATE_HIDDEN
- : (!oldVis && newVis && newAnim) ? StatusBarManager.WINDOW_STATE_SHOWING
- : (oldVis && newVis && !oldAnim && newAnim) ? StatusBarManager.WINDOW_STATE_HIDING
- : -1;
+ return mState;
}
- private void updateState(final int state) {
+ private void updateStateLw(final int state) {
if (state != mState) {
mState = state;
if (DEBUG) Slog.d(mTag, "mState: " + StatusBarManager.windowStateToString(state));
@@ -148,7 +156,7 @@ public class BarController {
public boolean checkHiddenLw() {
if (mWin != null && mWin.hasDrawnLw()) {
if (!mWin.isVisibleLw() && !mWin.isAnimatingLw()) {
- updateState(StatusBarManager.WINDOW_STATE_HIDDEN);
+ updateStateLw(StatusBarManager.WINDOW_STATE_HIDDEN);
}
if (mTransientBarState == TRANSIENT_BAR_HIDING && !mWin.isVisibleLw()) {
// Finished animating out, clean up and reset style