diff options
-rw-r--r-- | api/current.xml | 11 | ||||
-rw-r--r-- | core/java/android/view/View.java | 4 | ||||
-rwxr-xr-x | core/res/res/values/attrs.xml | 5 | ||||
-rw-r--r-- | core/res/res/values/public.xml | 7 |
4 files changed, 26 insertions, 1 deletions
diff --git a/api/current.xml b/api/current.xml index b613fea..df2c756 100644 --- a/api/current.xml +++ b/api/current.xml @@ -9068,6 +9068,17 @@ visibility="public" > </field> +<field name="state_hovered" + type="int" + transient="false" + volatile="false" + value="16843620" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="state_last" type="int" transient="false" diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index bdf9ed9..96cddfa 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -1304,6 +1304,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility static final int VIEW_STATE_PRESSED = 1 << 4; static final int VIEW_STATE_ACTIVATED = 1 << 5; static final int VIEW_STATE_ACCELERATED = 1 << 6; + static final int VIEW_STATE_HOVERED = 1 << 7; static final int[] VIEW_STATE_IDS = new int[] { R.attr.state_window_focused, VIEW_STATE_WINDOW_FOCUSED, @@ -1313,6 +1314,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility R.attr.state_pressed, VIEW_STATE_PRESSED, R.attr.state_activated, VIEW_STATE_ACTIVATED, R.attr.state_accelerated, VIEW_STATE_ACCELERATED, + R.attr.state_hovered, VIEW_STATE_HOVERED, }; static { @@ -10031,7 +10033,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility // windows to better match their app. viewStateIndex |= VIEW_STATE_ACCELERATED; } - if ((privateFlags & HOVERED) != 0) viewStateIndex |= VIEW_STATE_PRESSED; // temporary + if ((privateFlags & HOVERED) != 0) viewStateIndex |= VIEW_STATE_HOVERED; drawableState = VIEW_STATE_SETS[viewStateIndex]; diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index c81f8c0..e2c440a 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -3817,6 +3817,7 @@ <li>"state_rect" <li>"state_grow" <li>"state_move" + <li>"state_hovered" </ul> --> <declare-styleable name="DrawableStates"> <!-- State value for {@link android.graphics.drawable.StateListDrawable StateListDrawable}, @@ -3866,6 +3867,9 @@ ignored even if it specifies a solid color, since that optimization is not needed. --> <attr name="state_accelerated" format="boolean" /> + <!-- State value for {@link android.graphics.drawable.StateListDrawable StateListDrawable}, + set when a pointer is hovering over the view. --> + <attr name="state_hovered" format="boolean" /> </declare-styleable> <declare-styleable name="ViewDrawableStates"> <attr name="state_pressed" /> @@ -3875,6 +3879,7 @@ <attr name="state_enabled" /> <attr name="state_activated" /> <attr name="state_accelerated" /> + <attr name="state_hovered" /> </declare-styleable> <!-- State array representing a menu item that is currently checked. --> <declare-styleable name="MenuItemCheckedState"> diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index f1ec398..5432212 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1648,4 +1648,11 @@ <eat-comment /> <public type="attr" name="textCursorDrawable" id="0x01010362" /> <public type="attr" name="resizeMode" /> + +<!-- =============================================================== + Resources added in version 13 of the platform (Ice Cream Sandwich) + =============================================================== --> + <eat-comment /> + <public type="attr" name="state_hovered" /> + </resources> |