blob: 81bb638e62fbda971906310fb02a9f34cd211ef8 [file] [log] [blame]
Jeff Brown2352b972011-04-12 22:39:53 -07001/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.view;
18
Jun Mukaid4eaef72015-10-30 15:54:33 -070019import android.annotation.NonNull;
Jun Mukaid4eaef72015-10-30 15:54:33 -070020import android.util.SparseArray;
Jeff Brown2352b972011-04-12 22:39:53 -070021import com.android.internal.util.XmlUtils;
22
Tor Norbye7b9c9122013-05-30 16:48:33 -070023import android.annotation.XmlRes;
Jeff Brown2352b972011-04-12 22:39:53 -070024import android.content.Context;
25import android.content.res.Resources;
26import android.content.res.TypedArray;
27import android.content.res.XmlResourceParser;
28import android.graphics.Bitmap;
Jun Mukai808196f2015-10-28 16:46:44 -070029import android.graphics.drawable.AnimationDrawable;
Jeff Brown2352b972011-04-12 22:39:53 -070030import android.graphics.drawable.BitmapDrawable;
31import android.graphics.drawable.Drawable;
32import android.os.Parcel;
33import android.os.Parcelable;
34import android.util.Log;
35
36/**
37 * Represents an icon that can be used as a mouse pointer.
38 * <p>
39 * Pointer icons can be provided either by the system using system styles,
40 * or by applications using bitmaps or application resources.
41 * </p>
Jeff Brown2352b972011-04-12 22:39:53 -070042 */
43public final class PointerIcon implements Parcelable {
44 private static final String TAG = "PointerIcon";
45
Jun Mukaid4eaef72015-10-30 15:54:33 -070046 /** {@hide} Style constant: Custom icon with a user-supplied bitmap. */
Jeff Brown2352b972011-04-12 22:39:53 -070047 public static final int STYLE_CUSTOM = -1;
48
49 /** Style constant: Null icon. It has no bitmap. */
50 public static final int STYLE_NULL = 0;
51
Jun Mukai1db53972015-09-11 18:08:31 -070052 /** Style constant: no icons are specified. If all views uses this, then falls back
53 * to the default style, but this is helpful to distinguish a view explicitly want
54 * to have the default icon.
Jun Mukaid4eaef72015-10-30 15:54:33 -070055 * @hide
Jun Mukai1db53972015-09-11 18:08:31 -070056 */
57 public static final int STYLE_NOT_SPECIFIED = 1;
58
Jeff Brown2352b972011-04-12 22:39:53 -070059 /** Style constant: Arrow icon. (Default mouse pointer) */
60 public static final int STYLE_ARROW = 1000;
61
62 /** {@hide} Style constant: Spot hover icon for touchpads. */
63 public static final int STYLE_SPOT_HOVER = 2000;
64
65 /** {@hide} Style constant: Spot touch icon for touchpads. */
66 public static final int STYLE_SPOT_TOUCH = 2001;
67
68 /** {@hide} Style constant: Spot anchor icon for touchpads. */
69 public static final int STYLE_SPOT_ANCHOR = 2002;
70
Jun Mukai1db53972015-09-11 18:08:31 -070071 // Style constants for additional predefined icons for mice.
72 /** Style constant: context-menu. */
73 public static final int STYLE_CONTEXT_MENU = 1001;
74
75 /** Style constant: hand. */
76 public static final int STYLE_HAND = 1002;
77
78 /** Style constant: help. */
79 public static final int STYLE_HELP = 1003;
80
81 /** Style constant: wait. */
82 public static final int STYLE_WAIT = 1004;
83
84 /** Style constant: cell. */
85 public static final int STYLE_CELL = 1006;
86
87 /** Style constant: crosshair. */
88 public static final int STYLE_CROSSHAIR = 1007;
89
90 /** Style constant: text. */
91 public static final int STYLE_TEXT = 1008;
92
93 /** Style constant: vertical-text. */
94 public static final int STYLE_VERTICAL_TEXT = 1009;
95
96 /** Style constant: alias (indicating an alias of/shortcut to something is
97 * to be created. */
98 public static final int STYLE_ALIAS = 1010;
99
100 /** Style constant: copy. */
101 public static final int STYLE_COPY = 1011;
102
103 /** Style constant: no-drop. */
104 public static final int STYLE_NO_DROP = 1012;
105
106 /** Style constant: all-scroll. */
107 public static final int STYLE_ALL_SCROLL = 1013;
108
109 /** Style constant: horizontal double arrow mainly for resizing. */
110 public static final int STYLE_HORIZONTAL_DOUBLE_ARROW = 1014;
111
112 /** Style constant: vertical double arrow mainly for resizing. */
113 public static final int STYLE_VERTICAL_DOUBLE_ARROW = 1015;
114
115 /** Style constant: diagonal double arrow -- top-right to bottom-left. */
116 public static final int STYLE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROW = 1016;
117
118 /** Style constant: diagonal double arrow -- top-left to bottom-right. */
119 public static final int STYLE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW = 1017;
120
121 /** Style constant: zoom-in. */
122 public static final int STYLE_ZOOM_IN = 1018;
123
124 /** Style constant: zoom-out. */
125 public static final int STYLE_ZOOM_OUT = 1019;
126
127 /** Style constant: grab. */
128 public static final int STYLE_GRAB = 1020;
129
130 /** Style constant: grabbing. */
131 public static final int STYLE_GRABBING = 1021;
132
Jeff Brown2352b972011-04-12 22:39:53 -0700133 // OEM private styles should be defined starting at this range to avoid
134 // conflicts with any system styles that may be defined in the future.
135 private static final int STYLE_OEM_FIRST = 10000;
136
Jun Mukaid4eaef72015-10-30 15:54:33 -0700137 /** The default pointer icon. */
Jun Mukai1db53972015-09-11 18:08:31 -0700138 public static final int STYLE_DEFAULT = STYLE_ARROW;
Jeff Brown2352b972011-04-12 22:39:53 -0700139
140 private static final PointerIcon gNullIcon = new PointerIcon(STYLE_NULL);
Jun Mukaid4eaef72015-10-30 15:54:33 -0700141 private static final SparseArray<PointerIcon> gSystemIcons = new SparseArray<PointerIcon>();
Jun Mukai1f3dbff2015-12-16 14:41:25 -0800142 private static boolean sUseLargeIcons = false;
Jun Mukaie4e75da2015-12-15 16:19:20 -0800143
Jeff Brown2352b972011-04-12 22:39:53 -0700144 private final int mStyle;
145 private int mSystemIconResourceId;
146 private Bitmap mBitmap;
147 private float mHotSpotX;
148 private float mHotSpotY;
Jun Mukai808196f2015-10-28 16:46:44 -0700149 // The bitmaps for the additional frame of animated pointer icon. Note that the first frame
150 // will be stored in mBitmap.
151 private Bitmap mBitmapFrames[];
152 private int mDurationPerFrame;
Jeff Brown2352b972011-04-12 22:39:53 -0700153
154 private PointerIcon(int style) {
155 mStyle = style;
156 }
157
158 /**
159 * Gets a special pointer icon that has no bitmap.
160 *
161 * @return The null pointer icon.
162 *
163 * @see #STYLE_NULL
Jun Mukaid4eaef72015-10-30 15:54:33 -0700164 * @hide
Jeff Brown2352b972011-04-12 22:39:53 -0700165 */
166 public static PointerIcon getNullIcon() {
167 return gNullIcon;
168 }
169
170 /**
171 * Gets the default pointer icon.
172 *
173 * @param context The context.
174 * @return The default pointer icon.
175 *
176 * @throws IllegalArgumentException if context is null.
Jun Mukaid4eaef72015-10-30 15:54:33 -0700177 * @hide
Jeff Brown2352b972011-04-12 22:39:53 -0700178 */
Jun Mukaid4eaef72015-10-30 15:54:33 -0700179 public static PointerIcon getDefaultIcon(@NonNull Context context) {
Jeff Brown2352b972011-04-12 22:39:53 -0700180 return getSystemIcon(context, STYLE_DEFAULT);
181 }
182
183 /**
184 * Gets a system pointer icon for the given style.
185 * If style is not recognized, returns the default pointer icon.
186 *
187 * @param context The context.
188 * @param style The pointer icon style.
189 * @return The pointer icon.
190 *
191 * @throws IllegalArgumentException if context is null.
192 */
Jun Mukaid4eaef72015-10-30 15:54:33 -0700193 public static PointerIcon getSystemIcon(@NonNull Context context, int style) {
Jeff Brown2352b972011-04-12 22:39:53 -0700194 if (context == null) {
195 throw new IllegalArgumentException("context must not be null");
196 }
197
198 if (style == STYLE_NULL) {
199 return gNullIcon;
200 }
201
Jun Mukaid4eaef72015-10-30 15:54:33 -0700202 PointerIcon icon = gSystemIcons.get(style);
203 if (icon != null) {
204 return icon;
205 }
206
Jeff Brown2352b972011-04-12 22:39:53 -0700207 int styleIndex = getSystemIconStyleIndex(style);
208 if (styleIndex == 0) {
209 styleIndex = getSystemIconStyleIndex(STYLE_DEFAULT);
210 }
211
Jun Mukaie4e75da2015-12-15 16:19:20 -0800212 int defStyle = sUseLargeIcons ?
Jun Mukai19a56012015-11-24 11:25:52 -0800213 com.android.internal.R.style.LargePointer : com.android.internal.R.style.Pointer;
Jeff Brown2352b972011-04-12 22:39:53 -0700214 TypedArray a = context.obtainStyledAttributes(null,
215 com.android.internal.R.styleable.Pointer,
Jun Mukai19a56012015-11-24 11:25:52 -0800216 0, defStyle);
Jeff Brown2352b972011-04-12 22:39:53 -0700217 int resourceId = a.getResourceId(styleIndex, -1);
218 a.recycle();
219
220 if (resourceId == -1) {
221 Log.w(TAG, "Missing theme resources for pointer icon style " + style);
222 return style == STYLE_DEFAULT ? gNullIcon : getSystemIcon(context, STYLE_DEFAULT);
223 }
224
Jun Mukaid4eaef72015-10-30 15:54:33 -0700225 icon = new PointerIcon(style);
Jeff Brown2352b972011-04-12 22:39:53 -0700226 if ((resourceId & 0xff000000) == 0x01000000) {
227 icon.mSystemIconResourceId = resourceId;
228 } else {
Alan Viverette8eea3ea2014-02-03 18:40:20 -0800229 icon.loadResource(context, context.getResources(), resourceId);
Jeff Brown2352b972011-04-12 22:39:53 -0700230 }
Jun Mukaid4eaef72015-10-30 15:54:33 -0700231 gSystemIcons.append(style, icon);
Jeff Brown2352b972011-04-12 22:39:53 -0700232 return icon;
233 }
234
235 /**
Jun Mukai1f3dbff2015-12-16 14:41:25 -0800236 * Updates wheter accessibility large icons are used or not.
237 * @hide
238 */
239 public static void setUseLargeIcons(boolean use) {
240 sUseLargeIcons = use;
241 gSystemIcons.clear();
242 }
243
244 /**
Jeff Brown2352b972011-04-12 22:39:53 -0700245 * Creates a custom pointer from the given bitmap and hotspot information.
246 *
247 * @param bitmap The bitmap for the icon.
Alan Viverette376d10e2014-09-02 10:45:30 -0700248 * @param hotSpotX The X offset of the pointer icon hotspot in the bitmap.
Jeff Brown2352b972011-04-12 22:39:53 -0700249 * Must be within the [0, bitmap.getWidth()) range.
Alan Viverette376d10e2014-09-02 10:45:30 -0700250 * @param hotSpotY The Y offset of the pointer icon hotspot in the bitmap.
Jeff Brown2352b972011-04-12 22:39:53 -0700251 * Must be within the [0, bitmap.getHeight()) range.
252 * @return A pointer icon for this bitmap.
253 *
254 * @throws IllegalArgumentException if bitmap is null, or if the x/y hotspot
255 * parameters are invalid.
256 */
Jun Mukaid4eaef72015-10-30 15:54:33 -0700257 public static PointerIcon createCustomIcon(
258 @NonNull Bitmap bitmap, float hotSpotX, float hotSpotY) {
Jeff Brown2352b972011-04-12 22:39:53 -0700259 if (bitmap == null) {
260 throw new IllegalArgumentException("bitmap must not be null");
261 }
262 validateHotSpot(bitmap, hotSpotX, hotSpotY);
263
264 PointerIcon icon = new PointerIcon(STYLE_CUSTOM);
265 icon.mBitmap = bitmap;
266 icon.mHotSpotX = hotSpotX;
267 icon.mHotSpotY = hotSpotY;
268 return icon;
269 }
270
271 /**
272 * Loads a custom pointer icon from an XML resource.
273 * <p>
274 * The XML resource should have the following form:
275 * <code>
276 * &lt;?xml version="1.0" encoding="utf-8"?&gt;
277 * &lt;pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
278 * android:bitmap="@drawable/my_pointer_bitmap"
279 * android:hotSpotX="24"
280 * android:hotSpotY="24" /&gt;
281 * </code>
282 * </p>
283 *
284 * @param resources The resources object.
285 * @param resourceId The resource id.
286 * @return The pointer icon.
287 *
288 * @throws IllegalArgumentException if resources is null.
289 * @throws Resources.NotFoundException if the resource was not found or the drawable
290 * linked in the resource was not found.
291 */
Jun Mukaid4eaef72015-10-30 15:54:33 -0700292 public static PointerIcon loadCustomIcon(@NonNull Resources resources, @XmlRes int resourceId) {
Jeff Brown2352b972011-04-12 22:39:53 -0700293 if (resources == null) {
294 throw new IllegalArgumentException("resources must not be null");
295 }
296
297 PointerIcon icon = new PointerIcon(STYLE_CUSTOM);
Alan Viverette8eea3ea2014-02-03 18:40:20 -0800298 icon.loadResource(null, resources, resourceId);
Jeff Brown2352b972011-04-12 22:39:53 -0700299 return icon;
300 }
301
302 /**
303 * Loads the bitmap and hotspot information for a pointer icon, if it is not already loaded.
304 * Returns a pointer icon (not necessarily the same instance) with the information filled in.
305 *
306 * @param context The context.
307 * @return The loaded pointer icon.
308 *
309 * @throws IllegalArgumentException if context is null.
Jeff Brown2352b972011-04-12 22:39:53 -0700310 * @hide
311 */
Jun Mukaid4eaef72015-10-30 15:54:33 -0700312 public PointerIcon load(@NonNull Context context) {
Jeff Brown2352b972011-04-12 22:39:53 -0700313 if (context == null) {
314 throw new IllegalArgumentException("context must not be null");
315 }
316
317 if (mSystemIconResourceId == 0 || mBitmap != null) {
318 return this;
319 }
320
321 PointerIcon result = new PointerIcon(mStyle);
322 result.mSystemIconResourceId = mSystemIconResourceId;
Alan Viverette8eea3ea2014-02-03 18:40:20 -0800323 result.loadResource(context, context.getResources(), mSystemIconResourceId);
Jeff Brown2352b972011-04-12 22:39:53 -0700324 return result;
325 }
326
Jun Mukaid4eaef72015-10-30 15:54:33 -0700327 /** @hide */
Jeff Brown2352b972011-04-12 22:39:53 -0700328 public int getStyle() {
329 return mStyle;
330 }
331
Jeff Brown2352b972011-04-12 22:39:53 -0700332 public static final Parcelable.Creator<PointerIcon> CREATOR
333 = new Parcelable.Creator<PointerIcon>() {
334 public PointerIcon createFromParcel(Parcel in) {
335 int style = in.readInt();
336 if (style == STYLE_NULL) {
337 return getNullIcon();
338 }
339
340 int systemIconResourceId = in.readInt();
341 if (systemIconResourceId != 0) {
342 PointerIcon icon = new PointerIcon(style);
343 icon.mSystemIconResourceId = systemIconResourceId;
344 return icon;
345 }
346
347 Bitmap bitmap = Bitmap.CREATOR.createFromParcel(in);
348 float hotSpotX = in.readFloat();
349 float hotSpotY = in.readFloat();
350 return PointerIcon.createCustomIcon(bitmap, hotSpotX, hotSpotY);
351 }
352
353 public PointerIcon[] newArray(int size) {
354 return new PointerIcon[size];
355 }
356 };
357
358 public int describeContents() {
359 return 0;
360 }
361
362 public void writeToParcel(Parcel out, int flags) {
363 out.writeInt(mStyle);
364
365 if (mStyle != STYLE_NULL) {
366 out.writeInt(mSystemIconResourceId);
367 if (mSystemIconResourceId == 0) {
368 mBitmap.writeToParcel(out, flags);
369 out.writeFloat(mHotSpotX);
370 out.writeFloat(mHotSpotY);
371 }
372 }
373 }
374
375 @Override
376 public boolean equals(Object other) {
377 if (this == other) {
378 return true;
379 }
380
381 if (other == null || !(other instanceof PointerIcon)) {
382 return false;
383 }
384
385 PointerIcon otherIcon = (PointerIcon) other;
386 if (mStyle != otherIcon.mStyle
387 || mSystemIconResourceId != otherIcon.mSystemIconResourceId) {
388 return false;
389 }
390
391 if (mSystemIconResourceId == 0 && (mBitmap != otherIcon.mBitmap
392 || mHotSpotX != otherIcon.mHotSpotX
393 || mHotSpotY != otherIcon.mHotSpotY)) {
394 return false;
395 }
396
397 return true;
398 }
399
Tor Norbye7b9c9122013-05-30 16:48:33 -0700400 private void loadResource(Context context, Resources resources, @XmlRes int resourceId) {
Alan Viverette376d10e2014-09-02 10:45:30 -0700401 final XmlResourceParser parser = resources.getXml(resourceId);
Jeff Brown2352b972011-04-12 22:39:53 -0700402 final int bitmapRes;
403 final float hotSpotX;
404 final float hotSpotY;
405 try {
406 XmlUtils.beginDocument(parser, "pointer-icon");
407
Alan Viverette376d10e2014-09-02 10:45:30 -0700408 final TypedArray a = resources.obtainAttributes(
Jeff Brown2352b972011-04-12 22:39:53 -0700409 parser, com.android.internal.R.styleable.PointerIcon);
410 bitmapRes = a.getResourceId(com.android.internal.R.styleable.PointerIcon_bitmap, 0);
Alan Viverette376d10e2014-09-02 10:45:30 -0700411 hotSpotX = a.getDimension(com.android.internal.R.styleable.PointerIcon_hotSpotX, 0);
412 hotSpotY = a.getDimension(com.android.internal.R.styleable.PointerIcon_hotSpotY, 0);
Jeff Brown2352b972011-04-12 22:39:53 -0700413 a.recycle();
414 } catch (Exception ex) {
415 throw new IllegalArgumentException("Exception parsing pointer icon resource.", ex);
416 } finally {
417 parser.close();
418 }
419
420 if (bitmapRes == 0) {
421 throw new IllegalArgumentException("<pointer-icon> is missing bitmap attribute.");
422 }
423
Alan Viverette8eea3ea2014-02-03 18:40:20 -0800424 Drawable drawable;
425 if (context == null) {
426 drawable = resources.getDrawable(bitmapRes);
427 } else {
428 drawable = context.getDrawable(bitmapRes);
429 }
Jun Mukai808196f2015-10-28 16:46:44 -0700430 if (drawable instanceof AnimationDrawable) {
431 // Extract animation frame bitmaps.
432 final AnimationDrawable animationDrawable = (AnimationDrawable) drawable;
433 final int frames = animationDrawable.getNumberOfFrames();
434 drawable = animationDrawable.getFrame(0);
435 if (frames == 1) {
436 Log.w(TAG, "Animation icon with single frame -- simply treating the first "
437 + "frame as a normal bitmap icon.");
438 } else {
439 // Assumes they have the exact duration.
440 mDurationPerFrame = animationDrawable.getDuration(0);
441 mBitmapFrames = new Bitmap[frames - 1];
442 final int width = drawable.getIntrinsicWidth();
443 final int height = drawable.getIntrinsicHeight();
444 for (int i = 1; i < frames; ++i) {
445 Drawable drawableFrame = animationDrawable.getFrame(i);
446 if (!(drawableFrame instanceof BitmapDrawable)) {
447 throw new IllegalArgumentException("Frame of an animated pointer icon "
448 + "must refer to a bitmap drawable.");
449 }
450 if (drawableFrame.getIntrinsicWidth() != width ||
451 drawableFrame.getIntrinsicHeight() != height) {
452 throw new IllegalArgumentException("The bitmap size of " + i + "-th frame "
453 + "is different. All frames should have the exact same size and "
454 + "share the same hotspot.");
455 }
456 mBitmapFrames[i - 1] = ((BitmapDrawable)drawableFrame).getBitmap();
457 }
458 }
459 }
Jeff Brown2352b972011-04-12 22:39:53 -0700460 if (!(drawable instanceof BitmapDrawable)) {
461 throw new IllegalArgumentException("<pointer-icon> bitmap attribute must "
462 + "refer to a bitmap drawable.");
463 }
464
465 // Set the properties now that we have successfully loaded the icon.
466 mBitmap = ((BitmapDrawable)drawable).getBitmap();
467 mHotSpotX = hotSpotX;
468 mHotSpotY = hotSpotY;
469 }
470
471 private static void validateHotSpot(Bitmap bitmap, float hotSpotX, float hotSpotY) {
472 if (hotSpotX < 0 || hotSpotX >= bitmap.getWidth()) {
473 throw new IllegalArgumentException("x hotspot lies outside of the bitmap area");
474 }
475 if (hotSpotY < 0 || hotSpotY >= bitmap.getHeight()) {
476 throw new IllegalArgumentException("y hotspot lies outside of the bitmap area");
477 }
478 }
479
480 private static int getSystemIconStyleIndex(int style) {
481 switch (style) {
482 case STYLE_ARROW:
483 return com.android.internal.R.styleable.Pointer_pointerIconArrow;
484 case STYLE_SPOT_HOVER:
485 return com.android.internal.R.styleable.Pointer_pointerIconSpotHover;
486 case STYLE_SPOT_TOUCH:
487 return com.android.internal.R.styleable.Pointer_pointerIconSpotTouch;
488 case STYLE_SPOT_ANCHOR:
489 return com.android.internal.R.styleable.Pointer_pointerIconSpotAnchor;
Jun Mukai1db53972015-09-11 18:08:31 -0700490 case STYLE_HAND:
491 return com.android.internal.R.styleable.Pointer_pointerIconHand;
492 case STYLE_CONTEXT_MENU:
493 return com.android.internal.R.styleable.Pointer_pointerIconContextMenu;
494 case STYLE_HELP:
495 return com.android.internal.R.styleable.Pointer_pointerIconHelp;
496 case STYLE_WAIT:
Jun Mukai808196f2015-10-28 16:46:44 -0700497 return com.android.internal.R.styleable.Pointer_pointerIconWait;
Jun Mukai1db53972015-09-11 18:08:31 -0700498 case STYLE_CELL:
499 return com.android.internal.R.styleable.Pointer_pointerIconCell;
500 case STYLE_CROSSHAIR:
501 return com.android.internal.R.styleable.Pointer_pointerIconCrosshair;
502 case STYLE_TEXT:
503 return com.android.internal.R.styleable.Pointer_pointerIconText;
504 case STYLE_VERTICAL_TEXT:
505 return com.android.internal.R.styleable.Pointer_pointerIconVerticalText;
506 case STYLE_ALIAS:
507 return com.android.internal.R.styleable.Pointer_pointerIconAlias;
508 case STYLE_COPY:
509 return com.android.internal.R.styleable.Pointer_pointerIconCopy;
510 case STYLE_ALL_SCROLL:
511 return com.android.internal.R.styleable.Pointer_pointerIconAllScroll;
512 case STYLE_NO_DROP:
513 return com.android.internal.R.styleable.Pointer_pointerIconNodrop;
514 case STYLE_HORIZONTAL_DOUBLE_ARROW:
515 return com.android.internal.R.styleable.Pointer_pointerIconHorizontalDoubleArrow;
516 case STYLE_VERTICAL_DOUBLE_ARROW:
517 return com.android.internal.R.styleable.Pointer_pointerIconVerticalDoubleArrow;
518 case STYLE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROW:
519 return com.android.internal.R.styleable.
520 Pointer_pointerIconTopRightDiagonalDoubleArrow;
521 case STYLE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW:
522 return com.android.internal.R.styleable.
523 Pointer_pointerIconTopLeftDiagonalDoubleArrow;
524 case STYLE_ZOOM_IN:
525 return com.android.internal.R.styleable.Pointer_pointerIconZoomIn;
526 case STYLE_ZOOM_OUT:
527 return com.android.internal.R.styleable.Pointer_pointerIconZoomOut;
528 case STYLE_GRAB:
529 return com.android.internal.R.styleable.Pointer_pointerIconGrab;
530 case STYLE_GRABBING:
531 return com.android.internal.R.styleable.Pointer_pointerIconGrabbing;
Jeff Brown2352b972011-04-12 22:39:53 -0700532 default:
533 return 0;
534 }
535 }
536}