summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/res
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@android.com>2012-08-29 15:49:53 -0400
committerDaniel Sandler <dsandler@android.com>2012-08-29 20:11:21 -0400
commitc26185bb7b30508a1940eb452af64b6d8661915f (patch)
tree8f67b2b5286f0af11164924a0e734bb70009e432 /packages/SystemUI/res
parent97d28d92c9a42db71d1855286fdd122e6b19ecef (diff)
downloadframeworks_base-c26185bb7b30508a1940eb452af64b6d8661915f.zip
frameworks_base-c26185bb7b30508a1940eb452af64b6d8661915f.tar.gz
frameworks_base-c26185bb7b30508a1940eb452af64b6d8661915f.tar.bz2
Expand the navbar dead zone briefly after touches elsewhere.
For now, each time the dead zone captures a touch, it will flash to let you know that's what happened. We should probably turn this off before shipping. Note also that this currently only expands the navbar on ACTION_DOWN elsewhere in the UI (because this is the only time ACTION_OUTSIDE is generated); this isn't perfect and we'll need to do some mucking about with the input system to get information about ongoing drags or additional pointers down, but this CL is a good start and introduces the general mechanism for expanding and contracting the dead zone. Change-Id: I43e63aed1e541fd07d83fde4d66bcb5be89b69d2
Diffstat (limited to 'packages/SystemUI/res')
-rw-r--r--packages/SystemUI/res/layout-sw600dp/navigation_bar.xml14
-rw-r--r--packages/SystemUI/res/layout/navigation_bar.xml16
-rw-r--r--packages/SystemUI/res/values/attrs.xml12
-rw-r--r--packages/SystemUI/res/values/config.xml4
-rw-r--r--packages/SystemUI/res/values/dimens.xml2
5 files changed, 43 insertions, 5 deletions
diff --git a/packages/SystemUI/res/layout-sw600dp/navigation_bar.xml b/packages/SystemUI/res/layout-sw600dp/navigation_bar.xml
index 67e13eb..fbbd7e5 100644
--- a/packages/SystemUI/res/layout-sw600dp/navigation_bar.xml
+++ b/packages/SystemUI/res/layout-sw600dp/navigation_bar.xml
@@ -143,8 +143,13 @@
<com.android.systemui.statusbar.policy.DeadZone
android:id="@+id/deadzone"
- android:layout_height="@dimen/navigation_bar_deadzone_size"
+ android:layout_height="match_parent"
android:layout_width="match_parent"
+ systemui:minSize="@dimen/navigation_bar_deadzone_size"
+ systemui:maxSize="@dimen/navigation_bar_deadzone_size_max"
+ systemui:holdTime="@integer/navigation_bar_deadzone_hold"
+ systemui:decayTime="@integer/navigation_bar_deadzone_decay"
+ systemui:orientation="horizontal"
android:layout_gravity="top"
/>
</FrameLayout>
@@ -269,8 +274,13 @@
<com.android.systemui.statusbar.policy.DeadZone
android:id="@+id/deadzone"
- android:layout_height="@dimen/navigation_bar_deadzone_size"
+ android:layout_height="match_parent"
android:layout_width="match_parent"
+ systemui:minSize="@dimen/navigation_bar_deadzone_size"
+ systemui:maxSize="@dimen/navigation_bar_deadzone_size_max"
+ systemui:holdTime="@integer/navigation_bar_deadzone_hold"
+ systemui:decayTime="@integer/navigation_bar_deadzone_decay"
+ systemui:orientation="vertical"
android:layout_gravity="top"
/>
</FrameLayout>
diff --git a/packages/SystemUI/res/layout/navigation_bar.xml b/packages/SystemUI/res/layout/navigation_bar.xml
index d41040d..33b5dbb 100644
--- a/packages/SystemUI/res/layout/navigation_bar.xml
+++ b/packages/SystemUI/res/layout/navigation_bar.xml
@@ -147,8 +147,13 @@
<com.android.systemui.statusbar.policy.DeadZone
android:id="@+id/deadzone"
- android:layout_height="@dimen/navigation_bar_deadzone_size"
+ android:layout_height="match_parent"
android:layout_width="match_parent"
+ systemui:minSize="@dimen/navigation_bar_deadzone_size"
+ systemui:maxSize="@dimen/navigation_bar_deadzone_size_max"
+ systemui:holdTime="@integer/navigation_bar_deadzone_hold"
+ systemui:decayTime="@integer/navigation_bar_deadzone_decay"
+ systemui:orientation="horizontal"
android:layout_gravity="top"
/>
</FrameLayout>
@@ -276,9 +281,14 @@
<com.android.systemui.statusbar.policy.DeadZone
android:id="@+id/deadzone"
- android:layout_width="@dimen/navigation_bar_deadzone_size"
android:layout_height="match_parent"
- android:layout_gravity="left"
+ android:layout_width="match_parent"
+ systemui:minSize="@dimen/navigation_bar_deadzone_size"
+ systemui:maxSize="@dimen/navigation_bar_deadzone_size_max"
+ systemui:holdTime="@integer/navigation_bar_deadzone_hold"
+ systemui:decayTime="@integer/navigation_bar_deadzone_decay"
+ systemui:orientation="vertical"
+ android:layout_gravity="top"
/>
</FrameLayout>
diff --git a/packages/SystemUI/res/values/attrs.xml b/packages/SystemUI/res/values/attrs.xml
index 48fb21f..047570f 100644
--- a/packages/SystemUI/res/values/attrs.xml
+++ b/packages/SystemUI/res/values/attrs.xml
@@ -35,5 +35,17 @@
<declare-styleable name="RecentsPanelView">
<attr name="recentItemLayout" format="reference" />
</declare-styleable>
+ <declare-styleable name="DeadZone">
+ <attr name="minSize" format="dimension" />
+ <attr name="maxSize" format="dimension" />
+ <attr name="holdTime" format="integer" />
+ <attr name="decayTime" format="integer" />
+ <attr name="orientation" />
+ </declare-styleable>
+
+ <attr name="orientation">
+ <enum name="horizontal" value="0" />
+ <enum name="vertical" value="1" />
+ </attr>
</resources>
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 1cd7904..3337573 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -72,5 +72,9 @@
<!-- Whether we're using the tablet-optimized recents interface (we use this
value at runtime for some things) -->
<integer name="status_bar_recents_bg_gradient_degrees">90</integer>
+
+ <!-- decay duration (from size_max -> size), in ms -->
+ <integer name="navigation_bar_deadzone_hold">333</integer>
+ <integer name="navigation_bar_deadzone_decay">333</integer>
</resources>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 94465e2..0d7cdb1 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -63,6 +63,8 @@
<!-- 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>
+ <!-- size of the dead zone when touches have recently occurred elsewhere on screen -->
+ <dimen name="navigation_bar_deadzone_size_max">32dp</dimen>
<!-- Height of notification icons in the status bar -->
<dimen name="status_bar_icon_size">@*android:dimen/status_bar_icon_size</dimen>