# AlignmentSpan

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary: [Nested Classes](https://developer.android.com/reference/android/text/style/AlignmentSpan#nestedclasses) \| [Methods](https://developer.android.com/reference/android/text/style/AlignmentSpan#pubmethods)  

# AlignmentSpan

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/text/style/AlignmentSpan "View this page in Kotlin") \|Java


`
public


interface
AlignmentSpan
`


`


implements

`[ParagraphStyle](https://developer.android.com/reference/android/text/style/ParagraphStyle)`


`

|----------------------------------|
| android.text.style.AlignmentSpan |

|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known indirect subclasses [AlignmentSpan.Standard](https://developer.android.com/reference/android/text/style/AlignmentSpan.Standard) |-------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------| | [AlignmentSpan.Standard](https://developer.android.com/reference/android/text/style/AlignmentSpan.Standard) | Default implementation of the [AlignmentSpan](https://developer.android.com/reference/android/text/style/AlignmentSpan). | |

<br />

*** ** * ** ***

Span that allows defining the alignment of text at the paragraph level.

## Summary

|                                                                                                               ### Nested classes                                                                                                               ||
|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [AlignmentSpan.Standard](https://developer.android.com/reference/android/text/style/AlignmentSpan.Standard) Default implementation of the [AlignmentSpan](https://developer.android.com/reference/android/text/style/AlignmentSpan). |

|                                                                                                                    ### Public methods                                                                                                                     ||
|-------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract `[Layout.Alignment](https://developer.android.com/reference/android/text/Layout.Alignment) | ` `[getAlignment](https://developer.android.com/reference/android/text/style/AlignmentSpan#getAlignment())`() ` Returns the alignment of the text. |

## Public methods

### getAlignment

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract Layout.Alignment getAlignment ()
```

Returns the alignment of the text.

<br />

|                                                       Returns                                                        ||
|-------------------------------------------------------------------------------------------|---------------------------|
| [Layout.Alignment](https://developer.android.com/reference/android/text/Layout.Alignment) | the text alignment <br /> |