diff options
author | 2015-12-14 21:34:28 +0000 | |
---|---|---|
committer | 2015-12-14 21:34:28 +0000 | |
commit | 77673225655a4a17be1810aae9a9136a7947f30c (patch) | |
tree | 460545ff2ccfe44969728aac5b441c2e2a67f3ea | |
parent | 9b041747d164719dad8c79463b68a97fba751f67 (diff) | |
parent | 80fdc1bd366efb8e9a84244c9e9d31477d84d515 (diff) |
Merge "Allow specifying pointer shape from xml resource."
-rw-r--r-- | api/current.txt | 1 | ||||
-rw-r--r-- | api/system-current.txt | 1 | ||||
-rw-r--r-- | api/test-current.txt | 1 | ||||
-rw-r--r-- | core/java/android/view/View.java | 6 | ||||
-rw-r--r-- | core/res/res/values/attrs.xml | 50 | ||||
-rw-r--r-- | core/res/res/values/public.xml | 1 |
6 files changed, 60 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt index d17f4b64d264..f5ccf0e10743 100644 --- a/api/current.txt +++ b/api/current.txt @@ -925,6 +925,7 @@ package android { field public static final deprecated int phoneNumber = 16843111; // 0x1010167 field public static final int pivotX = 16843189; // 0x10101b5 field public static final int pivotY = 16843190; // 0x10101b6 + field public static final int pointerShape = 16844042; // 0x101050a field public static final int popupAnimationStyle = 16843465; // 0x10102c9 field public static final int popupBackground = 16843126; // 0x1010176 field public static final int popupCharacters = 16843332; // 0x1010244 diff --git a/api/system-current.txt b/api/system-current.txt index 492d6a923f51..bc63b4871a20 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -1019,6 +1019,7 @@ package android { field public static final deprecated int phoneNumber = 16843111; // 0x1010167 field public static final int pivotX = 16843189; // 0x10101b5 field public static final int pivotY = 16843190; // 0x10101b6 + field public static final int pointerShape = 16844042; // 0x101050a field public static final int popupAnimationStyle = 16843465; // 0x10102c9 field public static final int popupBackground = 16843126; // 0x1010176 field public static final int popupCharacters = 16843332; // 0x1010244 diff --git a/api/test-current.txt b/api/test-current.txt index 680f7835b204..a2220374936f 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -925,6 +925,7 @@ package android { field public static final deprecated int phoneNumber = 16843111; // 0x1010167 field public static final int pivotX = 16843189; // 0x10101b5 field public static final int pivotY = 16843190; // 0x10101b6 + field public static final int pointerShape = 16844042; // 0x101050a field public static final int popupAnimationStyle = 16843465; // 0x10102c9 field public static final int popupBackground = 16843126; // 0x1010176 field public static final int popupCharacters = 16843332; // 0x1010244 diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 183ccf3f63a9..3db18066c296 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -4487,6 +4487,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, initializeScrollIndicators = true; } break; + case R.styleable.View_pointerShape: + final int pointerShape = a.getInt(attr, PointerIcon.STYLE_NOT_SPECIFIED); + if (pointerShape != PointerIcon.STYLE_NOT_SPECIFIED) { + setPointerShape(pointerShape); + } + break; } } diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 786554cc41ba..9f135651cb67 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -2791,6 +2791,56 @@ i <flag name="end" value="0x20" /> </attr> + <attr name="pointerShape"> + <!-- Null icon, pointer becomes invisible. --> + <enum name="none" value="0" /> + <!-- The default icon of arrow pointer. --> + <enum name="arrow" value="1000" /> + <!-- Pointer icon indicating context-menu will appear. --> + <enum name="context_menu" value="1001" /> + <!-- Pointer icon of a hand with the index finger. --> + <enum name="hand" value="1002" /> + <!-- Pointer icon indicating help. --> + <enum name="help" value="1003" /> + <!-- Pointer icon indicating something is going on and waiting. --> + <enum name="wait" value="1004" /> + <!-- Pointer icon for cell and grid. --> + <enum name="cell" value="1006" /> + <!-- Pointer icon of crosshair, indicating to spot a location. --> + <enum name="crosshair" value="1007" /> + <!-- Pointer icon of I-beam, usually for text. --> + <enum name="text" value="1008" /> + <!-- Pointer icon of I-beam with 90-degree rotated, for vertical text. --> + <enum name="vertical_text" value="1009" /> + <!-- Pointer icon of 'alias', indicating an alias of/shortcut to something is to be + created. --> + <enum name="alias" value="1010" /> + <!-- Pointer icon of 'copy', used for drag/drop. --> + <enum name="copy" value="1011" /> + <!-- Pointer icon of 'no-drop', indicating the drop will not be accepted at the + current location. --> + <enum name="no_drop" value="1012" /> + <!-- Pointer icon of four-way arrows, indicating scrolling all direction. --> + <enum name="all_scroll" value="1013" /> + <!-- Pointer icon of horizontal double arrow, indicating horizontal resize. --> + <enum name="horizontal_double_arrow" value="1014" /> + <!-- Pointer icon of vertical double arrow, indicating vertical resize. --> + <enum name="vertical_double_arrow" value="1015" /> + <!-- Pointer icon of diagonal double arrow, starting from top-right to bottom-left. + Indicating freeform resize. --> + <enum name="top_right_diagonal_double_arrow" value="1016" /> + <!-- Pointer icon of diagonal double arrow, starting from top-left to bottom-right. + Indicating freeform resize. --> + <enum name="top_left_diagonal_double_arrow" value="1017" /> + <!-- Pointer icon indicating zoom-in. --> + <enum name="zoom_in" value="1018" /> + <!-- Pointer icon indicating zoom-out. --> + <enum name="zoom_out" value="1019" /> + <!-- Pointer icon of a hand sign to grab something. --> + <enum name="grab" value="1020" /> + <!-- Pointer icon of a hand sign while grabbing something. --> + <enum name="grabbing" value="1021" /> + </attr> </declare-styleable> <!-- Attributes that can be assigned to a tag for a particular View. --> diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index addeb05f86f2..ad36f3c107bc 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -2684,6 +2684,7 @@ <public type="attr" name="preferenceFragmentStyle" /> <public type="attr" name="canControlMagnification" /> <public type="attr" name="languageTag" /> + <public type="attr" name="pointerShape" /> <public type="style" name="Theme.Material.DayNight" /> <public type="style" name="Theme.Material.DayNight.DarkActionBar" /> |