Home
last modified time | relevance | path

Searched refs:spannable (Results 1 – 5 of 5) sorted by relevance

/external/exoplayer/tree/testutils/src/test/java/com/google/android/exoplayer2/testutil/truth/
DSpannedSubjectTest.java72 SpannableString spannable = SpannableString.valueOf("test with no spans"); in hasNoSpans_success() local
74 assertThat(spannable).hasNoSpans(); in hasNoSpans_success()
89 SpannableString spannable = in italicSpan_success() local
92 assertThat(spannable) in italicSpan_success()
119 SpannableString spannable = in boldSpan_success() local
122 assertThat(spannable) in boldSpan_success()
141 SpannableString spannable = in boldItalicSpan_withOneSpan() local
144 assertThat(spannable) in boldItalicSpan_withOneSpan()
151 SpannableString spannable = createSpannable(new StyleSpan(Typeface.BOLD)); in boldItalicSpan_withTwoSpans() local
152 spannable.setSpan( in boldItalicSpan_withTwoSpans()
[all …]
/external/exoplayer/tree/library/core/src/test/java/com/google/android/exoplayer2/text/span/
DSpanUtilTest.java36 Spannable spannable = SpannableString.valueOf("test text"); in addOrReplaceSpan_replacesSameTypeAndIndexes() local
37 spannable.setSpan( in addOrReplaceSpan_replacesSameTypeAndIndexes()
45 spannable, newSpan, /* start= */ 2, /* end= */ 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); in addOrReplaceSpan_replacesSameTypeAndIndexes()
47 Object[] spans = spannable.getSpans(0, spannable.length(), Object.class); in addOrReplaceSpan_replacesSameTypeAndIndexes()
53 Spannable spannable = SpannableString.valueOf("test text"); in addOrReplaceSpan_ignoresDifferentType() local
55 spannable.setSpan(originalSpan, /* start= */ 2, /* end= */ 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); in addOrReplaceSpan_ignoresDifferentType()
58 SpanUtil.addOrReplaceSpan(spannable, newSpan, 2, 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); in addOrReplaceSpan_ignoresDifferentType()
60 Object[] spans = spannable.getSpans(0, spannable.length(), Object.class); in addOrReplaceSpan_ignoresDifferentType()
66 Spannable spannable = SpannableString.valueOf("test text"); in addOrReplaceSpan_ignoresDifferentStartEndAndFlags() local
68 spannable.setSpan(originalSpan, /* start= */ 2, /* end= */ 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); in addOrReplaceSpan_ignoresDifferentStartEndAndFlags()
[all …]
/external/exoplayer/tree/library/core/src/main/java/com/google/android/exoplayer2/text/span/
DSpanUtil.java42 Spannable spannable, Object span, int start, int end, int spanFlags) { in addOrReplaceSpan() argument
43 Object[] existingSpans = spannable.getSpans(start, end, span.getClass()); in addOrReplaceSpan()
45 if (spannable.getSpanStart(existingSpan) == start in addOrReplaceSpan()
46 && spannable.getSpanEnd(existingSpan) == end in addOrReplaceSpan()
47 && spannable.getSpanFlags(existingSpan) == spanFlags) { in addOrReplaceSpan()
48 spannable.removeSpan(existingSpan); in addOrReplaceSpan()
51 spannable.setSpan(span, start, end, spanFlags); in addOrReplaceSpan()
/external/setupdesign/main/src/com/google/android/setupdesign/span/
DSpanHelper.java30 public static void replaceSpan(Spannable spannable, Object oldSpan, Object... newSpans) { in replaceSpan() argument
31 final int spanStart = spannable.getSpanStart(oldSpan); in replaceSpan()
32 final int spanEnd = spannable.getSpanEnd(oldSpan); in replaceSpan()
33 spannable.removeSpan(oldSpan); in replaceSpan()
35 spannable.setSpan(newSpan, spanStart, spanEnd, 0); in replaceSpan()
/external/setupdesign/main/src/com/google/android/setupdesign/view/
DRichTextView.java67 final SpannableString spannable = new SpannableString(text); in getRichText() local
68 final Annotation[] spans = spannable.getSpans(0, spannable.length(), Annotation.class); in getRichText()
81 SpanHelper.replaceSpan(spannable, span, textAppearanceSpan); in getRichText()
85 SpanHelper.replaceSpan(spannable, span, link, typefaceSpan); in getRichText()
88 return spannable; in getRichText()