summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2013-05-17 14:31:55 +0200
committerDanny Baumann <dannybaumann@web.de>2013-05-17 14:40:17 +0200
commit656d1a78e17757458099786808cf61c2887c22ae (patch)
tree12b9dd1807e59054225cc7299e06d8eb9df46683 /policy
parent49b819d96d19c61a78fa241db4753cbf6c874f11 (diff)
downloadframeworks_base-656d1a78e17757458099786808cf61c2887c22ae.zip
frameworks_base-656d1a78e17757458099786808cf61c2887c22ae.tar.gz
frameworks_base-656d1a78e17757458099786808cf61c2887c22ae.tar.bz2
Allow applications to show the navigation bar in expanded desktop mode.
This is used by the settings app to show the navigation bar when editing it. Change-Id: Idc8fa5e49f31175dea603d7f1a1ef94ffab7249d
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindowManager.java52
1 files changed, 14 insertions, 38 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 2a97b33..b7fa3ef 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -1447,37 +1447,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mHasSoftInput = hasSoftInput;
updateRotation = true;
}
-
- // Update navigation bar dimensions
- if (expandedDesktopHidesNavigationBar()) {
- // Set the navigation bar's dimensions to 0 in expanded desktop mode
- mNavigationBarWidthForRotation[mPortraitRotation]
- = mNavigationBarWidthForRotation[mUpsideDownRotation]
- = mNavigationBarWidthForRotation[mLandscapeRotation]
- = mNavigationBarWidthForRotation[mSeascapeRotation]
- = mNavigationBarHeightForRotation[mPortraitRotation]
- = mNavigationBarHeightForRotation[mUpsideDownRotation]
- = mNavigationBarHeightForRotation[mLandscapeRotation]
- = mNavigationBarHeightForRotation[mSeascapeRotation] = 0;
- } else {
- // Height of the navigation bar when presented horizontally at bottom
- mNavigationBarHeightForRotation[mPortraitRotation] =
- mNavigationBarHeightForRotation[mUpsideDownRotation] =
- mContext.getResources().getDimensionPixelSize(
- com.android.internal.R.dimen.navigation_bar_height);
- mNavigationBarHeightForRotation[mLandscapeRotation] =
- mNavigationBarHeightForRotation[mSeascapeRotation] =
- mContext.getResources().getDimensionPixelSize(
- com.android.internal.R.dimen.navigation_bar_height_landscape);
-
- // Width of the navigation bar when presented vertically along one side
- mNavigationBarWidthForRotation[mPortraitRotation] =
- mNavigationBarWidthForRotation[mUpsideDownRotation] =
- mNavigationBarWidthForRotation[mLandscapeRotation] =
- mNavigationBarWidthForRotation[mSeascapeRotation] =
- mContext.getResources().getDimensionPixelSize(
- com.android.internal.R.dimen.navigation_bar_width);
- }
}
if (updateRotation) {
@@ -1821,7 +1790,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
public int getNonDecorDisplayWidth(int fullWidth, int fullHeight, int rotation) {
- if (mHasNavigationBar) {
+ if (mHasNavigationBar && !expandedDesktopHidesNavigationBar()) {
// For a basic navigation bar, when we are in landscape mode we place
// the navigation bar to the side.
if (mNavigationBarCanMove && fullWidth > fullHeight) {
@@ -1832,11 +1801,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
public int getNonDecorDisplayHeight(int fullWidth, int fullHeight, int rotation) {
- if (mHasSystemNavBar) {
+ if (mHasSystemNavBar && !expandedDesktopHidesNavigationBar()) {
// For the system navigation bar, we always place it at the bottom.
return fullHeight - mNavigationBarHeightForRotation[rotation];
}
- if (mHasNavigationBar) {
+ if (mHasNavigationBar && !expandedDesktopHidesNavigationBar()) {
// For a basic navigation bar, when we are in portrait mode we place
// the navigation bar to the bottom.
if (!mNavigationBarCanMove || fullWidth < fullHeight) {
@@ -2888,6 +2857,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// For purposes of putting out fake window up to steal focus, we will
// drive nav being hidden only by whether it is requested.
boolean navVisible = (mLastSystemUiFlags&View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0;
+ int navWidth = mNavigationBarWidthForRotation[displayRotation];
+ int navHeight = mNavigationBarHeightForRotation[displayRotation];
// When the navigation bar isn't visible, we put up a fake
// input window to catch all touch events. This way we can
@@ -2908,8 +2879,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// For purposes of positioning and showing the nav bar, if we have
// decided that it can't be hidden (because of the screen aspect ratio),
// then take that into account.
- if (expandedDesktopHidesNavigationBar()) {
+ if (expandedDesktopHidesNavigationBar()
+ && (mLastSystemUiFlags & View.SYSTEM_UI_FLAG_SHOW_NAVIGATION_IN_EXPANDED_DESKTOP) == 0) {
navVisible = false;
+ navWidth = 0;
+ navHeight = 0;
} else if (!mCanHideNavigationBar) {
navVisible = true;
}
@@ -2922,7 +2896,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mNavigationBarOnBottom = (!mNavigationBarCanMove || displayWidth < displayHeight);
if (mNavigationBarOnBottom) {
// It's a system nav bar or a portrait screen; nav bar goes on bottom.
- int top = displayHeight - mNavigationBarHeightForRotation[displayRotation];
+ int top = displayHeight - navHeight;
mTmpNavigationFrame.set(0, top, displayWidth, displayHeight);
mStableBottom = mStableFullscreenBottom = mTmpNavigationFrame.top;
if (navVisible) {
@@ -2941,7 +2915,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
} else {
// Landscape screen; nav bar goes to the right.
- int left = displayWidth - mNavigationBarWidthForRotation[displayRotation];
+ int left = displayWidth - navWidth;
mTmpNavigationFrame.set(left, 0, displayWidth, displayHeight);
mStableRight = mStableFullscreenRight = mTmpNavigationFrame.left;
if (navVisible) {
@@ -3403,7 +3377,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
private boolean shouldHideNavigationBarLw(int systemUiVisibility) {
if (expandedDesktopHidesNavigationBar()) {
- return true;
+ if ((systemUiVisibility & View.SYSTEM_UI_FLAG_SHOW_NAVIGATION_IN_EXPANDED_DESKTOP) == 0) {
+ return true;
+ }
}
if (mCanHideNavigationBar) {