# SpannedSubject

Artifact: [androidx.media3:media3-test-utils](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/test/utils/truth/SpannedSubject.java+class:androidx.media3.test.utils.truth.SpannedSubject)

*** ** * ** ***

<br />

```
@UnstableApi
public final class SpannedSubject extends Subject
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [com.google.common.truth.Subject](https://truth.dev/api/0.41/com/google/common/truth/Subject.html) ||
|   | ↳ | [androidx.media3.test.utils.truth.SpannedSubject](https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject) |

*** ** * ** ***

A Truth `https://truth.dev/api/0.41/com/google/common/truth/Subject.html` for assertions on `https://developer.android.com/reference/android/text/Spanned.html` instances containing text styling.

## Summary

| ### Nested types |
|---|
| `public interface https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.AbsoluteSized` Allows assertions about the absolute size of a span. |
| `public interface https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Aligned` Allows assertions about the alignment of a span. |
| `public interface https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.AndSpanFlags` Allows additional assertions to be made on the flags of matching spans. |
| `public interface https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Colored` Allows assertions about the color of a span. |
| `public interface https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.EmphasizedText` Allows assertions about a span's text emphasis mark and its position. |
| `public interface https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.RelativeSized` Allows assertions about the relative size of a span. |
| `public interface https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.RubyText` Allows assertions about a span's ruby text and its position. |
| `public interface https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Typefaced` Allows assertions about the typeface of a span. |
| `public interface https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.VoiceText` Allows assertions about a span's voice its position. |
| `public interface https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.WithSpanFlags` Allows additional assertions to be made on the flags of matching spans. |

