Merge "Make navigation bar always slippery" into nyc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b5359a0ccf
@@ -380,10 +380,6 @@ public class NavigationBarView extends LinearLayout {
|
||||
&& ((mNavigationIconHints & StatusBarManager.NAVIGATION_HINT_BACK_ALT) == 0);
|
||||
final boolean disableSearch = ((disabledFlags & View.STATUS_BAR_DISABLE_SEARCH) != 0);
|
||||
|
||||
if (SLIPPERY_WHEN_DISABLED) {
|
||||
setSlippery(disableHome && disableRecent && disableBack && disableSearch);
|
||||
}
|
||||
|
||||
ViewGroup navButtons = (ViewGroup) getCurrentView().findViewById(R.id.nav_buttons);
|
||||
if (navButtons != null) {
|
||||
LayoutTransition lt = navButtons.getLayoutTransition();
|
||||
@@ -458,22 +454,6 @@ public class NavigationBarView extends LinearLayout {
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
WindowManager wm = (WindowManager)getContext().getSystemService(Context.WINDOW_SERVICE);
|
||||
wm.updateViewLayout(this, lp);
|
||||
}
|
||||
}
|
||||
|
||||
public void setMenuVisibility(final boolean show) {
|
||||
setMenuVisibility(show, false);
|
||||
}
|
||||
|
||||
@@ -1372,7 +1372,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
| WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
||||
| WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
|
||||
| WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH
|
||||
| WindowManager.LayoutParams.FLAG_SPLIT_TOUCH,
|
||||
| WindowManager.LayoutParams.FLAG_SPLIT_TOUCH
|
||||
| WindowManager.LayoutParams.FLAG_SLIPPERY,
|
||||
PixelFormat.TRANSLUCENT);
|
||||
// this will allow the navbar to run in an overlay on devices that support this
|
||||
if (ActivityManager.isHighEndGfx()) {
|
||||
@@ -2578,8 +2579,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
}
|
||||
|
||||
mExpandedVisible = true;
|
||||
if (mNavigationBarView != null)
|
||||
mNavigationBarView.setSlippery(true);
|
||||
|
||||
// Expand the window to encompass the full screen in anticipation of the drag.
|
||||
// This is only possible to do atomically because the status bar is at the top of the screen!
|
||||
@@ -2713,8 +2712,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
mNotificationPanel.closeQs();
|
||||
|
||||
mExpandedVisible = false;
|
||||
if (mNavigationBarView != null)
|
||||
mNavigationBarView.setSlippery(false);
|
||||
|
||||
visibilityChanged(false);
|
||||
|
||||
// Shrink the window to the size of the status bar only
|
||||
|
||||
Reference in New Issue
Block a user