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

Commit 366a8860 authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi
Browse files

Change cursor shape to STYLE_HAND on ClickableSpans

Bug: 19544351
Change-Id: Ibbee410bf22db6962b2ba2b89111c9e34fce4747
parent 9dcbdcd5
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -5957,6 +5957,14 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener

    @Override
    public PointerIcon getPointerIcon(MotionEvent event, float x, float y) {
        if (mText instanceof Spannable && mLinksClickable) {
            final int offset = getOffsetForPosition(x, y);
            final ClickableSpan[] clickables = ((Spannable) mText).getSpans(offset, offset,
                    ClickableSpan.class);
            if (clickables.length > 0) {
                return PointerIcon.getSystemIcon(mContext, PointerIcon.STYLE_HAND);
            }
        }
        if (isTextSelectable() || isTextEditable()) {
            return PointerIcon.getSystemIcon(mContext, PointerIcon.STYLE_TEXT);
        }