diff options
author | Andrew Flynn <flynn@google.com> | 2012-03-07 15:48:51 -0800 |
---|---|---|
committer | Andrew Flynn <flynn@google.com> | 2012-03-08 15:56:10 -0800 |
commit | 1d9af30b74a8c64aefa20fa0e31561d51c37e0f5 (patch) | |
tree | 6fa9a50ae8b57a6f1dbd23abaa1a745df6d7cea8 /packages/SystemUI | |
parent | ce8697f8d5368aa617b853fdabb6d7fb980bc5ce (diff) | |
download | frameworks_base-1d9af30b74a8c64aefa20fa0e31561d51c37e0f5.zip frameworks_base-1d9af30b74a8c64aefa20fa0e31561d51c37e0f5.tar.gz frameworks_base-1d9af30b74a8c64aefa20fa0e31561d51c37e0f5.tar.bz2 |
Use a different width for nav icons in sw600dp-port.
Change-Id: I6c4024e9f60e14c072d7c01f29fabc89fc51dfb8
Diffstat (limited to 'packages/SystemUI')
7 files changed, 53 insertions, 8 deletions
diff --git a/packages/SystemUI/res/layout-sw600dp/status_bar.xml b/packages/SystemUI/res/layout-sw600dp/status_bar.xml index b96c357..2308bf0 100644 --- a/packages/SystemUI/res/layout-sw600dp/status_bar.xml +++ b/packages/SystemUI/res/layout-sw600dp/status_bar.xml @@ -54,7 +54,7 @@ android:clipToPadding="false" > <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/back" - android:layout_width="80dip" + android:layout_width="@dimen/navigation_key_width" android:layout_height="match_parent" android:src="@drawable/ic_sysbar_back" systemui:keyCode="4" @@ -62,7 +62,7 @@ systemui:glowBackground="@drawable/ic_sysbar_highlight" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/home" - android:layout_width="80dip" + android:layout_width="@dimen/navigation_key_width" android:layout_height="match_parent" android:src="@drawable/ic_sysbar_home" systemui:keyCode="3" @@ -70,14 +70,14 @@ systemui:glowBackground="@drawable/ic_sysbar_highlight" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/recent_apps" - android:layout_width="80dip" + android:layout_width="@dimen/navigation_key_width" android:layout_height="match_parent" android:src="@drawable/ic_sysbar_recent" android:contentDescription="@string/accessibility_recent" systemui:glowBackground="@drawable/ic_sysbar_highlight" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/menu" - android:layout_width="80dip" + android:layout_width="@dimen/navigation_menu_key_width" android:layout_height="match_parent" android:src="@drawable/ic_sysbar_menu" systemui:keyCode="82" diff --git a/packages/SystemUI/res/layout/navigation_bar.xml b/packages/SystemUI/res/layout/navigation_bar.xml index d19fd81..ef2996e 100644 --- a/packages/SystemUI/res/layout/navigation_bar.xml +++ b/packages/SystemUI/res/layout/navigation_bar.xml @@ -49,7 +49,7 @@ android:visibility="invisible" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/back" - android:layout_width="80dp" + android:layout_width="@dimen/navigation_key_width" android:layout_height="match_parent" android:src="@drawable/ic_sysbar_back" systemui:keyCode="4" @@ -64,7 +64,7 @@ android:visibility="invisible" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/home" - android:layout_width="80dp" + android:layout_width="@dimen/navigation_key_width" android:layout_height="match_parent" android:src="@drawable/ic_sysbar_home" systemui:keyCode="3" @@ -80,7 +80,7 @@ android:visibility="invisible" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/recent_apps" - android:layout_width="80dp" + android:layout_width="@dimen/navigation_key_width" android:layout_height="match_parent" android:src="@drawable/ic_sysbar_recent" android:layout_weight="0" @@ -88,7 +88,7 @@ android:contentDescription="@string/accessibility_recent" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/menu" - android:layout_width="40dp" + android:layout_width="@dimen/navigation_menu_key_width" android:layout_height="match_parent" android:src="@drawable/ic_sysbar_menu" systemui:keyCode="82" diff --git a/packages/SystemUI/res/values-sw600dp-port/dimens.xml b/packages/SystemUI/res/values-sw600dp-port/dimens.xml index b8a6cfe..39eade6 100644 --- a/packages/SystemUI/res/values-sw600dp-port/dimens.xml +++ b/packages/SystemUI/res/values-sw600dp-port/dimens.xml @@ -18,5 +18,11 @@ <resources> <!-- gap on either side of status bar notification icons --> <dimen name="status_bar_icon_padding">0dp</dimen> + + <!-- The width of the view containing non-menu status bar icons --> + <dimen name="navigation_key_width">70dip</dimen> + + <!-- The width of the view containing the menu status bar icon --> + <dimen name="navigation_menu_key_width">40dip</dimen> </resources> diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml index f522285..ba1cdfa 100644 --- a/packages/SystemUI/res/values-sw600dp/dimens.xml +++ b/packages/SystemUI/res/values-sw600dp/dimens.xml @@ -67,4 +67,10 @@ <!-- opacity at which Notification icons will be drawn in the status bar --> <item type="dimen" name="status_bar_icon_drawing_alpha">100%</item> + + <!-- The width of the view containing non-menu status bar icons --> + <dimen name="navigation_key_width">80dip</dimen> + + <!-- The width of the view containing the menu status bar icon --> + <dimen name="navigation_menu_key_width">40dip</dimen> </resources> diff --git a/packages/SystemUI/res/values-sw720dp/dimens.xml b/packages/SystemUI/res/values-sw720dp/dimens.xml index 6736c1a..b16b1e8 100644 --- a/packages/SystemUI/res/values-sw720dp/dimens.xml +++ b/packages/SystemUI/res/values-sw720dp/dimens.xml @@ -21,5 +21,11 @@ <!-- opacity at which Notification icons will be drawn in the status bar --> <item type="dimen" name="status_bar_icon_drawing_alpha">100%</item> + + <!-- The width of the view containing non-menu status bar icons --> + <dimen name="navigation_key_width">80dip</dimen> + + <!-- The width of the view containing the menu status bar icon --> + <dimen name="navigation_menu_key_width">80dip</dimen> </resources> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 8fba86a..2c22e3c 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -91,4 +91,9 @@ <!-- The padding on the global screenshot background image --> <dimen name="global_screenshot_bg_padding">20dp</dimen> + <!-- The width of the view containing non-menu status bar icons --> + <dimen name="navigation_key_width">80dip</dimen> + + <!-- The width of the view containing the menu status bar icon --> + <dimen name="navigation_menu_key_width">40dip</dimen> </resources> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java index 6913239..92fbc7e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -121,6 +121,8 @@ public class TabletStatusBar extends StatusBar implements int mNaturalBarHeight = -1; int mIconSize = -1; int mIconHPadding = -1; + int mNavIconWidth = -1; + int mMenuNavIconWidth = -1; private int mMaxNotificationIcons = 5; H mHandler = new H(); @@ -410,6 +412,26 @@ public class TabletStatusBar extends StatusBar implements com.android.internal.R.dimen.system_bar_icon_size); int newIconHPadding = res.getDimensionPixelSize( R.dimen.status_bar_icon_padding); + int newNavIconWidth = res.getDimensionPixelSize(R.dimen.navigation_key_width); + int newMenuNavIconWidth = res.getDimensionPixelSize(R.dimen.navigation_menu_key_width); + + if (mNavigationArea != null && newNavIconWidth != mNavIconWidth) { + mNavIconWidth = newNavIconWidth; + + LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams( + mNavIconWidth, ViewGroup.LayoutParams.MATCH_PARENT); + mBackButton.setLayoutParams(lp); + mHomeButton.setLayoutParams(lp); + mRecentButton.setLayoutParams(lp); + } + + if (mNavigationArea != null && newMenuNavIconWidth != mMenuNavIconWidth) { + mMenuNavIconWidth = newMenuNavIconWidth; + + LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams( + mMenuNavIconWidth, ViewGroup.LayoutParams.MATCH_PARENT); + mMenuButton.setLayoutParams(lp); + } if (newIconHPadding != mIconHPadding || newIconSize != mIconSize) { // Slog.d(TAG, "size=" + newIconSize + " padding=" + newIconHPadding); |