Merge "Make navigation bar always slippery" into nyc-mr1-dev
am: b5359a0ccf
* commit 'b5359a0ccf990d3befb0dfa5fa5fe5162a03aac8':
Make navigation bar always slippery
Change-Id: I527426fc2005b29489261c3d277cff008858bd37
This commit is contained in:
@@ -380,10 +380,6 @@ public class NavigationBarView extends LinearLayout {
|
|||||||
&& ((mNavigationIconHints & StatusBarManager.NAVIGATION_HINT_BACK_ALT) == 0);
|
&& ((mNavigationIconHints & StatusBarManager.NAVIGATION_HINT_BACK_ALT) == 0);
|
||||||
final boolean disableSearch = ((disabledFlags & View.STATUS_BAR_DISABLE_SEARCH) != 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);
|
ViewGroup navButtons = (ViewGroup) getCurrentView().findViewById(R.id.nav_buttons);
|
||||||
if (navButtons != null) {
|
if (navButtons != null) {
|
||||||
LayoutTransition lt = navButtons.getLayoutTransition();
|
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) {
|
public void setMenuVisibility(final boolean show) {
|
||||||
setMenuVisibility(show, false);
|
setMenuVisibility(show, false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1372,7 +1372,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
| WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
| WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
||||||
| WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
|
| WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
|
||||||
| WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH
|
| WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH
|
||||||
| WindowManager.LayoutParams.FLAG_SPLIT_TOUCH,
|
| WindowManager.LayoutParams.FLAG_SPLIT_TOUCH
|
||||||
|
| WindowManager.LayoutParams.FLAG_SLIPPERY,
|
||||||
PixelFormat.TRANSLUCENT);
|
PixelFormat.TRANSLUCENT);
|
||||||
// this will allow the navbar to run in an overlay on devices that support this
|
// this will allow the navbar to run in an overlay on devices that support this
|
||||||
if (ActivityManager.isHighEndGfx()) {
|
if (ActivityManager.isHighEndGfx()) {
|
||||||
@@ -2578,8 +2579,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
mExpandedVisible = true;
|
mExpandedVisible = true;
|
||||||
if (mNavigationBarView != null)
|
|
||||||
mNavigationBarView.setSlippery(true);
|
|
||||||
|
|
||||||
// Expand the window to encompass the full screen in anticipation of the drag.
|
// 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!
|
// 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();
|
mNotificationPanel.closeQs();
|
||||||
|
|
||||||
mExpandedVisible = false;
|
mExpandedVisible = false;
|
||||||
if (mNavigationBarView != null)
|
|
||||||
mNavigationBarView.setSlippery(false);
|
|
||||||
visibilityChanged(false);
|
visibilityChanged(false);
|
||||||
|
|
||||||
// Shrink the window to the size of the status bar only
|
// Shrink the window to the size of the status bar only
|
||||||
|
|||||||
Reference in New Issue
Block a user