Merge "Fix MENU icon weirdness. (DO NOT MERGE)" into ics-factoryrom
This commit is contained in:
committed by
Android (Google) Code Review
commit
38cfcfbc32
@@ -59,7 +59,7 @@ public class NavigationBarView extends LinearLayout {
|
|||||||
int mBarSize;
|
int mBarSize;
|
||||||
boolean mVertical;
|
boolean mVertical;
|
||||||
|
|
||||||
boolean mHidden, mLowProfile;
|
boolean mHidden, mLowProfile, mShowMenu;
|
||||||
int mDisabledFlags = 0;
|
int mDisabledFlags = 0;
|
||||||
|
|
||||||
public View getRecentsButton() {
|
public View getRecentsButton() {
|
||||||
@@ -91,6 +91,7 @@ public class NavigationBarView extends LinearLayout {
|
|||||||
final Resources res = mContext.getResources();
|
final Resources res = mContext.getResources();
|
||||||
mBarSize = res.getDimensionPixelSize(R.dimen.navigation_bar_size);
|
mBarSize = res.getDimensionPixelSize(R.dimen.navigation_bar_size);
|
||||||
mVertical = false;
|
mVertical = false;
|
||||||
|
mShowMenu = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
View.OnTouchListener mLightsOutListener = new View.OnTouchListener() {
|
View.OnTouchListener mLightsOutListener = new View.OnTouchListener() {
|
||||||
@@ -126,7 +127,23 @@ public class NavigationBarView extends LinearLayout {
|
|||||||
getBackButton() .setVisibility(disableBack ? View.INVISIBLE : View.VISIBLE);
|
getBackButton() .setVisibility(disableBack ? View.INVISIBLE : View.VISIBLE);
|
||||||
getHomeButton() .setVisibility(disableNavigation ? View.INVISIBLE : View.VISIBLE);
|
getHomeButton() .setVisibility(disableNavigation ? View.INVISIBLE : View.VISIBLE);
|
||||||
getRecentsButton().setVisibility(disableNavigation ? View.INVISIBLE : View.VISIBLE);
|
getRecentsButton().setVisibility(disableNavigation ? View.INVISIBLE : View.VISIBLE);
|
||||||
getMenuButton() .setVisibility(disableNavigation ? View.INVISIBLE : View.VISIBLE);
|
|
||||||
|
getMenuButton() .setVisibility((disableNavigation || !mShowMenu)
|
||||||
|
? View.INVISIBLE : View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMenuVisibility(final boolean show) {
|
||||||
|
setMenuVisibility(show, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMenuVisibility(final boolean show, final boolean force) {
|
||||||
|
if (!force && mShowMenu == show) return;
|
||||||
|
|
||||||
|
mShowMenu = show;
|
||||||
|
|
||||||
|
getMenuButton().setVisibility(
|
||||||
|
(0 != (mDisabledFlags & View.STATUS_BAR_DISABLE_NAVIGATION) || !mShowMenu)
|
||||||
|
? View.INVISIBLE : View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLowProfile(final boolean lightsOut) {
|
public void setLowProfile(final boolean lightsOut) {
|
||||||
@@ -256,6 +273,7 @@ public class NavigationBarView extends LinearLayout {
|
|||||||
// force the low profile & disabled states into compliance
|
// force the low profile & disabled states into compliance
|
||||||
setLowProfile(mLowProfile, false, true /* force */);
|
setLowProfile(mLowProfile, false, true /* force */);
|
||||||
setDisabledFlags(mDisabledFlags, true /* force */);
|
setDisabledFlags(mDisabledFlags, true /* force */);
|
||||||
|
setMenuVisibility(mShowMenu, true /* force */);
|
||||||
|
|
||||||
if (DEBUG_DEADZONE) {
|
if (DEBUG_DEADZONE) {
|
||||||
mCurrentView.findViewById(R.id.deadzone).setBackgroundColor(0x808080FF);
|
mCurrentView.findViewById(R.id.deadzone).setBackgroundColor(0x808080FF);
|
||||||
|
|||||||
@@ -1572,8 +1572,7 @@ public class PhoneStatusBar extends StatusBar {
|
|||||||
Slog.d(TAG, (showMenu?"showing":"hiding") + " the MENU button");
|
Slog.d(TAG, (showMenu?"showing":"hiding") + " the MENU button");
|
||||||
}
|
}
|
||||||
if (mNavigationBarView != null) {
|
if (mNavigationBarView != null) {
|
||||||
mNavigationBarView.getMenuButton().setVisibility(showMenu
|
mNavigationBarView.setMenuVisibility(showMenu);
|
||||||
? View.VISIBLE : View.INVISIBLE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// See above re: lights-out policy for legacy apps.
|
// See above re: lights-out policy for legacy apps.
|
||||||
|
|||||||
Reference in New Issue
Block a user