Android系统修改导航栏显示位置,默认在下方,改到左边。
--- a/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -1225,17 +1225,15 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// Height of the navigation bar when presented horizontally at bottom
mNavigationBarHeightForRotation[mPortraitRotation] =
mNavigationBarHeightForRotation[mUpsideDownRotation] =
- res.getDimensionPixelSize(com.android.internal.R.dimen.navigation_bar_height);
+ 600;
mNavigationBarHeightForRotation[mLandscapeRotation] =
- mNavigationBarHeightForRotation[mSeascapeRotation] = res.getDimensionPixelSize(
- com.android.internal.R.dimen.navigation_bar_height_landscape);
+ mNavigationBarHeightForRotation[mSeascapeRotation] = 600;
// Width of the navigation bar when presented vertically along one side
mNavigationBarWidthForRotation[mPortraitRotation] =
mNavigationBarWidthForRotation[mUpsideDownRotation] =
mNavigationBarWidthForRotation[mLandscapeRotation] =
- mNavigationBarWidthForRotation[mSeascapeRotation] =
- res.getDimensionPixelSize(com.android.internal.R.dimen.navigation_bar_width);
+ mNavigationBarWidthForRotation[mSeascapeRotation] = 600;
// SystemUI (status bar) layout policy
int shortSizeDp = shortSize * DisplayMetrics.DENSITY_DEFAULT / density;
@@ -1245,8 +1243,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
/// M: read the critical dp from mtk resource @{
//mNavigationBarCanMove = shortSizeDp < 600;
- mNavigationBarCanMove = shortSizeDp < mContext.getResources().getInteger(
- com.mediatek.internal.R.integer.config_dp_for_rotation);
+ mNavigationBarCanMove = true;//shortSizeDp < mContext.getResources().getInteger(
+ //com.mediatek.internal.R.integer.config_dp_for_rotation);
/// @}
mHasNavigationBar = res.getBoolean(com.android.internal.R.bool.config_showNavigationBar);
@@ -1713,7 +1711,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
if (mHasNavigationBar) {
// For a basic navigation bar, when we are in landscape mode we place
// the navigation bar to the side.
- if (mNavigationBarCanMove && fullWidth > fullHeight) {
+ if (fullWidth > fullHeight) {
return fullWidth - mNavigationBarWidthForRotation[rotation];
}
}
@@ -3029,7 +3027,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// It's a system nav bar or a portrait screen; nav bar goes on bottom.
int top = displayHeight - overscanBottom
- mNavigationBarHeightForRotation[displayRotation];
- mTmpNavigationFrame.set(0, top, displayWidth, displayHeight - overscanBottom);
+ int left = displayWidth - overscanRight
+ - mNavigationBarWidthForRotation[displayRotation];
+ mTmpNavigationFrame.set(left, top, displayWidth, displayHeight - overscanBottom);
mStableBottom = mStableFullscreenBottom = mTmpNavigationFrame.top;
if (transientNavBarShowing) {
mNavigationBarController.setBarShowingLw(true);
@@ -3055,16 +3055,16 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// Landscape screen; nav bar goes to the right.
int left = displayWidth - overscanRight
- mNavigationBarWidthForRotation[displayRotation];
- mTmpNavigationFrame.set(left, 0, displayWidth - overscanRight, displayHeight);
- mStableRight = mStableFullscreenRight = mTmpNavigationFrame.left;
+ mTmpNavigationFrame.set(0, 0,mNavigationBarWidthForRotation[displayRotation], displayHeight);
+ mStableLeft = mStableFullscreenLeft = mTmpNavigationFrame.right;
if (transientNavBarShowing) {
mNavigationBarController.setBarShowingLw(true);
} else if (navVisible) {
if (!mIsAlarmBoot && !mIsShutDown) {
mNavigationBarController.setBarShowingLw(true);
- mDockRight = mTmpNavigationFrame.left;
- mRestrictedScreenWidth = mDockRight - mRestrictedScreenLeft;
- mRestrictedOverscanScreenWidth = mDockRight - mRestrictedOverscanScreenLeft;
+ mDockLeft = mTmpNavigationFrame.right;
+ mRestrictedScreenWidth = displayWidth - mDockLeft;
+ mRestrictedOverscanScreenWidth = displayWidth ;
}
} else {
// We currently want to hide the navigation UI.
@@ -3075,7 +3075,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// If the nav bar is currently requested to be visible,
// and not in the process of animating on or off, then
// we can tell the app that it is covered by it.
- mSystemRight = mTmpNavigationFrame.left;
+ mSystemLeft = mTmpNavigationFrame.right;
}
}
// Make sure the content and current rectangles are updated to