Merge "Make navigation bar always slippery" into nyc-mr1-dev

This commit is contained in:
TreeHugger Robot
2016-05-24 23:12:38 +00:00
committed by Android (Google) Code Review
2 changed files with 3 additions and 25 deletions

View File

@@ -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);
}

View File

@@ -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