Skip to content

Commit 36fde26

Browse files
Andrew FlynnAndroid Git Automerger
authored andcommitted
am dfc87c8: Merge "Use a different width for nav icons in sw600dp-port." into ics-scoop
* commit 'dfc87c82e4a5e77e89c464f7074e50238525913d': Use a different width for nav icons in sw600dp-port.
2 parents 4ff65a0 + dfc87c8 commit 36fde26

File tree

7 files changed

+53
-8
lines changed

7 files changed

+53
-8
lines changed

packages/SystemUI/res/layout-sw600dp/status_bar.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,30 +54,30 @@
5454
android:clipToPadding="false"
5555
>
5656
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/back"
57-
android:layout_width="80dip"
57+
android:layout_width="@dimen/navigation_key_width"
5858
android:layout_height="match_parent"
5959
android:src="@drawable/ic_sysbar_back"
6060
systemui:keyCode="4"
6161
android:contentDescription="@string/accessibility_back"
6262
systemui:glowBackground="@drawable/ic_sysbar_highlight"
6363
/>
6464
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/home"
65-
android:layout_width="80dip"
65+
android:layout_width="@dimen/navigation_key_width"
6666
android:layout_height="match_parent"
6767
android:src="@drawable/ic_sysbar_home"
6868
systemui:keyCode="3"
6969
android:contentDescription="@string/accessibility_home"
7070
systemui:glowBackground="@drawable/ic_sysbar_highlight"
7171
/>
7272
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/recent_apps"
73-
android:layout_width="80dip"
73+
android:layout_width="@dimen/navigation_key_width"
7474
android:layout_height="match_parent"
7575
android:src="@drawable/ic_sysbar_recent"
7676
android:contentDescription="@string/accessibility_recent"
7777
systemui:glowBackground="@drawable/ic_sysbar_highlight"
7878
/>
7979
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/menu"
80-
android:layout_width="80dip"
80+
android:layout_width="@dimen/navigation_menu_key_width"
8181
android:layout_height="match_parent"
8282
android:src="@drawable/ic_sysbar_menu"
8383
systemui:keyCode="82"

packages/SystemUI/res/layout/navigation_bar.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
android:visibility="invisible"
5050
/>
5151
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/back"
52-
android:layout_width="80dp"
52+
android:layout_width="@dimen/navigation_key_width"
5353
android:layout_height="match_parent"
5454
android:src="@drawable/ic_sysbar_back"
5555
systemui:keyCode="4"
@@ -64,7 +64,7 @@
6464
android:visibility="invisible"
6565
/>
6666
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/home"
67-
android:layout_width="80dp"
67+
android:layout_width="@dimen/navigation_key_width"
6868
android:layout_height="match_parent"
6969
android:src="@drawable/ic_sysbar_home"
7070
systemui:keyCode="3"
@@ -80,15 +80,15 @@
8080
android:visibility="invisible"
8181
/>
8282
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/recent_apps"
83-
android:layout_width="80dp"
83+
android:layout_width="@dimen/navigation_key_width"
8484
android:layout_height="match_parent"
8585
android:src="@drawable/ic_sysbar_recent"
8686
android:layout_weight="0"
8787
systemui:glowBackground="@drawable/ic_sysbar_highlight"
8888
android:contentDescription="@string/accessibility_recent"
8989
/>
9090
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/menu"
91-
android:layout_width="40dp"
91+
android:layout_width="@dimen/navigation_menu_key_width"
9292
android:layout_height="match_parent"
9393
android:src="@drawable/ic_sysbar_menu"
9494
systemui:keyCode="82"

packages/SystemUI/res/values-sw600dp-port/dimens.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,11 @@
1818
<resources>
1919
<!-- gap on either side of status bar notification icons -->
2020
<dimen name="status_bar_icon_padding">0dp</dimen>
21+
22+
<!-- The width of the view containing non-menu status bar icons -->
23+
<dimen name="navigation_key_width">70dip</dimen>
24+
25+
<!-- The width of the view containing the menu status bar icon -->
26+
<dimen name="navigation_menu_key_width">40dip</dimen>
2127
</resources>
2228

packages/SystemUI/res/values-sw600dp/dimens.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,10 @@
6767

6868
<!-- opacity at which Notification icons will be drawn in the status bar -->
6969
<item type="dimen" name="status_bar_icon_drawing_alpha">100%</item>
70+
71+
<!-- The width of the view containing non-menu status bar icons -->
72+
<dimen name="navigation_key_width">80dip</dimen>
73+
74+
<!-- The width of the view containing the menu status bar icon -->
75+
<dimen name="navigation_menu_key_width">40dip</dimen>
7076
</resources>

packages/SystemUI/res/values-sw720dp/dimens.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,11 @@
2121

2222
<!-- opacity at which Notification icons will be drawn in the status bar -->
2323
<item type="dimen" name="status_bar_icon_drawing_alpha">100%</item>
24+
25+
<!-- The width of the view containing non-menu status bar icons -->
26+
<dimen name="navigation_key_width">80dip</dimen>
27+
28+
<!-- The width of the view containing the menu status bar icon -->
29+
<dimen name="navigation_menu_key_width">80dip</dimen>
2430
</resources>
2531

packages/SystemUI/res/values/dimens.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,9 @@
9191
<!-- The padding on the global screenshot background image -->
9292
<dimen name="global_screenshot_bg_padding">20dp</dimen>
9393

94+
<!-- The width of the view containing non-menu status bar icons -->
95+
<dimen name="navigation_key_width">80dip</dimen>
96+
97+
<!-- The width of the view containing the menu status bar icon -->
98+
<dimen name="navigation_menu_key_width">40dip</dimen>
9499
</resources>

packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ public class TabletStatusBar extends StatusBar implements
121121
int mNaturalBarHeight = -1;
122122
int mIconSize = -1;
123123
int mIconHPadding = -1;
124+
int mNavIconWidth = -1;
125+
int mMenuNavIconWidth = -1;
124126
private int mMaxNotificationIcons = 5;
125127

126128
H mHandler = new H();
@@ -410,6 +412,26 @@ protected void loadDimens() {
410412
com.android.internal.R.dimen.system_bar_icon_size);
411413
int newIconHPadding = res.getDimensionPixelSize(
412414
R.dimen.status_bar_icon_padding);
415+
int newNavIconWidth = res.getDimensionPixelSize(R.dimen.navigation_key_width);
416+
int newMenuNavIconWidth = res.getDimensionPixelSize(R.dimen.navigation_menu_key_width);
417+
418+
if (mNavigationArea != null && newNavIconWidth != mNavIconWidth) {
419+
mNavIconWidth = newNavIconWidth;
420+
421+
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
422+
mNavIconWidth, ViewGroup.LayoutParams.MATCH_PARENT);
423+
mBackButton.setLayoutParams(lp);
424+
mHomeButton.setLayoutParams(lp);
425+
mRecentButton.setLayoutParams(lp);
426+
}
427+
428+
if (mNavigationArea != null && newMenuNavIconWidth != mMenuNavIconWidth) {
429+
mMenuNavIconWidth = newMenuNavIconWidth;
430+
431+
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
432+
mMenuNavIconWidth, ViewGroup.LayoutParams.MATCH_PARENT);
433+
mMenuButton.setLayoutParams(lp);
434+
}
413435

414436
if (newIconHPadding != mIconHPadding || newIconSize != mIconSize) {
415437
// Slog.d(TAG, "size=" + newIconSize + " padding=" + newIconHPadding);

0 commit comments

Comments
 (0)