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

Commit 1ad6ec20 authored by Vladislav Kaznacheev's avatar Vladislav Kaznacheev
Browse files

Support resource references in pointerShape attributes.

Previously pointerShape value could only be one of the
system pointer shape names (such as "hand" or "arrow").

This CL introduces support for such syntax as:
android:pointerShape="@drawable/custom_pointer_icon"

Change-Id: Ic5276da66367fbfb8e6195434421bac0667198c1
parent 383b7aa0
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -4506,10 +4506,16 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                    }
                    break;
                case R.styleable.View_pointerShape:
                    final int resourceId = a.getResourceId(attr, 0);
                    if (resourceId != 0) {
                        setPointerIcon(PointerIcon.loadCustomIcon(
                                context.getResources(), resourceId));
                    } else {
                        final int pointerShape = a.getInt(attr, PointerIcon.STYLE_NOT_SPECIFIED);
                        if (pointerShape != PointerIcon.STYLE_NOT_SPECIFIED) {
                            setPointerIcon(PointerIcon.getSystemIcon(context, pointerShape));
                        }
                    }
                    break;
            }
        }