Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +17 −0 Original line number Diff line number Diff line Loading @@ -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); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +12 −18 Original line number Diff line number Diff line Loading @@ -379,6 +379,8 @@ public class PhoneStatusBar extends BaseStatusBar { mIntruderAlertView.setBar(this); } updateShowSearchHoldoff(); mStatusBarView.mService = this; mChoreographer = Choreographer.getInstance(); Loading Loading @@ -666,7 +668,6 @@ public class PhoneStatusBar extends BaseStatusBar { lp.setTitle("NavigationBar"); lp.windowAnimations = 0; return lp; } Loading Loading @@ -811,6 +812,10 @@ public class PhoneStatusBar extends BaseStatusBar { @Override protected void onConfigurationChanged(Configuration newConfig) { updateRecentsPanel(); updateShowSearchHoldoff(); } private void updateShowSearchHoldoff() { mShowSearchHoldoff = mContext.getResources().getInteger( R.integer.config_show_search_delay); } Loading Loading @@ -1177,7 +1182,8 @@ public class PhoneStatusBar extends BaseStatusBar { mExpandedVisible = true; mPile.setLayoutTransitionsEnabled(true); makeSlippery(mNavigationBarView, true); if (mNavigationBarView != null) mNavigationBarView.setSlippery(true); updateCarrierLabelVisibility(true); Loading @@ -1201,19 +1207,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) { Loading Loading @@ -1298,8 +1291,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(); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +17 −0 Original line number Diff line number Diff line Loading @@ -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); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +12 −18 Original line number Diff line number Diff line Loading @@ -379,6 +379,8 @@ public class PhoneStatusBar extends BaseStatusBar { mIntruderAlertView.setBar(this); } updateShowSearchHoldoff(); mStatusBarView.mService = this; mChoreographer = Choreographer.getInstance(); Loading Loading @@ -666,7 +668,6 @@ public class PhoneStatusBar extends BaseStatusBar { lp.setTitle("NavigationBar"); lp.windowAnimations = 0; return lp; } Loading Loading @@ -811,6 +812,10 @@ public class PhoneStatusBar extends BaseStatusBar { @Override protected void onConfigurationChanged(Configuration newConfig) { updateRecentsPanel(); updateShowSearchHoldoff(); } private void updateShowSearchHoldoff() { mShowSearchHoldoff = mContext.getResources().getInteger( R.integer.config_show_search_delay); } Loading Loading @@ -1177,7 +1182,8 @@ public class PhoneStatusBar extends BaseStatusBar { mExpandedVisible = true; mPile.setLayoutTransitionsEnabled(true); makeSlippery(mNavigationBarView, true); if (mNavigationBarView != null) mNavigationBarView.setSlippery(true); updateCarrierLabelVisibility(true); Loading @@ -1201,19 +1207,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) { Loading Loading @@ -1298,8 +1291,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(); Loading