# SpannedSubject.Aligned

# SpannedSubject.Aligned

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.Aligned)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/test/utils/truth/SpannedSubject.Aligned "View this page in Java")

<br />

```
interface SpannedSubject.Aligned
```

<br />

*** ** * ** ***

Allows assertions about the alignment of a span.

## Summary

|                                                             ### Public functions                                                              |
|-----------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SpannedSubject.AndSpanFlags](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/truth/SpannedSubject.AndSpanFlags)`!` | [withAlignment](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/truth/SpannedSubject.Aligned#withAlignment(android.text.Layout.Alignment))`(alignment: `[Layout.Alignment](https://developer.android.com/reference/android/text/Layout.Alignment.html)`!)` Checks that at least one of the matched spans has the expected`alignment`. |

## Public functions

### withAlignment

```
fun withAlignment(alignment: Layout.Alignment!): SpannedSubject.AndSpanFlags!
```

Checks that at least one of the matched spans has the expected`alignment`.  

|                                                   Parameters                                                   |
|----------------------------------------------------------------------------------------------------------------|-------------------------|
| `alignment: `[Layout.Alignment](https://developer.android.com/reference/android/text/Layout.Alignment.html)`!` | The expected alignment. |

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