diff options
author | Daniel Sandler <dsandler@google.com> | 2011-06-29 15:10:49 -0400 |
---|---|---|
committer | Daniel Sandler <dsandler@google.com> | 2011-06-29 15:10:49 -0400 |
commit | 41006aaf3494a46731868dcb9347caf05f8804a4 (patch) | |
tree | dd3c38ac312038e301a1ccee912bfab2ac69b15e /packages | |
parent | c2fdd15df93e62f9355af7ee3cbc9c116ce19991 (diff) | |
download | frameworks_base-41006aaf3494a46731868dcb9347caf05f8804a4.zip frameworks_base-41006aaf3494a46731868dcb9347caf05f8804a4.tar.gz frameworks_base-41006aaf3494a46731868dcb9347caf05f8804a4.tar.bz2 |
Add 2mm dead zone (12dp) at the top of the navigation bar.
Also update metrics to match clarified spec; in particular,
the navbar is now 48dp tall.
Bug: 4689070
Change-Id: Ia05ae840076df5a984ac85bb63df997943356eb8
Diffstat (limited to 'packages')
3 files changed, 55 insertions, 31 deletions
diff --git a/packages/SystemUI/res/layout/navigation_bar.xml b/packages/SystemUI/res/layout/navigation_bar.xml index bc2f7ee..51e7d97 100644 --- a/packages/SystemUI/res/layout/navigation_bar.xml +++ b/packages/SystemUI/res/layout/navigation_bar.xml @@ -25,14 +25,13 @@ android:layout_width="match_parent" > - <FrameLayout - android:id="@+id/background" + <FrameLayout android:id="@+id/rot0" android:layout_height="match_parent" android:layout_width="match_parent" android:background="#FF000000" > - <LinearLayout android:id="@+id/rot0" + <LinearLayout android:layout_height="match_parent" android:layout_width="match_parent" android:orientation="horizontal" @@ -40,12 +39,12 @@ <!-- navigation controls --> <View - android:layout_width="32dp" + android:layout_width="40dp" android:layout_height="match_parent" android:layout_weight="0" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/back" - android:layout_width="54dp" + android:layout_width="80dp" android:layout_height="match_parent" android:src="@drawable/ic_sysbar_back_default" systemui:keyCode="4" @@ -57,7 +56,7 @@ android:layout_weight="1" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/home" - android:layout_width="54dp" + android:layout_width="80dp" android:layout_height="match_parent" android:src="@drawable/ic_sysbar_home_default" systemui:keyCode="3" @@ -69,13 +68,13 @@ android:layout_weight="1" /> <ImageView android:id="@+id/recent_apps" - android:layout_width="54dp" + android:layout_width="80dp" android:layout_height="match_parent" android:src="@drawable/ic_sysbar_recent_default" android:layout_weight="0" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/menu" - android:layout_width="32dp" + android:layout_width="40dp" android:layout_height="match_parent" android:src="@drawable/ic_sysbar_menu_default" systemui:keyCode="82" @@ -84,17 +83,31 @@ /> </LinearLayout> - <LinearLayout android:id="@+id/rot90" + <View android:id="@+id/deadzone" + android:layout_height="@dimen/navigation_bar_deadzone_size" + android:layout_width="match_parent" + android:layout_gravity="top" + android:clickable="true" + /> + </FrameLayout> + + <FrameLayout android:id="@+id/rot90" + android:layout_height="match_parent" + android:layout_width="match_parent" + android:background="#FF000000" + android:visibility="gone" + android:paddingTop="24dp" + > + + <LinearLayout android:layout_height="match_parent" android:layout_width="match_parent" android:orientation="vertical" - android:visibility="gone" - android:paddingTop="24dp" > <!-- navigation controls --> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/menu" - android:layout_height="32dp" + android:layout_height="40dp" android:layout_width="match_parent" android:src="@drawable/ic_sysbar_menu_default_land" systemui:keyCode="82" @@ -102,7 +115,7 @@ android:visibility="invisible" /> <ImageView android:id="@+id/recent_apps" - android:layout_height="54dp" + android:layout_height="80dp" android:layout_width="match_parent" android:src="@drawable/ic_sysbar_recent_default_land" android:layout_weight="0" @@ -113,7 +126,7 @@ android:layout_weight="1" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/home" - android:layout_height="54dp" + android:layout_height="80dp" android:layout_width="match_parent" android:src="@drawable/ic_sysbar_home_default_land" systemui:keyCode="3" @@ -125,28 +138,32 @@ android:layout_weight="1" /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/back" - android:layout_height="54dp" + android:layout_height="80dp" android:layout_width="match_parent" android:src="@drawable/ic_sysbar_back_default_land" systemui:keyCode="4" android:layout_weight="0" /> <View - android:layout_height="32dp" + android:layout_height="40dp" android:layout_width="match_parent" android:layout_weight="0" /> </LinearLayout> - <LinearLayout android:id="@+id/rot270" + <View android:id="@+id/deadzone" + android:layout_width="@dimen/navigation_bar_deadzone_size" android:layout_height="match_parent" - android:layout_width="match_parent" - android:orientation="vertical" - android:visibility="gone" - > - - <!-- not used --> - </LinearLayout> - + android:layout_gravity="left" + android:clickable="true" + /> </FrameLayout> + + <!-- not used --> + <View android:id="@+id/rot270" + android:layout_height="match_parent" + android:layout_width="match_parent" + android:visibility="gone" + /> + </com.android.systemui.statusbar.phone.NavigationBarView> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 3944c20..da28e1e 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -40,7 +40,11 @@ <dimen name="peek_window_y_offset">-12dp</dimen> <!-- thickness (height) of the navigation bar on phones that require it --> - <dimen name="navigation_bar_size">32dp</dimen> + <dimen name="navigation_bar_size">48dp</dimen> + + <!-- thickness (height) of the dead zone at the top of the navigation bar, + reducing false presses on navbar buttons; approx 2mm --> + <dimen name="navigation_bar_deadzone_size">12dp</dimen> <!-- thickness (height) of each notification row, including any separators or padding --> <dimen name="notification_height">65dp</dimen> 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 22181b8..550fc57 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java @@ -36,13 +36,14 @@ import com.android.internal.statusbar.IStatusBarService; import com.android.systemui.R; public class NavigationBarView extends LinearLayout { + final static boolean DEBUG_DEADZONE = false; + final static boolean NAVBAR_ALWAYS_AT_RIGHT = true; protected IStatusBarService mBarService; final Display mDisplay; View mCurrentView = null; View[] mRotatedViews = new View[4]; - View mBackground; Animator mLastAnimator = null; public View getRecentsButton() { @@ -74,13 +75,13 @@ public class NavigationBarView extends LinearLayout { } private void setLights(final boolean on) { - float oldAlpha = mBackground.getAlpha(); + float oldAlpha = mCurrentView.getAlpha(); android.util.Log.d("NavigationBarView", "animating alpha: " + oldAlpha + " -> " + (on ? 1f : 0f)); if (mLastAnimator != null && mLastAnimator.isRunning()) mLastAnimator.cancel(); - mLastAnimator = ObjectAnimator.ofFloat(mBackground, "alpha", oldAlpha, on ? 1f : 0f) + mLastAnimator = ObjectAnimator.ofFloat(mCurrentView, "alpha", oldAlpha, on ? 1f : 0f) .setDuration(on ? 250 : 1500); mLastAnimator.addListener(new AnimatorListenerAdapter() { @Override @@ -92,8 +93,6 @@ public class NavigationBarView extends LinearLayout { } public void onFinishInflate() { - mBackground = findViewById(R.id.background); - mRotatedViews[Surface.ROTATION_0] = mRotatedViews[Surface.ROTATION_180] = findViewById(R.id.rot0); @@ -121,6 +120,10 @@ public class NavigationBarView extends LinearLayout { mCurrentView = mRotatedViews[rot]; mCurrentView.setVisibility(View.VISIBLE); + if (DEBUG_DEADZONE) { + mCurrentView.findViewById(R.id.deadzone).setBackgroundColor(0x808080FF); + } + android.util.Log.d("NavigationBarView", "reorient(): rot=" + mDisplay.getRotation()); } } |