diff options
| author | Alan Viverette <alanv@google.com> | 2014-09-02 10:45:30 -0700 |
|---|---|---|
| committer | Alan Viverette <alanv@google.com> | 2014-09-02 10:45:30 -0700 |
| commit | 376d10e99e7db597fdff8a4e8f396161017c243c (patch) | |
| tree | 30fe16261fee809197f21e50dd9d2d35920b2d40 /core/java/android/view/PointerIcon.java | |
| parent | bd6937841983230bd65dc08548367caa7d409238 (diff) | |
Update pointer hotspots to scale for DPI
Also updates the bitmap resources, which weren't scaled correctly
for their respective DPI buckets.
BUG: 16459309
Change-Id: Iedc781e2ee47a8b960390fea718cb08bcfb84ae3
Diffstat (limited to 'core/java/android/view/PointerIcon.java')
| -rw-r--r-- | core/java/android/view/PointerIcon.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/java/android/view/PointerIcon.java b/core/java/android/view/PointerIcon.java index 063a08d1397f..7dcad6861669 100644 --- a/core/java/android/view/PointerIcon.java +++ b/core/java/android/view/PointerIcon.java @@ -149,9 +149,9 @@ public final class PointerIcon implements Parcelable { * Creates a custom pointer from the given bitmap and hotspot information. * * @param bitmap The bitmap for the icon. - * @param hotspotX The X offset of the pointer icon hotspot in the bitmap. + * @param hotSpotX The X offset of the pointer icon hotspot in the bitmap. * Must be within the [0, bitmap.getWidth()) range. - * @param hotspotY The Y offset of the pointer icon hotspot in the bitmap. + * @param hotSpotY The Y offset of the pointer icon hotspot in the bitmap. * Must be within the [0, bitmap.getHeight()) range. * @return A pointer icon for this bitmap. * @@ -374,18 +374,18 @@ public final class PointerIcon implements Parcelable { } private void loadResource(Context context, Resources resources, int resourceId) { - XmlResourceParser parser = resources.getXml(resourceId); + final XmlResourceParser parser = resources.getXml(resourceId); final int bitmapRes; final float hotSpotX; final float hotSpotY; try { XmlUtils.beginDocument(parser, "pointer-icon"); - TypedArray a = resources.obtainAttributes( + final TypedArray a = resources.obtainAttributes( parser, com.android.internal.R.styleable.PointerIcon); bitmapRes = a.getResourceId(com.android.internal.R.styleable.PointerIcon_bitmap, 0); - hotSpotX = a.getFloat(com.android.internal.R.styleable.PointerIcon_hotSpotX, 0); - hotSpotY = a.getFloat(com.android.internal.R.styleable.PointerIcon_hotSpotY, 0); + hotSpotX = a.getDimension(com.android.internal.R.styleable.PointerIcon_hotSpotX, 0); + hotSpotY = a.getDimension(com.android.internal.R.styleable.PointerIcon_hotSpotY, 0); a.recycle(); } catch (Exception ex) { throw new IllegalArgumentException("Exception parsing pointer icon resource.", ex); |
