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

Commit 970ce730 authored by Gilles Debunne's avatar Gilles Debunne Committed by Android (Google) Code Review
Browse files

Merge "Made getOffsetForPosition public in TextView."

parents bd4d5826 9511b41e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -25208,6 +25208,7 @@ package android.widget {
    method public final android.content.res.ColorStateList getLinkTextColors();
    method public final boolean getLinksClickable();
    method public final android.text.method.MovementMethod getMovementMethod();
    method public int getOffsetForPosition(float, float);
    method public android.text.TextPaint getPaint();
    method public int getPaintFlags();
    method public java.lang.String getPrivateImeOptions();
+2 −3
Original line number Diff line number Diff line
@@ -9721,14 +9721,13 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    }

    /**
     * Get the offset character closest to the specified absolute position.
     * Get the character offset closest to the specified absolute position. A typical use case is to
     * pass the result of {@link MotionEvent#getX()} and {@link MotionEvent#getY()} to this method.
     *
     * @param x The horizontal absolute position of a point on screen
     * @param y The vertical absolute position of a point on screen
     * @return the character offset for the character whose position is closest to the specified
     *  position. Returns -1 if there is no layout.
     *
     * @hide
     */
    public int getOffsetForPosition(float x, float y) {
        if (getLayout() == null) return -1;