diff options
| author | Jeff Brown <jeffbrown@google.com> | 2011-03-07 16:56:21 -0800 |
|---|---|---|
| committer | Jeff Brown <jeffbrown@google.com> | 2011-03-24 15:37:04 -0700 |
| commit | a032cc008618b83ecbbede537517d1e7998e3264 (patch) | |
| tree | 735a1f6f5fd7dc5607a0edb18a85abc831e5b7de /api | |
| parent | e9f66af90a886cc55fc20c14375d8572bdf6dbd3 (diff) | |
| download | frameworks_base-a032cc008618b83ecbbede537517d1e7998e3264.zip frameworks_base-a032cc008618b83ecbbede537517d1e7998e3264.tar.gz frameworks_base-a032cc008618b83ecbbede537517d1e7998e3264.tar.bz2 | |
Add MotionEvent.HOVER_ENTER and HOVER_EXIT.
The input dispatcher sends a HOVER_ENTER to a window before dispatching
it any HOVER_MOVE events. For compatibility reasons, the window will
*also* receive the HOVER_MOVE. When the pointer moves into a different
window or the pointer goes down or when events are canceled for some reason,
the input dispatcher sends a HOVER_EXIT to the previously hovered window.
The view hierarchy behavior is similar. All views under the pointer
receive onHoverEvent with HOVER_ENTER followed by any number of HOVER_MOVE
events. When the pointer leaves a view, the view receives HOVER_EXIT.
Similarly, if a parent view decides to capture hover by returning true
from onHoverEvent, the hovered descendants will receive HOVER_EXIT.
The default behavior of onHoverEvent is to update the view's hovered
state by calling setHovered(true/false). Views can query their current
hovered state using isHovered().
For testing purposes, the hovered state is mapped to the pressed
drawable state. This will change in a subsequent commit with the
introduction of a new hovered drawable state.
Change-Id: Ib76a7a90236c8f2c7336e55773acade6346cacbe
Diffstat (limited to 'api')
| -rw-r--r-- | api/current.xml | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/api/current.xml b/api/current.xml index 3305a32..4a619e1 100644 --- a/api/current.xml +++ b/api/current.xml @@ -218638,6 +218638,28 @@ visibility="public" > </field> +<field name="ACTION_HOVER_ENTER" + type="int" + transient="false" + volatile="false" + value="9" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="ACTION_HOVER_EXIT" + type="int" + transient="false" + volatile="false" + value="10" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="ACTION_HOVER_MOVE" type="int" transient="false" @@ -223461,6 +223483,17 @@ visibility="public" > </method> +<method name="isHovered" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> <method name="isInEditMode" return="boolean" abstract="false" @@ -223936,6 +223969,19 @@ <parameter name="event" type="android.view.MotionEvent"> </parameter> </method> +<method name="onHoverEvent" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="event" type="android.view.MotionEvent"> +</parameter> +</method> <method name="onKeyDown" return="boolean" abstract="false" @@ -224976,6 +225022,19 @@ <parameter name="horizontalScrollBarEnabled" type="boolean"> </parameter> </method> +<method name="setHovered" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="hovered" type="boolean"> +</parameter> +</method> <method name="setId" return="void" abstract="false" |
