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

Commit 9511b41e authored by Gilles Debunne's avatar Gilles Debunne
Browse files

Made getOffsetForPosition public in TextView.

Bug 4443839

Change-Id: I3e5d6f0fe3a45b068166f682daf3c4163903306e
parent 3bca69b0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -25207,6 +25207,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
@@ -9689,14 +9689,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;