Skip to content

Commit f8d0494

Browse files
dsandlerAndroid (Google) Code Review
authored andcommitted
Merge "Allow nav bar height to vary between portrait and landscape." into jb-dev
2 parents f5d70fd + 9f65c4c commit f8d0494

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

core/res/res/values/dimens.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
<dimen name="status_bar_height">25dip</dimen>
3535
<!-- Height of the bottom navigation / system bar. -->
3636
<dimen name="navigation_bar_height">48dp</dimen>
37-
<!-- Height of the bottom navigation bar in portrait -->
38-
<dimen name="navigation_bar_height_portrait">@dimen/navigation_bar_height</dimen>
37+
<!-- Height of the bottom navigation bar in portrait; often the same as @dimen/navigation_bar_height -->
38+
<dimen name="navigation_bar_height_landscape">48dp</dimen>
3939
<!-- Width of the navigation bar when it is placed vertically on the screen -->
4040
<dimen name="navigation_bar_width">42dp</dimen>
4141
<!-- Height of notification icons in the status bar -->

core/res/res/values/public.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,7 @@
11841184
<java-symbol type="bool" name="config_showNavigationBar" />
11851185
<java-symbol type="bool" name="target_honeycomb_needs_options_menu" />
11861186
<java-symbol type="dimen" name="navigation_bar_height" />
1187+
<java-symbol type="dimen" name="navigation_bar_height_landscape" />
11871188
<java-symbol type="dimen" name="navigation_bar_width" />
11881189
<java-symbol type="dimen" name="status_bar_height" />
11891190
<java-symbol type="drawable" name="ic_jog_dial_sound_off" />

policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -977,16 +977,21 @@ public void setInitialDisplaySize(Display display, int width, int height) {
977977
mStatusBarHeight = mContext.getResources().getDimensionPixelSize(
978978
com.android.internal.R.dimen.status_bar_height);
979979

980-
mNavigationBarHeightForRotation[Surface.ROTATION_0] =
981-
mNavigationBarHeightForRotation[Surface.ROTATION_90] =
982-
mNavigationBarHeightForRotation[Surface.ROTATION_180] =
983-
mNavigationBarHeightForRotation[Surface.ROTATION_270] =
980+
// Height of the navigation bar when presented horizontally at bottom
981+
mNavigationBarHeightForRotation[mPortraitRotation] =
982+
mNavigationBarHeightForRotation[mUpsideDownRotation] =
984983
mContext.getResources().getDimensionPixelSize(
985984
com.android.internal.R.dimen.navigation_bar_height);
986-
mNavigationBarWidthForRotation[Surface.ROTATION_0] =
987-
mNavigationBarWidthForRotation[Surface.ROTATION_90] =
988-
mNavigationBarWidthForRotation[Surface.ROTATION_180] =
989-
mNavigationBarWidthForRotation[Surface.ROTATION_270] =
985+
mNavigationBarHeightForRotation[mLandscapeRotation] =
986+
mNavigationBarHeightForRotation[mSeascapeRotation] =
987+
mContext.getResources().getDimensionPixelSize(
988+
com.android.internal.R.dimen.navigation_bar_height_landscape);
989+
990+
// Width of the navigation bar when presented vertically along one side
991+
mNavigationBarWidthForRotation[mPortraitRotation] =
992+
mNavigationBarWidthForRotation[mUpsideDownRotation] =
993+
mNavigationBarWidthForRotation[mLandscapeRotation] =
994+
mNavigationBarWidthForRotation[mSeascapeRotation] =
990995
mContext.getResources().getDimensionPixelSize(
991996
com.android.internal.R.dimen.navigation_bar_width);
992997

0 commit comments

Comments
 (0)