diff options
author | Jorim Jaggi <jjaggi@google.com> | 2014-10-30 19:12:58 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2014-10-30 19:12:58 +0000 |
commit | fa61bfa429edacc2bacf0f9e427e39359d02dfec (patch) | |
tree | d04290afc56aa37b3af2fafaa7482bf72043f2a4 /packages/SystemUI/src/com/android/systemui/statusbar | |
parent | 468e6b7e8b945385d229660a953b816355211d0c (diff) | |
parent | 699560479d76e3056e54bf3850ba301b6a0acf90 (diff) | |
download | frameworks_base-fa61bfa429edacc2bacf0f9e427e39359d02dfec.zip frameworks_base-fa61bfa429edacc2bacf0f9e427e39359d02dfec.tar.gz frameworks_base-fa61bfa429edacc2bacf0f9e427e39359d02dfec.tar.bz2 |
am 6533c544: Merge "Tune spacing in navigation bar for small and big devices" into lmp-mr1-dev
automerge: 6995604
* commit '699560479d76e3056e54bf3850ba301b6a0acf90':
Tune spacing in navigation bar for small and big devices
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/statusbar')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java | 18 |
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 |