/cts/tests/tests/text/src/android/text/cts/ |
SpannedTest.java | 27 import android.text.Spanned; 41 // Returns an array of three Spanned objects, of three different classes: 43 private static Spanned[] makeSpanned(CharSequence s) { 44 return new Spanned[]{ 52 final Spanned[] spannedCases = makeSpanned("\uD83D\uDE00"); // U+1F600 GRINNING FACE 53 for (Spanned spanned : spannedCases) { 54 assertEquals('\uD83D', spanned.charAt(0)); 55 assertEquals('\uDE00', spanned.charAt(1)); 58 spanned.charAt(-1) [all...] |
SpannedStringTest.java | 47 SpannedString spanned = SpannedString.valueOf(text); local 48 assertEquals(text, spanned.toString()); 50 spanned = new SpannedString(text); 51 assertSame(spanned, SpannedString.valueOf(spanned)); 62 SpannedString spanned = new SpannedString(text); local 64 CharSequence subSequence = spanned.subSequence(0, 2); 68 subSequence = spanned.subSequence(0, text.length()); 73 spanned.subSequence(-1, text.length() + 1); 79 spanned.subSequence(2, 0) [all...] |
HtmlTest.java | 19 import static android.text.Spanned.SPAN_EXCLUSIVE_INCLUSIVE; 31 import android.text.Spanned; 57 Spanned spanned = Html.fromHtml(source); local 58 verifySingleTagOnWhileString(spanned); 59 spanned = Html.fromHtml(source, null, null); 60 verifySingleTagOnWhileString(spanned); 63 private void verifySingleTagOnWhileString(Spanned spanned) { 70 Object[] spans = spanned.getSpans(start, end, Object.class) 80 Spanned spanned = Html.fromHtml(source); local 100 String spanned = Html.fromHtml(source).toString(); local 395 Spanned spanned = Html.fromHtml(source); local 418 Spanned spanned = Html.fromHtml(source); local [all...] |
AlteredCharSequenceTest.java | 27 import android.text.Spanned; 118 MockSpanned spanned = new MockSpanned("This is a spanned."); local 119 mAlteredCharSequence = AlteredCharSequence.make(spanned, sub, 0, sub.length); 150 class MockSpanned implements Spanned {
|
/frameworks/base/core/tests/benchmarks/src/android/text/ |
SpannableStringInternalCopyBenchmark.java | 29 private SpannedString spanned; field in class:SpannableStringInternalCopyBenchmark 38 Spanned source = Html.fromHtml(strBuilder.toString()); 39 spanned = new SpannedString(source); 44 spanned = null; 50 new SpannedString(spanned); 57 spanned.subSequence(1, spanned.length()-1);
|
/packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/common/ |
AccessibilityContextMenuMaker.java | 23 import android.text.Spanned; 91 Spanned spanned = getText(textView); local 92 ClickableSpan[] spans = getSpans(spanned); 94 if (spanned == null || spans.length == 0) { 99 int s = spanned.getSpanStart(span); 100 int t = spanned.getSpanEnd(span); 101 menu.add(spanned.subSequence(s, t)).setOnMenuItemClickListener(menuItem -> { 117 private @Nullable Spanned getText(TextView textView) { 119 return (text instanceof Spanned) ? (Spanned) text : null [all...] |
HtmlToSpannedParser.java | 18 import static android.text.Spanned.SPAN_EXCLUSIVE_EXCLUSIVE; 26 import android.text.Spanned; 56 public Spanned parseHtml(String htmlContent) { 57 Spanned spanned = Html.fromHtml(checkStringNotEmpty(htmlContent), HTML_MODE); local 58 if (spanned == null) { 63 SpannableStringBuilder result = new SpannableStringBuilder(spanned);
|
/frameworks/base/core/java/android/text/ |
SpanSet.java | 23 * A cached set of spans. Caches the result of {@link Spanned#getSpans(int, int, Class)} and then 24 * provides faster access to {@link Spanned#nextSpanTransition(int, int, Class)}. 46 public void init(Spanned spanned, int start, int limit) { 47 final E[] allSpans = spanned.getSpans(start, limit, classType); 63 final int spanStart = spanned.getSpanStart(span); 64 final int spanEnd = spanned.getSpanEnd(span); 67 final int spanFlag = spanned.getSpanFlags(span); 98 * Similar to {@link Spanned#nextSpanTransition(int, int, Class)}
|
MeasuredText.java | 118 if (text instanceof Spanned) { 119 Spanned spanned = (Spanned) text; local 120 ReplacementSpan[] spans = spanned.getSpans(start, end, 124 int startInPara = spanned.getSpanStart(spans[i]) - start; 125 int endInPara = spanned.getSpanEnd(spans[i]) - start;
|
StaticLayout.java | 506 : (source instanceof Spanned) 561 : (b.mText instanceof Spanned) 622 Spanned spanned = null; 623 if (source instanceof Spanned) 624 spanned = (Spanned) source; 640 if (spanned != null) { 641 LeadingMarginSpan[] sp = getParagraphSpans(spanned, paraStart, paraEnd, 657 chooseHt = getParagraphSpans(spanned, paraStart, paraEnd, LineHeightSpan.class) [all...] |
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/compat/ |
LocaleSpanCompatUtilsTests.java | 24 import android.text.Spanned; 43 private static void assertLocaleSpan(final Spanned spanned, final int index, 46 final Object span = spanned.getSpans(0, spanned.length(), Object.class)[index]; 48 assertEquals(expectedStart, spanned.getSpanStart(span)); 49 assertEquals(expectedEnd, spanned.getSpanEnd(span)); 50 assertEquals(expectedSpanFlags, spanned.getSpanFlags(span)); 53 private static void assertSpanEquals(final Object expectedSpan, final Spanned spanned, [all...] |
SuggestionSpanUtilsTest.java | 23 import android.text.Spanned; 56 if (!(actualText instanceof Spanned)) { 59 final Spanned spanned = (Spanned)actualText; local 60 final SuggestionSpan[] suggestionSpans = spanned.getSpans(0, spanned.length(), 70 assertTrue(actualText instanceof Spanned); 71 final Spanned spanned = (Spanned)actualText local [all...] |
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/utils/ |
SpannableStringUtilsTests.java | 25 import android.text.Spanned; 38 new String[] {"" + i}, Spanned.SPAN_PARAGRAPH), 39 i * 12, i * 12 + 12, Spanned.SPAN_PARAGRAPH); 48 final Spanned result = 49 (Spanned)SpannableStringUtils.concatWithNonParagraphSuggestionSpansOnly(a, b); 55 flags & Spanned.SPAN_PARAGRAPH, 0); 62 if (cs instanceof Spanned) { 63 final Spanned spanned = (Spanned) cs local 74 final Spanned spanned = (Spanned) cs; local [all...] |
/packages/apps/ManagedProvisioning/tests/instrumentation/src/com/android/managedprovisioning/common/ |
HtmlToSpannedParserTest.java | 23 import android.text.Spanned; 70 Spanned spanned = mHtmlToSpannedParser.parseHtml(inputHtml); local 71 assertThat(spanned.toString(), equalTo(textRaw));
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/utils/ |
SpannableStringUtils.java | 21 import android.text.Spanned; 49 public static void copyNonParagraphSuggestionSpansFrom(Spanned source, int start, int end, 60 fl &= ~Spanned.SPAN_PARAGRAPH; 91 boolean spanned = false; 93 if (text[i] instanceof Spanned) { 94 spanned = true; 104 if (!spanned) { 113 if (text[i] instanceof Spanned) { 114 copyNonParagraphSuggestionSpansFrom((Spanned) text[i], 0, len, ss, off); 125 if (!(text instanceof Spanned)) { 128 final Spanned spanned = (Spanned)text; local [all...] |
/frameworks/base/core/tests/coretests/src/android/text/ |
TextUtilsTest.java | 73 assertEquals(1, ((Spanned) TextUtils.concat(foo)).getSpanStart("foo")); 75 assertEquals(1, ((Spanned) TextUtils.concat(foo, bar)).getSpanStart("foo")); 76 assertEquals(4, ((Spanned) TextUtils.concat(foo, bar)).getSpanStart("bar")); 78 assertEquals(1, ((Spanned) TextUtils.concat(foo, bar, baz)).getSpanStart("foo")); 79 assertEquals(4, ((Spanned) TextUtils.concat(foo, bar, baz)).getSpanStart("bar")); 80 assertEquals(7, ((Spanned) TextUtils.concat(foo, bar, baz)).getSpanStart("baz")); 150 private void checkContains(Spanned text, String[] spans, String spanName, 165 Spanned result; 176 result = (Spanned) TextUtils.expandTemplate(template, "foo"); 190 result = (Spanned) TextUtils.expandTemplate(template, "") 464 MockSpanned spanned = new MockSpanned(); local 622 final Spanned spanned = (Spanned) result; local [all...] |
/frameworks/support/emoji/core/tests/java/android/support/text/emoji/ |
EmojiSpanInstrumentationTest.java | 36 import android.text.Spanned; 80 final Spannable spanned = (Spannable) charSequence; local 81 final EmojiSpan[] spans = spanned.getSpans(0, charSequence.length(), EmojiSpan.class); 100 spanned.setSpan(sizeSpan, 0, charSequence.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
AllEmojisTest.java | 33 import android.text.Spanned; 130 final Spanned spanned = (Spanned) EmojiCompat.get().process(new TestString(str).toString()); local 131 final EmojiSpan[] spans = spanned.getSpans(0, spanned.length(), EmojiSpan.class);
|
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ |
BadgeSpan.java | 24 import android.text.Spanned; 51 * A reference to the enclosing Spanned object to collect other CharacterStyle spans and take 54 private final Spanned mSpanned; 57 public BadgeSpan(Spanned spanned, BadgeSpanDimensions dims) { 58 mSpanned = spanned;
|
/frameworks/support/emoji/core/tests/java/android/support/text/emoji/util/ |
EmojiMatcher.java | 21 import android.text.Spanned; 102 if (!(charSequence instanceof Spanned)) return false; 103 mSpans = ((Spanned) charSequence).getSpans(0, charSequence.length(), EmojiSpan.class); 138 if (!(charSequence instanceof Spanned)) return false; 139 mSpans = ((Spanned) charSequence).getSpans(0, charSequence.length(), EmojiSpan.class); 217 if (!(charSequence instanceof Spanned)) { 222 Spanned spanned = (Spanned) charSequence; 223 final EmojiSpan[] spans = spanned.getSpans(0, charSequence.length(), EmojiSpan.class) [all...] |
/frameworks/base/core/tests/coretests/src/android/widget/ |
SuggestionsPopupWindowTest.java | 48 import android.text.Spanned; 78 text.setSpan(span, start, end, Spanned.SPAN_INCLUSIVE_INCLUSIVE); 316 final Spanned spanned = (Spanned) suggestion.getText(); 317 assertNotNull(spanned); 326 assertEquals(expectedText, spanned.toString()); 329 final TextAppearanceSpan[] taSpan = spanned.getSpans( 347 assertEquals(expectedStart, spanned.getSpanStart(taSpan[0])); 348 assertEquals(expectedEnd, spanned.getSpanEnd(taSpan[0])) [all...] |
/frameworks/base/core/java/com/android/internal/widget/ |
EditableInputConnection.java | 21 import android.text.Spanned; 176 if (text instanceof Spanned) { 177 Spanned spanned = ((Spanned) text); local 178 SuggestionSpan[] spans = spanned.getSpans(0, text.length(), SuggestionSpan.class);
|
/packages/apps/Launcher3/src/com/android/launcher3/allapps/search/ |
AppsSearchContainerLayout.java | 105 SpannableString spanned = new SpannableString(" " + mSearchInput.getHint()); local 106 spanned.setSpan(new TintedDrawableSpan(getContext(), R.drawable.ic_allapps_search), 108 mSearchInput.setHint(spanned);
|
/packages/apps/QuickSearchBox/tests/src/com/android/quicksearchbox/ |
LevenshteinFormatterTest.java | 24 import android.text.Spanned; 152 Spanned s = mFormatter.formatSuggestion(query, suggestion); 350 public void verify(Spanned spanned) { 351 String spannedText = spanned.subSequence(mStart, mEnd).toString(); 353 MockStyleSpan[] spans = spanned.getSpans(mStart, mEnd, MockStyleSpan.class);
|
/packages/apps/UnifiedEmail/src/com/android/mail/utils/ |
HtmlUtils.java | 22 import android.text.Spanned; 48 * @return processed HTML as a Spanned 50 public static Spanned htmlToSpan(String html, HtmlTree.ConverterFactory factory) { 55 final Spanned spanned = htmlTree.getSpanned(); local 59 spanned.length()); 60 return spanned; 64 * Class that handles converting the html into a Spanned. 77 public static class SpannedConverter implements HtmlTree.Converter<Spanned> { 163 mBuilder.setSpan(marker, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) [all...] |