Loading api/current.txt +7 −0 Original line number Original line Diff line number Diff line Loading @@ -14022,6 +14022,8 @@ package android.graphics { method public void getTextPath(char[], int, int, float, float, android.graphics.Path); method public void getTextPath(char[], int, int, float, float, android.graphics.Path); method public void getTextPath(java.lang.String, int, int, float, float, android.graphics.Path); method public void getTextPath(java.lang.String, int, int, float, float, android.graphics.Path); method public float getTextRunAdvances(char[], int, int, int, int, boolean, float[], int); method public float getTextRunAdvances(char[], int, int, int, int, boolean, float[], int); method public int getTextRunCursor(char[], int, int, boolean, int, int); method public int getTextRunCursor(java.lang.CharSequence, int, int, boolean, int, int); method public float getTextScaleX(); method public float getTextScaleX(); method public float getTextSize(); method public float getTextSize(); method public float getTextSkewX(); method public float getTextSkewX(); Loading Loading @@ -14088,6 +14090,11 @@ package android.graphics { method public void setWordSpacing(float); method public void setWordSpacing(float); method public android.graphics.Xfermode setXfermode(android.graphics.Xfermode); method public android.graphics.Xfermode setXfermode(android.graphics.Xfermode); field public static final int ANTI_ALIAS_FLAG = 1; // 0x1 field public static final int ANTI_ALIAS_FLAG = 1; // 0x1 field public static final int CURSOR_AFTER = 0; // 0x0 field public static final int CURSOR_AT = 4; // 0x4 field public static final int CURSOR_AT_OR_AFTER = 1; // 0x1 field public static final int CURSOR_AT_OR_BEFORE = 3; // 0x3 field public static final int CURSOR_BEFORE = 2; // 0x2 field public static final int DEV_KERN_TEXT_FLAG = 256; // 0x100 field public static final int DEV_KERN_TEXT_FLAG = 256; // 0x100 field public static final int DITHER_FLAG = 4; // 0x4 field public static final int DITHER_FLAG = 4; // 0x4 field public static final int EMBEDDED_BITMAP_TEXT_FLAG = 1024; // 0x400 field public static final int EMBEDDED_BITMAP_TEXT_FLAG = 1024; // 0x400 core/java/android/text/GraphicsOperations.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -58,6 +58,6 @@ public interface GraphicsOperations extends CharSequence { /** /** * Just like {@link Paint#getTextRunCursor}. * Just like {@link Paint#getTextRunCursor}. */ */ int getTextRunCursor(int contextStart, int contextEnd, int dir, int offset, int getTextRunCursor(int contextStart, int contextEnd, boolean isRtl, int offset, int cursorOpt, Paint p); int cursorOpt, Paint p); } } core/java/android/text/SpannableStringBuilder.java +11 −4 Original line number Original line Diff line number Diff line Loading @@ -1551,7 +1551,7 @@ public class SpannableStringBuilder implements CharSequence, GetChars, Spannable * * * @param contextStart the start index of the context * @param contextStart the start index of the context * @param contextEnd the (non-inclusive) end index of the context * @param contextEnd the (non-inclusive) end index of the context * @param dir either DIRECTION_RTL or DIRECTION_LTR * @param dir 1 if the run is RTL, otherwise 0 * @param offset the cursor position to move from * @param offset the cursor position to move from * @param cursorOpt how to move the cursor, one of CURSOR_AFTER, * @param cursorOpt how to move the cursor, one of CURSOR_AFTER, * CURSOR_AT_OR_AFTER, CURSOR_BEFORE, * CURSOR_AT_OR_AFTER, CURSOR_BEFORE, Loading @@ -1563,21 +1563,28 @@ public class SpannableStringBuilder implements CharSequence, GetChars, Spannable @Deprecated @Deprecated public int getTextRunCursor(int contextStart, int contextEnd, int dir, int offset, public int getTextRunCursor(int contextStart, int contextEnd, int dir, int offset, int cursorOpt, Paint p) { int cursorOpt, Paint p) { return getTextRunCursor(contextStart, contextEnd, dir == 1, offset, cursorOpt, p); } /** @hide */ @Override public int getTextRunCursor(int contextStart, int contextEnd, boolean isRtl, int offset, int cursorOpt, Paint p) { int ret; int ret; int contextLen = contextEnd - contextStart; int contextLen = contextEnd - contextStart; if (contextEnd <= mGapStart) { if (contextEnd <= mGapStart) { ret = p.getTextRunCursor(mText, contextStart, contextLen, ret = p.getTextRunCursor(mText, contextStart, contextLen, dir, offset, cursorOpt); isRtl, offset, cursorOpt); } else if (contextStart >= mGapStart) { } else if (contextStart >= mGapStart) { ret = p.getTextRunCursor(mText, contextStart + mGapLength, contextLen, ret = p.getTextRunCursor(mText, contextStart + mGapLength, contextLen, dir, offset + mGapLength, cursorOpt) - mGapLength; isRtl, offset + mGapLength, cursorOpt) - mGapLength; } else { } else { char[] buf = TextUtils.obtain(contextLen); char[] buf = TextUtils.obtain(contextLen); getChars(contextStart, contextEnd, buf, 0); getChars(contextStart, contextEnd, buf, 0); ret = p.getTextRunCursor(buf, 0, contextLen, ret = p.getTextRunCursor(buf, 0, contextLen, dir, offset - contextStart, cursorOpt) + contextStart; isRtl, offset - contextStart, cursorOpt) + contextStart; TextUtils.recycle(buf); TextUtils.recycle(buf); } } Loading core/java/android/text/TextLine.java +2 −3 Original line number Original line Diff line number Diff line Loading @@ -802,14 +802,13 @@ public class TextLine { } } } } int dir = runIsRtl ? Paint.DIRECTION_RTL : Paint.DIRECTION_LTR; int cursorOpt = after ? Paint.CURSOR_AFTER : Paint.CURSOR_BEFORE; int cursorOpt = after ? Paint.CURSOR_AFTER : Paint.CURSOR_BEFORE; if (mCharsValid) { if (mCharsValid) { return wp.getTextRunCursor(mChars, spanStart, spanLimit - spanStart, return wp.getTextRunCursor(mChars, spanStart, spanLimit - spanStart, dir, offset, cursorOpt); runIsRtl, offset, cursorOpt); } else { } else { return wp.getTextRunCursor(mText, mStart + spanStart, return wp.getTextRunCursor(mText, mStart + spanStart, mStart + spanLimit, dir, mStart + offset, cursorOpt) - mStart; mStart + spanLimit, runIsRtl, mStart + offset, cursorOpt) - mStart; } } } } Loading core/java/android/text/method/BaseKeyListener.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -310,7 +310,7 @@ public abstract class BaseKeyListener extends MetaKeyKeyListener return len; return len; } } offset = paint.getTextRunCursor(text, offset, len, Paint.DIRECTION_LTR /* not used */, offset = paint.getTextRunCursor(text, offset, len, false /* LTR, not used */, offset, Paint.CURSOR_AFTER); offset, Paint.CURSOR_AFTER); return adjustReplacementSpan(text, offset, false /* move to the end */); return adjustReplacementSpan(text, offset, false /* move to the end */); Loading Loading
api/current.txt +7 −0 Original line number Original line Diff line number Diff line Loading @@ -14022,6 +14022,8 @@ package android.graphics { method public void getTextPath(char[], int, int, float, float, android.graphics.Path); method public void getTextPath(char[], int, int, float, float, android.graphics.Path); method public void getTextPath(java.lang.String, int, int, float, float, android.graphics.Path); method public void getTextPath(java.lang.String, int, int, float, float, android.graphics.Path); method public float getTextRunAdvances(char[], int, int, int, int, boolean, float[], int); method public float getTextRunAdvances(char[], int, int, int, int, boolean, float[], int); method public int getTextRunCursor(char[], int, int, boolean, int, int); method public int getTextRunCursor(java.lang.CharSequence, int, int, boolean, int, int); method public float getTextScaleX(); method public float getTextScaleX(); method public float getTextSize(); method public float getTextSize(); method public float getTextSkewX(); method public float getTextSkewX(); Loading Loading @@ -14088,6 +14090,11 @@ package android.graphics { method public void setWordSpacing(float); method public void setWordSpacing(float); method public android.graphics.Xfermode setXfermode(android.graphics.Xfermode); method public android.graphics.Xfermode setXfermode(android.graphics.Xfermode); field public static final int ANTI_ALIAS_FLAG = 1; // 0x1 field public static final int ANTI_ALIAS_FLAG = 1; // 0x1 field public static final int CURSOR_AFTER = 0; // 0x0 field public static final int CURSOR_AT = 4; // 0x4 field public static final int CURSOR_AT_OR_AFTER = 1; // 0x1 field public static final int CURSOR_AT_OR_BEFORE = 3; // 0x3 field public static final int CURSOR_BEFORE = 2; // 0x2 field public static final int DEV_KERN_TEXT_FLAG = 256; // 0x100 field public static final int DEV_KERN_TEXT_FLAG = 256; // 0x100 field public static final int DITHER_FLAG = 4; // 0x4 field public static final int DITHER_FLAG = 4; // 0x4 field public static final int EMBEDDED_BITMAP_TEXT_FLAG = 1024; // 0x400 field public static final int EMBEDDED_BITMAP_TEXT_FLAG = 1024; // 0x400
core/java/android/text/GraphicsOperations.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -58,6 +58,6 @@ public interface GraphicsOperations extends CharSequence { /** /** * Just like {@link Paint#getTextRunCursor}. * Just like {@link Paint#getTextRunCursor}. */ */ int getTextRunCursor(int contextStart, int contextEnd, int dir, int offset, int getTextRunCursor(int contextStart, int contextEnd, boolean isRtl, int offset, int cursorOpt, Paint p); int cursorOpt, Paint p); } }
core/java/android/text/SpannableStringBuilder.java +11 −4 Original line number Original line Diff line number Diff line Loading @@ -1551,7 +1551,7 @@ public class SpannableStringBuilder implements CharSequence, GetChars, Spannable * * * @param contextStart the start index of the context * @param contextStart the start index of the context * @param contextEnd the (non-inclusive) end index of the context * @param contextEnd the (non-inclusive) end index of the context * @param dir either DIRECTION_RTL or DIRECTION_LTR * @param dir 1 if the run is RTL, otherwise 0 * @param offset the cursor position to move from * @param offset the cursor position to move from * @param cursorOpt how to move the cursor, one of CURSOR_AFTER, * @param cursorOpt how to move the cursor, one of CURSOR_AFTER, * CURSOR_AT_OR_AFTER, CURSOR_BEFORE, * CURSOR_AT_OR_AFTER, CURSOR_BEFORE, Loading @@ -1563,21 +1563,28 @@ public class SpannableStringBuilder implements CharSequence, GetChars, Spannable @Deprecated @Deprecated public int getTextRunCursor(int contextStart, int contextEnd, int dir, int offset, public int getTextRunCursor(int contextStart, int contextEnd, int dir, int offset, int cursorOpt, Paint p) { int cursorOpt, Paint p) { return getTextRunCursor(contextStart, contextEnd, dir == 1, offset, cursorOpt, p); } /** @hide */ @Override public int getTextRunCursor(int contextStart, int contextEnd, boolean isRtl, int offset, int cursorOpt, Paint p) { int ret; int ret; int contextLen = contextEnd - contextStart; int contextLen = contextEnd - contextStart; if (contextEnd <= mGapStart) { if (contextEnd <= mGapStart) { ret = p.getTextRunCursor(mText, contextStart, contextLen, ret = p.getTextRunCursor(mText, contextStart, contextLen, dir, offset, cursorOpt); isRtl, offset, cursorOpt); } else if (contextStart >= mGapStart) { } else if (contextStart >= mGapStart) { ret = p.getTextRunCursor(mText, contextStart + mGapLength, contextLen, ret = p.getTextRunCursor(mText, contextStart + mGapLength, contextLen, dir, offset + mGapLength, cursorOpt) - mGapLength; isRtl, offset + mGapLength, cursorOpt) - mGapLength; } else { } else { char[] buf = TextUtils.obtain(contextLen); char[] buf = TextUtils.obtain(contextLen); getChars(contextStart, contextEnd, buf, 0); getChars(contextStart, contextEnd, buf, 0); ret = p.getTextRunCursor(buf, 0, contextLen, ret = p.getTextRunCursor(buf, 0, contextLen, dir, offset - contextStart, cursorOpt) + contextStart; isRtl, offset - contextStart, cursorOpt) + contextStart; TextUtils.recycle(buf); TextUtils.recycle(buf); } } Loading
core/java/android/text/TextLine.java +2 −3 Original line number Original line Diff line number Diff line Loading @@ -802,14 +802,13 @@ public class TextLine { } } } } int dir = runIsRtl ? Paint.DIRECTION_RTL : Paint.DIRECTION_LTR; int cursorOpt = after ? Paint.CURSOR_AFTER : Paint.CURSOR_BEFORE; int cursorOpt = after ? Paint.CURSOR_AFTER : Paint.CURSOR_BEFORE; if (mCharsValid) { if (mCharsValid) { return wp.getTextRunCursor(mChars, spanStart, spanLimit - spanStart, return wp.getTextRunCursor(mChars, spanStart, spanLimit - spanStart, dir, offset, cursorOpt); runIsRtl, offset, cursorOpt); } else { } else { return wp.getTextRunCursor(mText, mStart + spanStart, return wp.getTextRunCursor(mText, mStart + spanStart, mStart + spanLimit, dir, mStart + offset, cursorOpt) - mStart; mStart + spanLimit, runIsRtl, mStart + offset, cursorOpt) - mStart; } } } } Loading
core/java/android/text/method/BaseKeyListener.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -310,7 +310,7 @@ public abstract class BaseKeyListener extends MetaKeyKeyListener return len; return len; } } offset = paint.getTextRunCursor(text, offset, len, Paint.DIRECTION_LTR /* not used */, offset = paint.getTextRunCursor(text, offset, len, false /* LTR, not used */, offset, Paint.CURSOR_AFTER); offset, Paint.CURSOR_AFTER); return adjustReplacementSpan(text, offset, false /* move to the end */); return adjustReplacementSpan(text, offset, false /* move to the end */); Loading