Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c33d8d49 authored by PY Laligand's avatar PY Laligand Committed by Jeff Brown
Browse files

Added a hovered state for drawables.

Change-Id: I2b12c8593e04e37c8eb748946ca6d4d7a61de36a
parent a032cc00
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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"
+3 −1
Original line number Diff line number Diff line
@@ -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 {
@@ -10018,7 +10020,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];

+5 −0
Original line number Diff line number Diff line
@@ -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">
+7 −0
Original line number Diff line number Diff line
@@ -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>