/frameworks/base/core/tests/coretests/src/android/text/ |
SpannableTest.java | 36 Object[] spans; local 38 // Empty spans are included when they merely abut the query region 39 // but other spans are not, unless the query region is empty, in 40 // in which case any abutting spans are returned. 41 spans = spannable.getSpans(0, 1, Object.class); 42 MoreAsserts.assertEquals(new Object[]{emptySpan}, spans); 43 spans = spannable.getSpans(0, 2, Object.class); 44 MoreAsserts.assertEquals(new Object[]{emptySpan, unemptySpan}, spans); 45 spans = spannable.getSpans(1, 2, Object.class); 46 MoreAsserts.assertEquals(new Object[]{emptySpan, unemptySpan}, spans); [all...] |
HtmlTest.java | 41 Object[] spans = spanned.getSpans(-1, 100, Object.class); local 42 assertEquals(1, spans.length); 43 Object span = spans[0]; 51 Object[] spans = spanned.getSpans(0, 100, Object.class); local 52 // TODO: figure out what the spans should be after the crashes are fixed and assert them. 59 Object[] spans = spanned.getSpans(0, 100, Object.class); local 60 assertEquals(Typeface.ITALIC, ((StyleSpan) spans[0]).getStyle()); 61 assertEquals(7, spanned.getSpanStart(spans[0])); 62 assertEquals(9, spanned.getSpanEnd(spans[0])); 63 assertEquals(Typeface.BOLD, ((StyleSpan) spans[1]).getStyle()) [all...] |
/external/robolectric/src/test/java/com/xtremelabs/robolectric/shadows/ |
SpannableStringTest.java | 54 Object[] spans = spanStr.getSpans(0, TEST_STRING.length(), Object.class); local 55 assertThat(spans, notNullValue()); 56 assertThat(spans.length, equalTo(1)); 57 assertThat((UnderlineSpan) spans[0], sameInstance(s2)); 67 Object[] spans = spanStr.getSpans(0, TEST_STRING.length(), Object.class); local 68 assertThat(spans, notNullValue()); 69 assertThat(spans.length, equalTo(2)); 72 spans = spanStr.getSpans(0, TEST_STRING.length(), URLSpan.class); 73 assertThat(spans, notNullValue()); 74 assertThat(spans.length, equalTo(1)) 124 Object[] spans = spanStr.getSpans(0, TEST_STRING.length(), Object.class); local [all...] |
/cts/tests/tests/text/src/android/text/util/cts/ |
LinkifyTest.java | 80 URLSpan[] spans = spannable.getSpans(0, spannable.length(), URLSpan.class); local 81 assertEquals(2, spans.length); 82 assertEquals("http://www.google.com", spans[0].getURL()); 83 assertEquals("http://www.google.com/language_tools?hl=en", spans[1].getURL()); 86 spans = spannable.getSpans(0, spannable.length(), URLSpan.class); 87 assertEquals(1, spans.length); 88 assertEquals("mailto:name@gmail.com", spans[0].getURL()); 106 URLSpan[] spans = ((Spannable)tv.getText()).getSpans(0, text.length(), URLSpan.class); local 107 assertEquals(1, spans.length); 108 assertEquals("http://www.google.com", spans[0].getURL()) 133 URLSpan[] spans = ((Spannable) tv.getText()).getSpans(0, text.length(), URLSpan.class); local 176 URLSpan[] spans = ((Spannable) tv.getText()).getSpans(0, text.length(), URLSpan.class); local 226 URLSpan[] spans = (spannable.getSpans(0, spannable.length(), URLSpan.class)); local 257 URLSpan[] spans = (spannable.getSpans(0, spannable.length(), URLSpan.class)); local 318 URLSpan[] spans = spannable.getSpans(0, spannable.length(), URLSpan.class); local [all...] |
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/utils/ |
TextRange.java | 48 * Gets the suggestion spans that are put squarely on the word, with the exact start 50 * @return the list of spans. 59 // spans were cut at the cursor position, and #getSpans(start, end) does not return 60 // spans that end at `start' or begin at `end'. Consider the following case: 68 // the 4~7 spans and we can merge them accordingly. 74 final SuggestionSpan[] spans = text.getSpans(mWordAtCursorStartIndex - 1, local 78 for (; readIndex < spans.length; ++readIndex) { 79 final SuggestionSpan span = spans[readIndex]; 87 for (int i = readIndex + 1; i < spans.length; ++i) { 88 if (span.equals(spans[i])) [all...] |
SpannableStringUtils.java | 28 * Copies the spans from the region <code>start...end</code> in 31 * Spans in <code>source</code> that begin before <code>start</code> 39 * @throws IndexOutOfBoundsException if any of the copied spans 44 Object[] spans = source.getSpans(start, end, SuggestionSpan.class); local 46 for (int i = 0; i < spans.length; i++) { 47 int fl = source.getSpanFlags(spans[i]); 50 int st = source.getSpanStart(spans[i]); 51 int en = source.getSpanEnd(spans[i]); 58 dest.setSpan(spans[i], st - start + destoff, en - start + destoff, 65 * SuggestionSpans that don't have the PARAGRAPH flag, but not other spans [all...] |
/packages/apps/Email/tests/src/com/android/emailcommon/utility/ |
TextUtilitiesTests.java | 202 BackgroundColorSpan[] spans = ssb.getSpans(0, ssb.length(), BackgroundColorSpan.class); local 203 assertEquals(1, spans.length); 204 BackgroundColorSpan span = spans[0]; 213 spans = ssb.getSpans(0, ssb.length(), BackgroundColorSpan.class); 214 assertEquals(2, spans.length); 215 span = spans[0]; 218 span = spans[1]; 229 BackgroundColorSpan[] spans = ssb.getSpans(0, ssb.length(), BackgroundColorSpan.class); local 230 assertEquals(2, spans.length); 231 BackgroundColorSpan span = spans[0] 245 BackgroundColorSpan[] spans = ssb.getSpans(0, ssb.length(), BackgroundColorSpan.class); local 257 BackgroundColorSpan[] spans = ssb.getSpans(0, ssb.length(), BackgroundColorSpan.class); local 270 BackgroundColorSpan[] spans = ssb.getSpans(0, ssb.length(), BackgroundColorSpan.class); local [all...] |
/frameworks/base/core/java/android/text/ |
SpanSet.java | 22 * A cached set of spans. Caches the result of {@link Spanned#getSpans(int, int, Class)} and then 27 * Note that empty spans are ignored by this class. 34 E[] spans; field in class:SpanSet 49 if (length > 0 && (spans == null || spans.length < length)) { 50 // These arrays may end up being too large because of the discarded empty spans 51 spans = (E[]) Array.newInstance(classType, length); 67 spans[numberOfSpans] = span; 77 * Returns true if there are spans intersecting the given interval. 103 * Removes all internal references to the spans to avoid memory leaks [all...] |
SpannableStringInternal.java | 38 Object[] spans = sp.getSpans(start, end, Object.class); local 40 for (int i = 0; i < spans.length; i++) { 41 int st = sp.getSpanStart(spans[i]); 42 int en = sp.getSpanEnd(spans[i]); 43 int fl = sp.getSpanFlags(spans[i]); 50 setSpan(spans[i], st - start, en - start, fl); 100 Object[] spans = mSpans; local 104 if (spans[i] == what) { 141 Object[] spans = mSpans; local 145 if (spans[i] == what) 165 Object[] spans = mSpans; local 179 Object[] spans = mSpans; local 193 Object[] spans = mSpans; local 209 Object[] spans = mSpans; local 287 Object[] spans = mSpans; local [all...] |
MeasuredText.java | 110 ReplacementSpan[] spans = spanned.getSpans(start, end, local 113 for (int i = 0; i < spans.length; i++) { 114 int startInPara = spanned.getSpanStart(spans[i]) - start; 115 int endInPara = spanned.getSpanEnd(spans[i]) - start; 184 float addStyleRun(TextPaint paint, MetricAffectingSpan[] spans, int len, 193 for (int i = 0; i < spans.length; i++) { 194 MetricAffectingSpan span = spans[i];
|