| ### Public methods |
|---|---|
| `static https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#assertThat(android.text.Spanned)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/text/Spanned.html spanned)` Convenience method to create a SpannedSubject. |
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.AbsoluteSized` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasAbsoluteSizeSpanBetween(int,int)(int start, int end)` Checks that the subject has a `https://developer.android.com/reference/android/text/style/AbsoluteSizeSpan.html` from `start` to `end`. |
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Aligned` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasAlignmentSpanBetween(int,int)(int start, int end)` Checks that the subject has a `https://developer.android.com/reference/android/text/style/AlignmentSpan.html` from `start` to `end`. |
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Colored` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasBackgroundColorSpanBetween(int,int)(int start, int end)` Checks that the subject has a `https://developer.android.com/reference/android/text/style/BackgroundColorSpan.html` from `start` to `end`. |
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.WithSpanFlags` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasBoldItalicSpanBetween(int,int)(int start, int end)` Checks that the subject has bold and italic styling from `start` to `end`. |
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.WithSpanFlags` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasBoldSpanBetween(int,int)(int start, int end)` Checks that the subject has a bold span from `start` to `end`. |
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Colored` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasForegroundColorSpanBetween(int,int)(int start, int end)` Checks that the subject has a `https://developer.android.com/reference/android/text/style/ForegroundColorSpan.html` from `start` to `end`. |
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.WithSpanFlags` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasHorizontalTextInVerticalContextSpanBetween(int,int)(int start, int end)` Checks that the subject has an `https://developer.android.com/reference/androidx/media3/common/text/HorizontalTextInVerticalContextSpan` from `start` to `end`. |
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.WithSpanFlags` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasItalicSpanBetween(int,int)(int start, int end)` Checks that the subject has an italic span from `start` to `end`. |
| `void` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasNoAbsoluteSizeSpanBetween(int,int)(int start, int end)` Checks that the subject has no `https://developer.android.com/reference/android/text/style/AbsoluteSizeSpan.html`s on any of the text between ` start` and `end`. |
| `void` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasNoAlignmentSpanBetween(int,int)(int start, int end)` Checks that the subject has no `https://developer.android.com/reference/android/text/style/AlignmentSpan.html`s on any of the text between `start` and `end`. |
| `void` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasNoBackgroundColorSpanBetween(int,int)(int start, int end)` Checks that the subject has no `https://developer.android.com/reference/android/text/style/BackgroundColorSpan.html`s on any of the text between ` start` and `end`. |
| `void` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasNoForegroundColorSpanBetween(int,int)(int start, int end)` Checks that the subject has no `https://developer.android.com/reference/android/text/style/ForegroundColorSpan.html`s on any of the text between ` start` and `end`. |
| `void` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasNoHorizontalTextInVerticalContextSpanBetween(int,int)(int start, int end)` Checks that the subject has no `https://developer.android.com/reference/androidx/media3/common/text/HorizontalTextInVerticalContextSpan`s on any of the text between `start` and `end`. |
| `void` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasNoRelativeSizeSpanBetween(int,int)(int start, int end)` Checks that the subject has no `https://developer.android.com/reference/android/text/style/RelativeSizeSpan.html`s on any of the text between ` start` and `end`. |
| `void` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasNoRubySpanBetween(int,int)(int start, int end)` Checks that the subject has no `https://developer.android.com/reference/androidx/media3/common/text/RubySpan`s on any of the text between `start` and `end`. |
| `void` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasNoSpans()()` |
| `void` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasNoStrikethroughSpanBetween(int,int)(int start, int end)` Checks that the subject has no `https://developer.android.com/reference/android/text/style/StrikethroughSpan.html`s on any of the text between ` start` and `end`. |
| `void` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasNoStyleSpanBetween(int,int)(int start, int end)` Checks that the subject has no `https://developer.android.com/reference/android/text/style/StyleSpan.html`s on any of the text between `start` and `end`. |
| `void` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasNoTextEmphasisSpanBetween(int,int)(int start, int end)` Checks that the subject has no `https://developer.android.com/reference/androidx/media3/common/text/TextEmphasisSpan`s on any of the text between ` start` and `end`. |
| `void` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasNoTypefaceSpanBetween(int,int)(int start, int end)` Checks that the subject has no `https://developer.android.com/reference/android/text/style/TypefaceSpan.html`s on any of the text between `start` and `end`. |
| `void` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasNoUnderlineSpanBetween(int,int)(int start, int end)` Checks that the subject has no `https://developer.android.com/reference/android/text/style/UnderlineSpan.html`s on any of the text between `start` and `end`. |
| `void` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasNoVoiceSpanBetween(int,int)(int start, int end)` Checks that the subject has no `https://developer.android.com/reference/androidx/media3/common/text/VoiceSpan`s on any of the text between `start` and `end`. |
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.RelativeSized` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasRelativeSizeSpanBetween(int,int)(int start, int end)` Checks that the subject has a `https://developer.android.com/reference/android/text/style/RelativeSizeSpan.html` from `start` to `end`. |
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.RubyText` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasRubySpanBetween(int,int)(int start, int end)` Checks that the subject has a `https://developer.android.com/reference/androidx/media3/common/text/RubySpan` from `start` to `end`. |
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.WithSpanFlags` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasStrikethroughSpanBetween(int,int)(int start, int end)` Checks that the subject has an `https://developer.android.com/reference/android/text/style/StrikethroughSpan.html` from `start` to `end`. |
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.EmphasizedText` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasTextEmphasisSpanBetween(int,int)(int start, int end)` Checks that the subject has an `https://developer.android.com/reference/androidx/media3/common/text/TextEmphasisSpan` from `start` to `end`. |
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Typefaced` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasTypefaceSpanBetween(int,int)(int start, int end)` Checks that the subject has a `https://developer.android.com/reference/android/text/style/TypefaceSpan.html` from `start` to `end`. |
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.WithSpanFlags` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasUnderlineSpanBetween(int,int)(int start, int end)` Checks that the subject has an `https://developer.android.com/reference/android/text/style/UnderlineSpan.html` from `start` to `end`. |
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.VoiceText` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#hasVoiceSpanBetween(int,int)(int start, int end)` Checks that the subject has an `https://developer.android.com/reference/androidx/media3/common/text/VoiceSpan` from `start` to `end`. |
| `static https://truth.dev/api/0.41/com/google/common/truth/Subject.Factory.html<https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject, https://developer.android.com/reference/android/text/Spanned.html>` | `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject#spanned()()` |

