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

* commit 'e20b22feb32d82a50a933141ecb8d03457a66f11':
  Fix: Drag handle isn't updated after crossing bidi boundary.
This commit is contained in:
Keisuke Kuroyanagi
2015-05-18 05:08:27 +00:00
committed by Android Git Automerger

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