summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2012-06-13 11:19:51 -0400
committerJohn Spurlock <jspurlock@google.com>2012-06-14 10:01:48 -0400
commitd5ef54658ba7f869b1558df656772eebc3fb7328 (patch)
tree8b6f69a2adf13936e0b3d7b0dc57cfa80788fd68 /packages/SystemUI/src/com/android/systemui
parentc07dc74374d05cc35f73a933c980a0ef974a7b58 (diff)
downloadframeworks_base-d5ef54658ba7f869b1558df656772eebc3fb7328.zip
frameworks_base-d5ef54658ba7f869b1558df656772eebc3fb7328.tar.gz
frameworks_base-d5ef54658ba7f869b1558df656772eebc3fb7328.tar.bz2
NavBar: Slippery on the unsecured lock screen.
The NavBar is always non-slippery, except when: - the notification shade is showing - the 3 buttons (back,home,recents) are disabled Also fix unrelated bug that ignored the "show panel delay" before the first config change. Bug: 6614842 Change-Id: Ib40adaef122b563809398fdebbd8a88d8f0c7ffd
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java17
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java30
2 files changed, 29 insertions, 18 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
index 9c773a5..00d6d6f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
@@ -225,11 +225,28 @@ public class NavigationBarView extends LinearLayout {
final boolean disableRecent = ((disabledFlags & View.STATUS_BAR_DISABLE_RECENT) != 0);
final boolean disableBack = ((disabledFlags & View.STATUS_BAR_DISABLE_BACK) != 0);
+ setSlippery(disableHome && disableRecent && disableBack);
+
getBackButton() .setVisibility(disableBack ? View.INVISIBLE : View.VISIBLE);
getHomeButton() .setVisibility(disableHome ? View.INVISIBLE : View.VISIBLE);
getRecentsButton().setVisibility(disableRecent ? View.INVISIBLE : View.VISIBLE);
}
+ public void setSlippery(boolean newSlippery) {
+ WindowManager.LayoutParams lp = (WindowManager.LayoutParams) getLayoutParams();
+ if (lp != null) {
+ boolean oldSlippery = (lp.flags & WindowManager.LayoutParams.FLAG_SLIPPERY) != 0;
+ if (!oldSlippery && newSlippery) {
+ lp.flags |= WindowManager.LayoutParams.FLAG_SLIPPERY;
+ } else if (oldSlippery && !newSlippery) {
+ lp.flags &= ~WindowManager.LayoutParams.FLAG_SLIPPERY;
+ } else {
+ return;
+ }
+ WindowManagerImpl.getDefault().updateViewLayout(this, lp);
+ }
+ }
+
public void setMenuVisibility(final boolean show) {
setMenuVisibility(show, false);
}
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 56de506..cb2e86a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -376,6 +376,8 @@ public class PhoneStatusBar extends BaseStatusBar {
mIntruderAlertView.setBar(this);
}
+ updateShowSearchHoldoff();
+
mStatusBarView.mService = this;
mChoreographer = Choreographer.getInstance();
@@ -663,7 +665,6 @@ public class PhoneStatusBar extends BaseStatusBar {
lp.setTitle("NavigationBar");
lp.windowAnimations = 0;
-
return lp;
}
@@ -808,8 +809,12 @@ public class PhoneStatusBar extends BaseStatusBar {
@Override
protected void onConfigurationChanged(Configuration newConfig) {
updateRecentsPanel();
- mShowSearchHoldoff = mContext.getResources().getInteger(
- R.integer.config_show_search_delay);
+ updateShowSearchHoldoff();
+ }
+
+ private void updateShowSearchHoldoff() {
+ mShowSearchHoldoff = mContext.getResources().getInteger(
+ R.integer.config_show_search_delay);
}
private void loadNotificationShade() {
@@ -1174,7 +1179,8 @@ public class PhoneStatusBar extends BaseStatusBar {
mExpandedVisible = true;
mPile.setLayoutTransitionsEnabled(true);
- makeSlippery(mNavigationBarView, true);
+ if (mNavigationBarView != null)
+ mNavigationBarView.setSlippery(true);
updateCarrierLabelVisibility(true);
@@ -1198,19 +1204,6 @@ public class PhoneStatusBar extends BaseStatusBar {
visibilityChanged(true);
}
- private static void makeSlippery(View view, boolean slippery) {
- if (view == null) {
- return;
- }
- WindowManager.LayoutParams lp = (WindowManager.LayoutParams) view.getLayoutParams();
- if (slippery) {
- lp.flags |= WindowManager.LayoutParams.FLAG_SLIPPERY;
- } else {
- lp.flags &= ~WindowManager.LayoutParams.FLAG_SLIPPERY;
- }
- WindowManagerImpl.getDefault().updateViewLayout(view, lp);
- }
-
public void animateExpand() {
if (SPEW) Slog.d(TAG, "Animate expand: expanded=" + mExpanded);
if ((mDisabled & StatusBarManager.DISABLE_EXPAND) != 0) {
@@ -1295,8 +1288,9 @@ public class PhoneStatusBar extends BaseStatusBar {
}
mExpandedVisible = false;
mPile.setLayoutTransitionsEnabled(false);
+ if (mNavigationBarView != null)
+ mNavigationBarView.setSlippery(false);
visibilityChanged(false);
- makeSlippery(mNavigationBarView, false);
// Shrink the window to the size of the status bar only
WindowManager.LayoutParams lp = (WindowManager.LayoutParams) mStatusBarWindow.getLayoutParams();