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

Commit 33f81ac1 authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi
Browse files

Fix: Drag handle isn't updated after crossing bidi boundary.

mDrawable is updated, but it was not re-drawn properly.
postInvalidate() should be called when the drawable is
updated.

Bug: 21141841
Change-Id: Icb3ddf18d05285ffa8758a9be256482d594ab8ed
parent aee0c2ce
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);