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

Commit b5703105 authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi Committed by Android (Google) Code Review
Browse files

Merge "Change cursor shape to STYLE_HAND on ClickableSpans"

parents 0bc4c58f 366a8860
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -5957,6 +5957,14 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener


    @Override
    @Override
    public PointerIcon getPointerIcon(MotionEvent event, float x, float y) {
    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()) {
        if (isTextSelectable() || isTextEditable()) {
            return PointerIcon.getSystemIcon(mContext, PointerIcon.STYLE_TEXT);
            return PointerIcon.getSystemIcon(mContext, PointerIcon.STYLE_TEXT);
        }
        }