From f86f898f8afe73d81b34543dcb2c30d8bf7da563 Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Tue, 31 May 2011 15:46:13 -0400 Subject: [PATCH] Move navigation bar to right-hand-side of seascape. This means the navbar will either be at the bottom (portrait and reverse portrait) or the right (landscape and seascape) irrespective of the physical bottom of the device. Change-Id: Ib51cab22f246785c9cebcc688bcdb848eb776361 --- packages/SystemUI/res/values/config.xml | 2 +- .../android/systemui/statusbar/phone/NavigationBarView.java | 6 +++++- .../android/systemui/statusbar/phone/PhoneStatusBar.java | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index 954a871068160..c0c39d0f54e6e 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -40,7 +40,7 @@ - false + true diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java index 7d6c57bbf8991..7dafb8921059b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java @@ -36,6 +36,8 @@ import com.android.internal.statusbar.IStatusBarService; import com.android.systemui.R; public class NavigationBarView extends LinearLayout { + final static boolean NAVBAR_ALWAYS_AT_RIGHT = true; + protected IStatusBarService mBarService; final Display mDisplay; View[] mRotatedViews = new View[4]; @@ -88,7 +90,9 @@ public class NavigationBarView extends LinearLayout { mRotatedViews[Surface.ROTATION_90] = findViewById(R.id.rot90); - mRotatedViews[Surface.ROTATION_270] = findViewById(R.id.rot270); + mRotatedViews[Surface.ROTATION_270] = NAVBAR_ALWAYS_AT_RIGHT + ? findViewById(R.id.rot90) + : findViewById(R.id.rot270); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index e66a1a26ecd9b..00de9205bdac2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -360,7 +360,9 @@ public class PhoneStatusBar extends StatusBar { break; case Surface.ROTATION_270: // device has been turned 90deg clockwise - lp.gravity = Gravity.LEFT | Gravity.FILL_VERTICAL; + lp.gravity = (NavigationBarView.NAVBAR_ALWAYS_AT_RIGHT ? Gravity.RIGHT + : Gravity.LEFT) + | Gravity.FILL_VERTICAL; break; default: lp.gravity = Gravity.BOTTOM | Gravity.FILL_HORIZONTAL;