Skip to content

Commit 593b444

Browse files
Jim MillerAndroid (Google) Code Review
authored andcommitted
Merge "Fix 6583164: Make navbar slippery when shade is open" into jb-dev
2 parents 4a3a968 + b490c3e commit 593b444

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -484,14 +484,7 @@ protected void updateSearchPanel() {
484484

485485
@Override
486486
public void showSearchPanel() {
487-
// XXX This is a bit of a hack. Since navbar is no longer slippery, we use the
488-
// gesture to dismiss the expanded statusbar.
489-
if (mExpanded) {
490-
animateCollapse();
491-
return;
492-
} else {
493-
super.showSearchPanel();
494-
}
487+
super.showSearchPanel();
495488
WindowManager.LayoutParams lp =
496489
(android.view.WindowManager.LayoutParams) mNavigationBarView.getLayoutParams();
497490
lp.flags &= ~WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
@@ -1044,6 +1037,7 @@ private void makeExpandedVisible() {
10441037

10451038
mExpandedVisible = true;
10461039
mNotificationPanel.setVisibility(View.VISIBLE);
1040+
makeSlippery(mNavigationBarView, true);
10471041

10481042
updateExpandedViewPos(EXPANDED_LEAVE_ALONE);
10491043

@@ -1059,6 +1053,16 @@ private void makeExpandedVisible() {
10591053
visibilityChanged(true);
10601054
}
10611055

1056+
private static void makeSlippery(View view, boolean slippery) {
1057+
WindowManager.LayoutParams lp = (WindowManager.LayoutParams) view.getLayoutParams();
1058+
if (slippery) {
1059+
lp.flags |= WindowManager.LayoutParams.FLAG_SLIPPERY;
1060+
} else {
1061+
lp.flags &= ~WindowManager.LayoutParams.FLAG_SLIPPERY;
1062+
}
1063+
WindowManagerImpl.getDefault().updateViewLayout(view, lp);
1064+
}
1065+
10621066
public void animateExpand() {
10631067
if (SPEW) Slog.d(TAG, "Animate expand: expanded=" + mExpanded);
10641068
if ((mDisabled & StatusBarManager.DISABLE_EXPAND) != 0) {
@@ -1144,6 +1148,7 @@ void performCollapse() {
11441148
mExpandedVisible = false;
11451149
visibilityChanged(false);
11461150
mNotificationPanel.setVisibility(View.INVISIBLE);
1151+
makeSlippery(mNavigationBarView, false);
11471152

11481153
// Shrink the window to the size of the status bar only
11491154
WindowManager.LayoutParams lp = (WindowManager.LayoutParams) mStatusBarWindow.getLayoutParams();

0 commit comments

Comments
 (0)