Loading api/current.txt +1 −3 Original line number Diff line number Diff line Loading @@ -44045,7 +44045,7 @@ package android.text { method public abstract int getSpanTypeId(); } public class PrecomputedText implements android.text.Spannable { public class PrecomputedText implements android.text.Spanned { method public char charAt(int); method public static android.text.PrecomputedText create(java.lang.CharSequence, android.text.PrecomputedText.Params); method public int getParagraphCount(); Loading @@ -44059,8 +44059,6 @@ package android.text { method public java.lang.CharSequence getText(); method public int length(); method public int nextSpanTransition(int, int, java.lang.Class); method public void removeSpan(java.lang.Object); method public void setSpan(java.lang.Object, int, int, int); method public java.lang.CharSequence subSequence(int, int); } core/java/android/text/DynamicLayout.java +1 −6 Original line number Diff line number Diff line Loading @@ -704,12 +704,7 @@ public class DynamicLayout extends Layout { // Spans other than ReplacementSpan can be ignored because line top and bottom are // disjunction of all tops and bottoms, although it's not optimal. final Paint paint = getPaint(); if (text instanceof PrecomputedText) { PrecomputedText precomputed = (PrecomputedText) text; precomputed.getBounds(start, end, mTempRect); } else { paint.getTextBounds(text, start, end, mTempRect); } final Paint.FontMetricsInt fm = paint.getFontMetricsInt(); return mTempRect.top < fm.top || mTempRect.bottom > fm.bottom; } Loading core/java/android/text/MeasuredParagraph.java +0 −16 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.Nullable; import android.graphics.Paint; import android.graphics.Rect; import android.text.AutoGrowArray.ByteArray; import android.text.AutoGrowArray.FloatArray; import android.text.AutoGrowArray.IntArray; Loading Loading @@ -297,18 +296,6 @@ public class MeasuredParagraph { } } /** * Retrieves the bounding rectangle that encloses all of the characters, with an implied origin * at (0, 0). * * This is available only if the MeasuredParagraph is computed with buildForStaticLayout. */ public void getBounds(@NonNull Paint paint, @IntRange(from = 0) int start, @IntRange(from = 0) int end, @NonNull Rect bounds) { nGetBounds(mNativePtr, mCopiedBuffer, paint.getNativeInstance(), start, end, paint.getBidiFlags(), bounds); } /** * Generates new MeasuredParagraph for Bidi computation. * Loading Loading @@ -741,7 +728,4 @@ public class MeasuredParagraph { @CriticalNative private static native int nGetMemoryUsage(/* Non Zero */ long nativePtr); private static native void nGetBounds(long nativePtr, char[] buf, long paintPtr, int start, int end, int bidiFlag, Rect rect); } core/java/android/text/PrecomputedText.java +3 −49 Original line number Diff line number Diff line Loading @@ -19,8 +19,6 @@ package android.text; import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.Nullable; import android.graphics.Rect; import android.text.style.MetricAffectingSpan; import android.util.IntArray; import com.android.internal.util.Preconditions; Loading Loading @@ -63,7 +61,7 @@ import java.util.Objects; * {@link android.widget.TextView} will be rejected internally and compute the text layout again * with the current {@link android.widget.TextView} parameters. */ public class PrecomputedText implements Spannable { public class PrecomputedText implements Spanned { private static final char LINE_FEED = '\n'; /** Loading Loading @@ -270,7 +268,7 @@ public class PrecomputedText implements Spannable { }; // The original text. private final @NonNull SpannableString mText; private final @NonNull SpannedString mText; // The inclusive start offset of the measuring target. private final @IntRange(from = 0) int mStart; Loading Loading @@ -344,7 +342,7 @@ public class PrecomputedText implements Spannable { private PrecomputedText(@NonNull CharSequence text, @IntRange(from = 0) int start, @IntRange(from = 0) int end, @NonNull Params param, @NonNull MeasuredParagraph[] measuredTexts, @NonNull int[] paragraphBreakPoints) { mText = new SpannableString(text); mText = new SpannedString(text); mStart = start; mEnd = end; mParams = param; Loading Loading @@ -450,21 +448,6 @@ public class PrecomputedText implements Spannable { return getMeasuredParagraph(paraIndex).getWidth(start - paraStart, end - paraStart); } /** @hide */ public void getBounds(@IntRange(from = 0) int start, @IntRange(from = 0) int end, @NonNull Rect bounds) { final int paraIndex = findParaIndex(start); final int paraStart = getParagraphStart(paraIndex); final int paraEnd = getParagraphEnd(paraIndex); if (start < paraStart || paraEnd < end) { throw new RuntimeException("Cannot measured across the paragraph:" + "para: (" + paraStart + ", " + paraEnd + "), " + "request: (" + start + ", " + end + ")"); } getMeasuredParagraph(paraIndex).getBounds(mParams.mPaint, start - paraStart, end - paraStart, bounds); } /** * Returns the size of native PrecomputedText memory usage. * Loading @@ -479,35 +462,6 @@ public class PrecomputedText implements Spannable { return r; } /////////////////////////////////////////////////////////////////////////////////////////////// // Spannable overrides // // Do not allow to modify MetricAffectingSpan /** * @throws IllegalArgumentException if {@link MetricAffectingSpan} is specified. */ @Override public void setSpan(Object what, int start, int end, int flags) { if (what instanceof MetricAffectingSpan) { throw new IllegalArgumentException( "MetricAffectingSpan can not be set to PrecomputedText."); } mText.setSpan(what, start, end, flags); } /** * @throws IllegalArgumentException if {@link MetricAffectingSpan} is specified. */ @Override public void removeSpan(Object what) { if (what instanceof MetricAffectingSpan) { throw new IllegalArgumentException( "MetricAffectingSpan can not be removed from PrecomputedText."); } mText.removeSpan(what); } /////////////////////////////////////////////////////////////////////////////////////////////// // Spanned overrides // Loading core/java/android/widget/TextView.java +4 −5 Original line number Diff line number Diff line Loading @@ -5642,8 +5642,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener needEditableForNotification = true; } PrecomputedText precomputed = (text instanceof PrecomputedText) ? (PrecomputedText) text : null; if (type == BufferType.EDITABLE || getKeyListener() != null || needEditableForNotification) { createEditorIfNeeded(); Loading @@ -5653,7 +5651,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener setFilters(t, mFilters); InputMethodManager imm = InputMethodManager.peekInstance(); if (imm != null) imm.restartInput(this); } else if (precomputed != null) { } else if (type == BufferType.SPANNABLE || mMovement != null) { text = mSpannableFactory.newSpannable(text); } else if (text instanceof PrecomputedText) { PrecomputedText precomputed = (PrecomputedText) text; if (mTextDir == null) { mTextDir = getTextDirectionHeuristic(); } Loading @@ -5666,8 +5667,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener + "PrecomputedText: " + precomputed.getParams() + "TextView: " + getTextMetricsParams()); } } else if (type == BufferType.SPANNABLE || mMovement != null) { text = mSpannableFactory.newSpannable(text); } else if (!(text instanceof CharWrapper)) { text = TextUtils.stringOrSpannedString(text); } Loading Loading
api/current.txt +1 −3 Original line number Diff line number Diff line Loading @@ -44045,7 +44045,7 @@ package android.text { method public abstract int getSpanTypeId(); } public class PrecomputedText implements android.text.Spannable { public class PrecomputedText implements android.text.Spanned { method public char charAt(int); method public static android.text.PrecomputedText create(java.lang.CharSequence, android.text.PrecomputedText.Params); method public int getParagraphCount(); Loading @@ -44059,8 +44059,6 @@ package android.text { method public java.lang.CharSequence getText(); method public int length(); method public int nextSpanTransition(int, int, java.lang.Class); method public void removeSpan(java.lang.Object); method public void setSpan(java.lang.Object, int, int, int); method public java.lang.CharSequence subSequence(int, int); }
core/java/android/text/DynamicLayout.java +1 −6 Original line number Diff line number Diff line Loading @@ -704,12 +704,7 @@ public class DynamicLayout extends Layout { // Spans other than ReplacementSpan can be ignored because line top and bottom are // disjunction of all tops and bottoms, although it's not optimal. final Paint paint = getPaint(); if (text instanceof PrecomputedText) { PrecomputedText precomputed = (PrecomputedText) text; precomputed.getBounds(start, end, mTempRect); } else { paint.getTextBounds(text, start, end, mTempRect); } final Paint.FontMetricsInt fm = paint.getFontMetricsInt(); return mTempRect.top < fm.top || mTempRect.bottom > fm.bottom; } Loading
core/java/android/text/MeasuredParagraph.java +0 −16 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.Nullable; import android.graphics.Paint; import android.graphics.Rect; import android.text.AutoGrowArray.ByteArray; import android.text.AutoGrowArray.FloatArray; import android.text.AutoGrowArray.IntArray; Loading Loading @@ -297,18 +296,6 @@ public class MeasuredParagraph { } } /** * Retrieves the bounding rectangle that encloses all of the characters, with an implied origin * at (0, 0). * * This is available only if the MeasuredParagraph is computed with buildForStaticLayout. */ public void getBounds(@NonNull Paint paint, @IntRange(from = 0) int start, @IntRange(from = 0) int end, @NonNull Rect bounds) { nGetBounds(mNativePtr, mCopiedBuffer, paint.getNativeInstance(), start, end, paint.getBidiFlags(), bounds); } /** * Generates new MeasuredParagraph for Bidi computation. * Loading Loading @@ -741,7 +728,4 @@ public class MeasuredParagraph { @CriticalNative private static native int nGetMemoryUsage(/* Non Zero */ long nativePtr); private static native void nGetBounds(long nativePtr, char[] buf, long paintPtr, int start, int end, int bidiFlag, Rect rect); }
core/java/android/text/PrecomputedText.java +3 −49 Original line number Diff line number Diff line Loading @@ -19,8 +19,6 @@ package android.text; import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.Nullable; import android.graphics.Rect; import android.text.style.MetricAffectingSpan; import android.util.IntArray; import com.android.internal.util.Preconditions; Loading Loading @@ -63,7 +61,7 @@ import java.util.Objects; * {@link android.widget.TextView} will be rejected internally and compute the text layout again * with the current {@link android.widget.TextView} parameters. */ public class PrecomputedText implements Spannable { public class PrecomputedText implements Spanned { private static final char LINE_FEED = '\n'; /** Loading Loading @@ -270,7 +268,7 @@ public class PrecomputedText implements Spannable { }; // The original text. private final @NonNull SpannableString mText; private final @NonNull SpannedString mText; // The inclusive start offset of the measuring target. private final @IntRange(from = 0) int mStart; Loading Loading @@ -344,7 +342,7 @@ public class PrecomputedText implements Spannable { private PrecomputedText(@NonNull CharSequence text, @IntRange(from = 0) int start, @IntRange(from = 0) int end, @NonNull Params param, @NonNull MeasuredParagraph[] measuredTexts, @NonNull int[] paragraphBreakPoints) { mText = new SpannableString(text); mText = new SpannedString(text); mStart = start; mEnd = end; mParams = param; Loading Loading @@ -450,21 +448,6 @@ public class PrecomputedText implements Spannable { return getMeasuredParagraph(paraIndex).getWidth(start - paraStart, end - paraStart); } /** @hide */ public void getBounds(@IntRange(from = 0) int start, @IntRange(from = 0) int end, @NonNull Rect bounds) { final int paraIndex = findParaIndex(start); final int paraStart = getParagraphStart(paraIndex); final int paraEnd = getParagraphEnd(paraIndex); if (start < paraStart || paraEnd < end) { throw new RuntimeException("Cannot measured across the paragraph:" + "para: (" + paraStart + ", " + paraEnd + "), " + "request: (" + start + ", " + end + ")"); } getMeasuredParagraph(paraIndex).getBounds(mParams.mPaint, start - paraStart, end - paraStart, bounds); } /** * Returns the size of native PrecomputedText memory usage. * Loading @@ -479,35 +462,6 @@ public class PrecomputedText implements Spannable { return r; } /////////////////////////////////////////////////////////////////////////////////////////////// // Spannable overrides // // Do not allow to modify MetricAffectingSpan /** * @throws IllegalArgumentException if {@link MetricAffectingSpan} is specified. */ @Override public void setSpan(Object what, int start, int end, int flags) { if (what instanceof MetricAffectingSpan) { throw new IllegalArgumentException( "MetricAffectingSpan can not be set to PrecomputedText."); } mText.setSpan(what, start, end, flags); } /** * @throws IllegalArgumentException if {@link MetricAffectingSpan} is specified. */ @Override public void removeSpan(Object what) { if (what instanceof MetricAffectingSpan) { throw new IllegalArgumentException( "MetricAffectingSpan can not be removed from PrecomputedText."); } mText.removeSpan(what); } /////////////////////////////////////////////////////////////////////////////////////////////// // Spanned overrides // Loading
core/java/android/widget/TextView.java +4 −5 Original line number Diff line number Diff line Loading @@ -5642,8 +5642,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener needEditableForNotification = true; } PrecomputedText precomputed = (text instanceof PrecomputedText) ? (PrecomputedText) text : null; if (type == BufferType.EDITABLE || getKeyListener() != null || needEditableForNotification) { createEditorIfNeeded(); Loading @@ -5653,7 +5651,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener setFilters(t, mFilters); InputMethodManager imm = InputMethodManager.peekInstance(); if (imm != null) imm.restartInput(this); } else if (precomputed != null) { } else if (type == BufferType.SPANNABLE || mMovement != null) { text = mSpannableFactory.newSpannable(text); } else if (text instanceof PrecomputedText) { PrecomputedText precomputed = (PrecomputedText) text; if (mTextDir == null) { mTextDir = getTextDirectionHeuristic(); } Loading @@ -5666,8 +5667,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener + "PrecomputedText: " + precomputed.getParams() + "TextView: " + getTextMetricsParams()); } } else if (type == BufferType.SPANNABLE || mMovement != null) { text = mSpannableFactory.newSpannable(text); } else if (!(text instanceof CharWrapper)) { text = TextUtils.stringOrSpannedString(text); } Loading