summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2013-09-05 10:42:03 -0400
committerJohn Spurlock <jspurlock@google.com>2013-09-05 11:44:34 -0400
commitcfc359a9e6798dc7595380314eac7fcfeda14d76 (patch)
treeb6feeefdb6cabb72904d958f975e882e2e537933 /packages/SystemUI/src
parentd2676f9bd93c333ae2c7f3ca284d0fef5a7e146b (diff)
downloadframeworks_base-cfc359a9e6798dc7595380314eac7fcfeda14d76.zip
frameworks_base-cfc359a9e6798dc7595380314eac7fcfeda14d76.tar.gz
frameworks_base-cfc359a9e6798dc7595380314eac7fcfeda14d76.tar.bz2
Remove opaque-on-interaction from nav bar.
And decouple it from the status bar opaque-on-interaction logic. It's still important to track nav bar interaction for hideybar suspension purposes. Also fix a sysui NPE that can occur when restarting SystemUI (vs the shell). Bug:10606136 Change-Id: I66a15e02cff352e26b25aebc1c42fb58c042effa
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java23
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java1
4 files changed, 18 insertions, 13 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index ff85cb4..54c9f5d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -1097,7 +1097,7 @@ public abstract class BaseStatusBar extends SystemUI implements
return km.inKeyguardRestrictedInputMode();
}
- public void setInteracting(boolean interacting) {
+ public void setInteracting(int barWindow, boolean interacting) {
// hook for subclasses
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java
index eef4f44..900e1e0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java
@@ -16,6 +16,7 @@
package com.android.systemui.statusbar;
+import android.app.StatusBarManager;
import android.graphics.RectF;
import android.view.MotionEvent;
import android.view.View;
@@ -86,9 +87,9 @@ public class DelegateViewHelper {
}
if (action == MotionEvent.ACTION_DOWN) {
- mBar.setInteracting(true);
+ mBar.setInteracting(StatusBarManager.WINDOW_NAVIGATION_BAR, true);
} else if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) {
- mBar.setInteracting(false);
+ mBar.setInteracting(StatusBarManager.WINDOW_NAVIGATION_BAR, false);
}
mDelegateView.getLocationOnScreen(mTempPoint);
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 01e6c84..9db2805 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -306,7 +306,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode {
}
};
- private boolean mInteracting;
+ private int mInteractingWindows;
private boolean mAutohideSuspended;
private int mStatusBarMode;
private int mNavigationBarMode;
@@ -1378,7 +1378,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode {
visibilityChanged(true);
- setInteracting(true);
+ setInteracting(StatusBarManager.WINDOW_STATUS_BAR, true);
}
public void animateCollapsePanels() {
@@ -1662,7 +1662,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode {
mPostCollapseCleanup = null;
}
- setInteracting(false);
+ setInteracting(StatusBarManager.WINDOW_STATUS_BAR, false);
}
/**
@@ -1738,7 +1738,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode {
}
if (mStatusBarWindowState == WINDOW_STATE_SHOWING) {
- setInteracting(true);
+ setInteracting(StatusBarManager.WINDOW_STATUS_BAR, true);
}
return false;
}
@@ -1871,7 +1871,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode {
private void checkBarModes() {
if (mDemoMode) return;
- checkBarMode(mStatusBarMode, mStatusBarWindowState, mStatusBarView.getBarTransitions());
+ checkBarMode((mInteractingWindows & StatusBarManager.WINDOW_STATUS_BAR) != 0 ? MODE_OPAQUE
+ : mStatusBarMode, mStatusBarWindowState, mStatusBarView.getBarTransitions());
if (mNavigationBarView != null) {
checkBarMode(mNavigationBarMode,
mNavigationBarWindowState, mNavigationBarView.getBarTransitions());
@@ -1880,7 +1881,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode {
private void checkBarMode(int mode, int windowState, BarTransitions transitions) {
final boolean imeVisible = (mNavigationIconHints & NAVIGATION_HINT_BACK_ALT) != 0;
- final int finalMode = imeVisible || mInteracting ? MODE_OPAQUE : mode;
+ final int finalMode = imeVisible ? MODE_OPAQUE : mode;
final boolean animate = windowState == WINDOW_STATE_SHOWING;
transitions.transitionTo(finalMode, animate);
}
@@ -1892,9 +1893,11 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode {
}};
@Override
- public void setInteracting(boolean interacting) {
- mInteracting = interacting;
- if (mInteracting) {
+ public void setInteracting(int barWindow, boolean interacting) {
+ mInteractingWindows = interacting
+ ? (mInteractingWindows | barWindow)
+ : (mInteractingWindows & ~barWindow);
+ if (mInteractingWindows != 0) {
suspendAutohide();
} else {
resumeSuspendedAutohide();
@@ -2117,7 +2120,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode {
+ " scroll " + mScrollView.getScrollX() + "," + mScrollView.getScrollY());
}
- pw.print(" mInteracting="); pw.println(mInteracting);
+ pw.print(" mInteractingWindows="); pw.println(mInteractingWindows);
pw.print(" mStatusBarWindowState=");
pw.println(windowStateToString(mStatusBarWindowState));
pw.print(" mStatusBarMode=");
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
index fa494c2..63e0c7a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
@@ -95,6 +95,7 @@ public class PhoneStatusBarView extends PanelBar {
}
private void applyMode(int mode, boolean animate) {
+ if (mLeftSide == null || mRightSide == null) return;
float newAlpha = getAlphaFor(mode);
if (animate) {
ObjectAnimator lhs = animateTransitionTo(mLeftSide, newAlpha);