### Inherited methods

From [com.google.common.truth.Subject](https://truth.dev/api/0.41/com/google/common/truth/Subject.html) `https://developer.android.com/reference/java/lang/String.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#actualCustomStringRepresentation--()` `final boolean` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#equals-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html o)`

**This method is deprecated.**
`final void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#failWithActual-java.lang.String-java.lang.Object-(https://developer.android.com/reference/java/lang/String.html key, https://developer.android.com/reference/java/lang/Object.html value)` `final void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#failWithoutActual-com.google.common.truth.Fact-com.google.common.truth.Fact...-(https://truth.dev/api/0.41/com/google/common/truth/Fact.html first, Fact[] rest)` `final int` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#hashCode--()`

**This method is deprecated.**
`final https://truth.dev/api/0.41/com/google/common/truth/StandardSubjectBuilder.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#ignoreCheck--()` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isAnyOf-java.lang.Object-java.lang.Object-java.lang.Object...-(https://developer.android.com/reference/java/lang/Object.html first, https://developer.android.com/reference/java/lang/Object.html second, Object[] rest)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isEqualTo-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html expected)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isIn-java.lang.Iterable&lt;?&gt;-(https://developer.android.com/reference/java/lang/Iterable.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> iterable)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isInstanceOf-java.lang.Class&lt;?&gt;-(https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> clazz)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNoneOf-java.lang.Object-java.lang.Object-java.lang.Object...-(https://developer.android.com/reference/java/lang/Object.html first, https://developer.android.com/reference/java/lang/Object.html second, Object[] rest)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotEqualTo-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html unexpected)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotIn-java.lang.Iterable&lt;?&gt;-(https://developer.android.com/reference/java/lang/Iterable.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> iterable)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotInstanceOf-java.lang.Class&lt;?&gt;-(https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> clazz)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotNull--()` `final void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotSameInstanceAs-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html unexpected)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNull--()` `final void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isSameInstanceAs-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html expected)` `https://developer.android.com/reference/java/lang/String.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#toString--()`

## Public methods

### assertThat

```
public static SpannedSubject assertThat(@Nullable Spanned spanned)
```

Convenience method to create a SpannedSubject.

Can be statically imported alongside other Truth `assertThat` methods.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/text/Spanned.html spanned` | The subject under test. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject` | An object for conducting assertions on the subject. |

### hasAbsoluteSizeSpanBetween

```
public SpannedSubject.AbsoluteSized hasAbsoluteSizeSpanBetween(int start, int end)
```

Checks that the subject has a `https://developer.android.com/reference/android/text/style/AbsoluteSizeSpan.html` from `start` to `end`.

The size is asserted in a follow-up method call on the return `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.AbsoluteSized` object.

| Parameters |
|---|---|
| `int start` | The start of the expected span. |
| `int end` | The end of the expected span. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.AbsoluteSized` | A `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.AbsoluteSized` object to assert on the size of the matching spans. |

### hasAlignmentSpanBetween

```
public SpannedSubject.Aligned hasAlignmentSpanBetween(int start, int end)
```

Checks that the subject has a `https://developer.android.com/reference/android/text/style/AlignmentSpan.html` from `start` to `end`.

The alignment is asserted in a follow-up method call on the return `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Aligned` object.

| Parameters |
|---|---|
| `int start` | The start of the expected span. |
| `int end` | The end of the expected span. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Aligned` | A `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Aligned` object to assert on the alignment of the matching spans. |

### hasBackgroundColorSpanBetween

```
public SpannedSubject.Colored hasBackgroundColorSpanBetween(int start, int end)
```

Checks that the subject has a `https://developer.android.com/reference/android/text/style/BackgroundColorSpan.html` from `start` to `end`.

The color is asserted in a follow-up method call on the return `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Colored` object.

| Parameters |
|---|---|
| `int start` | The start of the expected span. |
| `int end` | The end of the expected span. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Colored` | A `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Colored` object to assert on the color of the matching spans. |

### hasBoldItalicSpanBetween

```
public SpannedSubject.WithSpanFlags hasBoldItalicSpanBetween(int start, int end)
```

Checks that the subject has bold and italic styling from `start` to `end`.

This can either be:

- A single `https://developer.android.com/reference/android/text/style/StyleSpan.html` with `span.getStyle() == Typeface.BOLD_ITALIC`.
- Two `https://developer.android.com/reference/android/text/style/StyleSpan.html`s, one with `span.getStyle() == Typeface.BOLD` and the other with `span.getStyle() == Typeface.ITALIC`.

| Parameters |
|---|---|
| `int start` | The start of the expected span. |
| `int end` | The end of the expected span. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.WithSpanFlags` | A `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.WithSpanFlags` object for optional additional assertions on the flags. |

### hasBoldSpanBetween

```
public SpannedSubject.WithSpanFlags hasBoldSpanBetween(int start, int end)
```

Checks that the subject has a bold span from `start` to `end`.

| Parameters |
|---|---|
| `int start` | The start of the expected span. |
| `int end` | The end of the expected span. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.WithSpanFlags` | A `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.WithSpanFlags` object for optional additional assertions on the flags. |

### hasForegroundColorSpanBetween

```
public SpannedSubject.Colored hasForegroundColorSpanBetween(int start, int end)
```

Checks that the subject has a `https://developer.android.com/reference/android/text/style/ForegroundColorSpan.html` from `start` to `end`.

The color is asserted in a follow-up method call on the return `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Colored` object.

| Parameters |
|---|---|
| `int start` | The start of the expected span. |
| `int end` | The end of the expected span. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Colored` | A `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Colored` object to assert on the color of the matching spans. |

### hasHorizontalTextInVerticalContextSpanBetween

```
public SpannedSubject.WithSpanFlags hasHorizontalTextInVerticalContextSpanBetween(int start, int end)
```

Checks that the subject has an `https://developer.android.com/reference/androidx/media3/common/text/HorizontalTextInVerticalContextSpan` from `start` to `end`.

| Parameters |
|---|---|
| `int start` | The start of the expected span. |
| `int end` | The end of the expected span. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.WithSpanFlags` | A `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.WithSpanFlags` object for optional additional assertions on the flags. |

### hasItalicSpanBetween

```
public SpannedSubject.WithSpanFlags hasItalicSpanBetween(int start, int end)
```

Checks that the subject has an italic span from `start` to `end`.

| Parameters |
|---|---|
| `int start` | The start of the expected span. |
| `int end` | The end of the expected span. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.WithSpanFlags` | A `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.WithSpanFlags` object for optional additional assertions on the flags. |

### hasNoAbsoluteSizeSpanBetween

```
public void hasNoAbsoluteSizeSpanBetween(int start, int end)
```

Checks that the subject has no `https://developer.android.com/reference/android/text/style/AbsoluteSizeSpan.html`s on any of the text between ` start` and `end`.

This fails even if the start and end indexes don't exactly match.

| Parameters |
|---|---|
| `int start` | The start index to start searching for spans. |
| `int end` | The end index to stop searching for spans. |

### hasNoAlignmentSpanBetween

```
public void hasNoAlignmentSpanBetween(int start, int end)
```

Checks that the subject has no `https://developer.android.com/reference/android/text/style/AlignmentSpan.html`s on any of the text between `start` and `end`.

This fails even if the start and end indexes don't exactly match.

| Parameters |
|---|---|
| `int start` | The start index to start searching for spans. |
| `int end` | The end index to stop searching for spans. |

### hasNoBackgroundColorSpanBetween

```
public void hasNoBackgroundColorSpanBetween(int start, int end)
```

Checks that the subject has no `https://developer.android.com/reference/android/text/style/BackgroundColorSpan.html`s on any of the text between ` start` and `end`.

This fails even if the start and end indexes don't exactly match.

| Parameters |
|---|---|
| `int start` | The start index to start searching for spans. |
| `int end` | The end index to stop searching for spans. |

### hasNoForegroundColorSpanBetween

```
public void hasNoForegroundColorSpanBetween(int start, int end)
```

Checks that the subject has no `https://developer.android.com/reference/android/text/style/ForegroundColorSpan.html`s on any of the text between ` start` and `end`.

This fails even if the start and end indexes don't exactly match.

| Parameters |
|---|---|
| `int start` | The start index to start searching for spans. |
| `int end` | The end index to stop searching for spans. |

### hasNoHorizontalTextInVerticalContextSpanBetween

```
public void hasNoHorizontalTextInVerticalContextSpanBetween(int start, int end)
```

Checks that the subject has no `https://developer.android.com/reference/androidx/media3/common/text/HorizontalTextInVerticalContextSpan`s on any of the text between `start` and `end`.

This fails even if the start and end indexes don't exactly match.

| Parameters |
|---|---|
| `int start` | The start index to start searching for spans. |
| `int end` | The end index to stop searching for spans. |

### hasNoRelativeSizeSpanBetween

```
public void hasNoRelativeSizeSpanBetween(int start, int end)
```

Checks that the subject has no `https://developer.android.com/reference/android/text/style/RelativeSizeSpan.html`s on any of the text between ` start` and `end`.

This fails even if the start and end indexes don't exactly match.

| Parameters |
|---|---|
| `int start` | The start index to start searching for spans. |
| `int end` | The end index to stop searching for spans. |

### hasNoRubySpanBetween

```
public void hasNoRubySpanBetween(int start, int end)
```

Checks that the subject has no `https://developer.android.com/reference/androidx/media3/common/text/RubySpan`s on any of the text between `start` and `end`.

This fails even if the start and end indexes don't exactly match.

| Parameters |
|---|---|
| `int start` | The start index to start searching for spans. |
| `int end` | The end index to stop searching for spans. |

### hasNoSpans

```
public void hasNoSpans()
```

### hasNoStrikethroughSpanBetween

```
public void hasNoStrikethroughSpanBetween(int start, int end)
```

Checks that the subject has no `https://developer.android.com/reference/android/text/style/StrikethroughSpan.html`s on any of the text between ` start` and `end`.

This fails even if the start and end indexes don't exactly match.

| Parameters |
|---|---|
| `int start` | The start index to start searching for spans. |
| `int end` | The end index to stop searching for spans. |

### hasNoStyleSpanBetween

```
public void hasNoStyleSpanBetween(int start, int end)
```

Checks that the subject has no `https://developer.android.com/reference/android/text/style/StyleSpan.html`s on any of the text between `start` and `end`.

This fails even if the start and end indexes don't exactly match.

| Parameters |
|---|---|
| `int start` | The start index to start searching for spans. |
| `int end` | The end index to stop searching for spans. |

### hasNoTextEmphasisSpanBetween

```
public void hasNoTextEmphasisSpanBetween(int start, int end)
```

Checks that the subject has no `https://developer.android.com/reference/androidx/media3/common/text/TextEmphasisSpan`s on any of the text between ` start` and `end`.

This fails even if the start and end indexes don't exactly match.

| Parameters |
|---|---|
| `int start` | The start index to start searching for spans. |
| `int end` | The end index to stop searching for spans. |

### hasNoTypefaceSpanBetween

```
public void hasNoTypefaceSpanBetween(int start, int end)
```

Checks that the subject has no `https://developer.android.com/reference/android/text/style/TypefaceSpan.html`s on any of the text between `start` and `end`.

This fails even if the start and end indexes don't exactly match.

| Parameters |
|---|---|
| `int start` | The start index to start searching for spans. |
| `int end` | The end index to stop searching for spans. |

### hasNoUnderlineSpanBetween

```
public void hasNoUnderlineSpanBetween(int start, int end)
```

Checks that the subject has no `https://developer.android.com/reference/android/text/style/UnderlineSpan.html`s on any of the text between `start` and `end`.

This fails even if the start and end indexes don't exactly match.

| Parameters |
|---|---|
| `int start` | The start index to start searching for spans. |
| `int end` | The end index to stop searching for spans. |

### hasNoVoiceSpanBetween

```
public void hasNoVoiceSpanBetween(int start, int end)
```

Checks that the subject has no `https://developer.android.com/reference/androidx/media3/common/text/VoiceSpan`s on any of the text between `start` and `end`.

This fails even if the start and end indexes don't exactly match.

| Parameters |
|---|---|
| `int start` | The start index to start searching for spans. |
| `int end` | The end index to stop searching for spans. |

### hasRelativeSizeSpanBetween

```
public SpannedSubject.RelativeSized hasRelativeSizeSpanBetween(int start, int end)
```

Checks that the subject has a `https://developer.android.com/reference/android/text/style/RelativeSizeSpan.html` from `start` to `end`.

The size is asserted in a follow-up method call on the return `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.RelativeSized` object.

| Parameters |
|---|---|
| `int start` | The start of the expected span. |
| `int end` | The end of the expected span. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.RelativeSized` | A `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.RelativeSized` object to assert on the size of the matching spans. |

### hasRubySpanBetween

```
public SpannedSubject.RubyText hasRubySpanBetween(int start, int end)
```

Checks that the subject has a `https://developer.android.com/reference/androidx/media3/common/text/RubySpan` from `start` to `end`.

The ruby-text is asserted in a follow-up method call on the return `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.RubyText` object.

| Parameters |
|---|---|
| `int start` | The start of the expected span. |
| `int end` | The end of the expected span. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.RubyText` | A `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Colored` object to assert on the color of the matching spans. |

### hasStrikethroughSpanBetween

```
public SpannedSubject.WithSpanFlags hasStrikethroughSpanBetween(int start, int end)
```

Checks that the subject has an `https://developer.android.com/reference/android/text/style/StrikethroughSpan.html` from `start` to `end`.

| Parameters |
|---|---|
| `int start` | The start of the expected span. |
| `int end` | The end of the expected span. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.WithSpanFlags` | A `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.WithSpanFlags` object for optional additional assertions on the flags. |

### hasTextEmphasisSpanBetween

```
public SpannedSubject.EmphasizedText hasTextEmphasisSpanBetween(int start, int end)
```

Checks that the subject has an `https://developer.android.com/reference/androidx/media3/common/text/TextEmphasisSpan` from `start` to `end`.

| Parameters |
|---|---|
| `int start` | The start of the expected span. |
| `int end` | The end of the expected span. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.EmphasizedText` | A `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.EmphasizedText` object for optional additional assertions on the flags. |

### hasTypefaceSpanBetween

```
public SpannedSubject.Typefaced hasTypefaceSpanBetween(int start, int end)
```

Checks that the subject has a `https://developer.android.com/reference/android/text/style/TypefaceSpan.html` from `start` to `end`.

The font is asserted in a follow-up method call on the return `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Typefaced` object.

| Parameters |
|---|---|
| `int start` | The start of the expected span. |
| `int end` | The end of the expected span. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Typefaced` | A `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Typefaced` object to assert on the font of the matching spans. |

### hasUnderlineSpanBetween

```
public SpannedSubject.WithSpanFlags hasUnderlineSpanBetween(int start, int end)
```

Checks that the subject has an `https://developer.android.com/reference/android/text/style/UnderlineSpan.html` from `start` to `end`.

| Parameters |
|---|---|
| `int start` | The start of the expected span. |
| `int end` | The end of the expected span. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.WithSpanFlags` | A `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.WithSpanFlags` object for optional additional assertions on the flags. |

### hasVoiceSpanBetween

```
public SpannedSubject.VoiceText hasVoiceSpanBetween(int start, int end)
```

Checks that the subject has an `https://developer.android.com/reference/androidx/media3/common/text/VoiceSpan` from `start` to `end`.

| Parameters |
|---|---|
| `int start` | The start of the expected span. |
| `int end` | The end of the expected span. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.VoiceText` | A `https://developer.android.com/reference/androidx/media3/common/text/VoiceSpan` object for optional additional assertions on the flags. |

### spanned

```
public static Subject.Factory<SpannedSubject, Spanned> spanned()
```