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

This commit is contained in:
Keisuke Kuroyanagi
2015-05-18 04:57:07 +00:00
committed by Android (Google) Code Review

View File

@@ -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);