summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2011-06-20 16:40:37 -0700
committerJeff Brown <jeffbrown@google.com>2011-06-21 18:58:20 -0700
commit10b6290c5f15ae512a2f6b5bf8d95bd2527c7235 (patch)
tree2d1de2d5fdd2bd4df7457b984d8975629c6b71cc /api
parent738e7e431c71777100726f6c870e47c354db1337 (diff)
downloadframeworks_base-10b6290c5f15ae512a2f6b5bf8d95bd2527c7235.zip
frameworks_base-10b6290c5f15ae512a2f6b5bf8d95bd2527c7235.tar.gz
frameworks_base-10b6290c5f15ae512a2f6b5bf8d95bd2527c7235.tar.bz2
Only handle onHoverEvent in actionable views.
Modified onHoverEvent so that a view only has its state changed to hovered when the view is clickable. The intent is to prevent labels from taking hover focus away from their containing view group despite not being actionable in any way. The child will still receive a hover event but, if it does not handle the event (returns false), the hover event will bubble up to its parent and ancestors allowing them a chance to handle the event instead. The new onHoverEvent semantics are better because now they closely mirror those of onTouchEvent. This makes it straightforward to implement views that respond to hover by changing their visual appearance (such as by making buttons glow when hovered). Added onInterceptHoverEvent to enable ViewGroups to explicitly intercept hover events within their bounds. Exposed the new hover event API for real. Change-Id: I63195c8f5c74b859f6047487f9a0f703e8f40ffe
Diffstat (limited to 'api')
-rw-r--r--api/current.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt
index fa3130a..80f1e92 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -21704,7 +21704,10 @@ package android.view {
method public void dispatchDisplayHint(int);
method public boolean dispatchDragEvent(android.view.DragEvent);
method protected void dispatchDraw(android.graphics.Canvas);
+ method protected boolean dispatchGenericFocusedEvent(android.view.MotionEvent);
method public boolean dispatchGenericMotionEvent(android.view.MotionEvent);
+ method protected boolean dispatchGenericPointerEvent(android.view.MotionEvent);
+ method protected boolean dispatchHoverEvent(android.view.MotionEvent);
method public boolean dispatchKeyEvent(android.view.KeyEvent);
method public boolean dispatchKeyEventPreIme(android.view.KeyEvent);
method public boolean dispatchKeyShortcutEvent(android.view.KeyEvent);
@@ -21892,6 +21895,7 @@ package android.view {
method public void onFinishTemporaryDetach();
method protected void onFocusChanged(boolean, int, android.graphics.Rect);
method public boolean onGenericMotionEvent(android.view.MotionEvent);
+ method public void onHoverChanged(boolean);
method public boolean onHoverEvent(android.view.MotionEvent);
method public void onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
method public void onInitializeAccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo);
@@ -22168,6 +22172,10 @@ package android.view {
method public abstract boolean onGenericMotion(android.view.View, android.view.MotionEvent);
}
+ public static abstract interface View.OnHoverListener {
+ method public abstract boolean onHover(android.view.View, android.view.MotionEvent);
+ }
+
public static abstract interface View.OnKeyListener {
method public abstract boolean onKey(android.view.View, int, android.view.KeyEvent);
}
@@ -22338,6 +22346,7 @@ package android.view {
method protected void measureChildren(int, int);
method public final void offsetDescendantRectToMyCoords(android.view.View, android.graphics.Rect);
method public final void offsetRectIntoDescendantCoords(android.view.View, android.graphics.Rect);
+ method public boolean onInterceptHoverEvent(android.view.MotionEvent);
method public boolean onInterceptTouchEvent(android.view.MotionEvent);
method protected abstract void onLayout(boolean, int, int, int, int);
method protected boolean onRequestFocusInDescendants(int, android.graphics.Rect);