summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2015-05-14 20:10:57 +0900
committerKeisuke Kuroyanagi <ksk@google.com>2015-05-18 13:56:06 +0900
commit33f81ac108bd4d0ec709107e5ba1748221fc39e8 (patch)
tree9b432eddd8fcd8895e9749cbaeab35362aaf6fad
parentaee0c2ce39fe92716bb76d33d6f8cc8789467cf6 (diff)
downloadframeworks_base-33f81ac108bd4d0ec709107e5ba1748221fc39e8.zip
frameworks_base-33f81ac108bd4d0ec709107e5ba1748221fc39e8.tar.gz
frameworks_base-33f81ac108bd4d0ec709107e5ba1748221fc39e8.tar.bz2
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
-rw-r--r--core/java/android/widget/Editor.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java
index a1194f7..3edac3b 100644
--- a/core/java/android/widget/Editor.java
+++ b/core/java/android/widget/Editor.java
@@ -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);