summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/statusbar
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2014-10-29 13:22:23 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-10-29 13:22:24 +0000
commit6533c544cfc3896793e038ae303ce5b9eafebdab (patch)
tree205282eb34d68ec3b6e7415baab9d05c0ede1ce1 /packages/SystemUI/src/com/android/systemui/statusbar
parentb9e290c7136fb7c76b7238426ccd598dec2d2643 (diff)
parentca8c626febe70f51236dadd0cfb1bb72589c4783 (diff)
downloadframeworks_base-6533c544cfc3896793e038ae303ce5b9eafebdab.zip
frameworks_base-6533c544cfc3896793e038ae303ce5b9eafebdab.tar.gz
frameworks_base-6533c544cfc3896793e038ae303ce5b9eafebdab.tar.bz2
Merge "Tune spacing in navigation bar for small and big devices" into lmp-mr1-dev
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/statusbar')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java18
1 files changed, 18 insertions, 0 deletions
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 88e71e2..9bb52e7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
@@ -33,12 +33,14 @@ import android.os.Message;
import android.util.AttributeSet;
import android.util.Log;
import android.view.Display;
+import android.view.Gravity;
import android.view.MotionEvent;
import android.view.Surface;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
+import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.android.systemui.R;
@@ -503,15 +505,31 @@ public class NavigationBarView extends LinearLayout {
// We swap all children of the 90 and 270 degree layouts, since they are vertical
View rotation90 = mRotatedViews[Surface.ROTATION_90];
swapChildrenOrderIfVertical(rotation90.findViewById(R.id.nav_buttons));
+ adjustExtraKeyGravity(rotation90, isLayoutRtl);
View rotation270 = mRotatedViews[Surface.ROTATION_270];
if (rotation90 != rotation270) {
swapChildrenOrderIfVertical(rotation270.findViewById(R.id.nav_buttons));
+ adjustExtraKeyGravity(rotation270, isLayoutRtl);
}
mIsLayoutRtl = isLayoutRtl;
}
}
+ private void adjustExtraKeyGravity(View navBar, boolean isLayoutRtl) {
+ View menu = navBar.findViewById(R.id.menu);
+ View imeSwitcher = navBar.findViewById(R.id.ime_switcher);
+ if (menu != null) {
+ FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) menu.getLayoutParams();
+ lp.gravity = isLayoutRtl ? Gravity.BOTTOM : Gravity.TOP;
+ menu.setLayoutParams(lp);
+ }
+ if (imeSwitcher != null) {
+ FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) imeSwitcher.getLayoutParams();
+ lp.gravity = isLayoutRtl ? Gravity.BOTTOM : Gravity.TOP;
+ imeSwitcher.setLayoutParams(lp);
+ }
+ }
/**
* Swaps the children order of a LinearLayout if it's orientation is Vertical