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

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

Merge "Fix: Drag handle isn't updated after crossing bidi boundary." into mnc-dev

parents 19877fa5 33f81ac1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3426,9 +3426,13 @@ public class Editor {
        protected void updateDrawable() {
            final int offset = getCurrentCursorOffset();
            final boolean isRtlCharAtOffset = mTextView.getLayout().isRtlCharAt(offset);
            final Drawable oldDrawable = mDrawable;
            mDrawable = isRtlCharAtOffset ? mDrawableRtl : mDrawableLtr;
            mHotspotX = getHotspotX(mDrawable, isRtlCharAtOffset);
            mHorizontalGravity = getHorizontalGravity(isRtlCharAtOffset);
            if (oldDrawable != mDrawable) {
                postInvalidate();
            }
        }

        protected abstract int getHotspotX(Drawable drawable, boolean isRtlRun);