summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2011-03-24 16:42:08 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-03-24 16:42:08 -0700
commitdff626c56ac42bdcc7af5a300eefccd3fee3d166 (patch)
treea7fe9a7d982cc8a2796b133a3eb748a6ac86e2c7 /core
parentad575f4dda3391baf9fcab927e65afbee32e7b95 (diff)
parentc33d8d49e44358d72f19e7f7730c03d3902fa1f2 (diff)
downloadframeworks_base-dff626c56ac42bdcc7af5a300eefccd3fee3d166.zip
frameworks_base-dff626c56ac42bdcc7af5a300eefccd3fee3d166.tar.gz
frameworks_base-dff626c56ac42bdcc7af5a300eefccd3fee3d166.tar.bz2
Merge "Added a hovered state for drawables."
Diffstat (limited to 'core')
-rw-r--r--core/java/android/view/View.java4
-rwxr-xr-xcore/res/res/values/attrs.xml5
-rw-r--r--core/res/res/values/public.xml7
3 files changed, 15 insertions, 1 deletions
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>