Stay organized with collections
Save and categorize content based on your preferences.
Standard
open class Standard : TabStopSpan
The default implementation of TabStopSpan that allows setting the offset of the tab stop from the leading margin of the first line of text.
Let's consider that we have the following text: "\tParagraph text beginning with tab." and we want to move the tab stop with 100px. This can be achieved like this:
SpannableString string = new SpannableString("\tParagraph text beginning with tab.");
string.setSpan(new TabStopSpan.Standard(100), 0, string.length(),
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
Text with a tab stop and a
TabStopSpan
Summary
Public constructors
Standard
Standard(offset: Int)
Constructs a TabStopSpan.Standard
based on an offset.
Parameters |
offset |
Int: the offset of the tab stop from the leading margin of the line, in pixels Value is 0 or greater |
Public methods
getTabStop
open fun getTabStop(): Int
Return |
Int |
the offset, in pixels |
toString
open fun toString(): String
Return |
String |
a string representation of the object. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# TabStopSpan.Standard\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nStandard\n========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/text/style/TabStopSpan.Standard \"View this page in Java\") \n\n```\nopen class Standard : TabStopSpan\n```\n\n|---|----------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.text.style.TabStopSpan.Standard](#) |\n\nThe default implementation of TabStopSpan that allows setting the offset of the tab stop from the leading margin of the first line of text.\n\nLet's consider that we have the following text: *\"\\\\tParagraph text beginning with tab.\"* and we want to move the tab stop with 100px. This can be achieved like this: \n\n```kotlin\nSpannableString string = new SpannableString(\"\\tParagraph text beginning with tab.\");\n string.setSpan(new TabStopSpan.Standard(100), 0, string.length(),\n Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);\n```\nText with a tab stop and a `TabStopSpan`\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Standard](#Standard(kotlin.Int))`(`offset:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Constructs a [TabStopSpan.Standard](#) based on an offset. |\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|----------------------------------------|\n| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getTabStop](#getTabStop())`()` \u003cbr /\u003e |\n| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](#toString())`()` \u003cbr /\u003e |\n\nPublic constructors\n-------------------\n\n### Standard\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nStandard(offset: Int)\n```\n\nConstructs a [TabStopSpan.Standard](#) based on an offset.\n\n| Parameters ||\n|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `offset` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the offset of the tab stop from the leading margin of the line, in pixels Value is 0 or greater |\n\nPublic methods\n--------------\n\n### getTabStop\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getTabStop(): Int\n```\n\n| Return ||\n|----------------------------------------------------------------------------|-----------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | the offset, in pixels |\n\n### toString\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun toString(): String\n```\n\n| Return ||\n|----------------------------------------------------------------------------------|----------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |"]]