Stay organized with collections
Save and categorize content based on your preferences.
TextBuilder
open class TextBuilder : TtsSpan.SemioticClassBuilder<TtsSpan.TextBuilder!>
A builder for TtsSpans of type TYPE_TEXT
.
Summary
Public constructors |
Creates a builder for a TtsSpan of type TYPE_TEXT .
|
Creates a TtsSpan of type TYPE_TEXT and sets the ARG_TEXT argument.
|
Public constructors
TextBuilder
TextBuilder()
Creates a builder for a TtsSpan of type TYPE_TEXT
.
TextBuilder
TextBuilder(text: String!)
Creates a TtsSpan of type TYPE_TEXT
and sets the ARG_TEXT
argument.
Parameters |
text |
String!: The text to be synthesized. |
Public methods
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,["# TtsSpan.TextBuilder\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nTextBuilder\n===========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/text/style/TtsSpan.TextBuilder \"View this page in Java\") \n\n```\nopen class TextBuilder : TtsSpan.SemioticClassBuilder\u003cTtsSpan.TextBuilder!\u003e\n```\n\n|---|---|---|---------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||||\n| ↳ | [android.text.style.TtsSpan.Builder](/reference/kotlin/android/text/style/TtsSpan.Builder)\\\u003cC\\\u003e |||\n| | ↳ | [android.text.style.TtsSpan.SemioticClassBuilder](/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder)\\\u003c[android.text.style.TtsSpan.TextBuilder](#)\\\u003e ||\n| | | ↳ | [android.text.style.TtsSpan.TextBuilder](#) |\n\nA builder for TtsSpans of type [TYPE_TEXT](/reference/kotlin/android/text/style/TtsSpan#TYPE_TEXT:kotlin.String).\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [TextBuilder](#TextBuilder())`()` Creates a builder for a TtsSpan of type [TYPE_TEXT](/reference/kotlin/android/text/style/TtsSpan#TYPE_TEXT:kotlin.String). |\n| [TextBuilder](#TextBuilder(kotlin.String))`(`text:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Creates a TtsSpan of type [TYPE_TEXT](/reference/kotlin/android/text/style/TtsSpan#TYPE_TEXT:kotlin.String) and sets the [ARG_TEXT](/reference/kotlin/android/text/style/TtsSpan#ARG_TEXT:kotlin.String) argument. |\n\n| Public methods ||\n|--------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [TtsSpan.TextBuilder](#)! | [setText](#setText(kotlin.String))`(`text:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Sets the [ARG_TEXT](/reference/kotlin/android/text/style/TtsSpan#ARG_TEXT:kotlin.String) argument, the text to be synthesized. |\n\n| Inherited functions ||\n|---|---|\n| From class [Builder](/reference/kotlin/android/text/style/TtsSpan.Builder) |----------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [TtsSpan](/reference/kotlin/android/text/style/TtsSpan)! | [build](/reference/kotlin/android/text/style/TtsSpan.Builder#build())`()` Returns a TtsSpan built from the parameters set by the setter methods. \u003cbr /\u003e | | C | [setIntArgument](/reference/kotlin/android/text/style/TtsSpan.Builder#setIntArgument(kotlin.String,%20kotlin.Int))`(`arg:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets an argument to an int value. \u003cbr /\u003e | | C | [setLongArgument](/reference/kotlin/android/text/style/TtsSpan.Builder#setLongArgument(kotlin.String,%20kotlin.Long))`(`arg:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Sets an argument to a long value. \u003cbr /\u003e | | C | [setStringArgument](/reference/kotlin/android/text/style/TtsSpan.Builder#setStringArgument(kotlin.String,%20kotlin.String))`(`arg:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Sets an argument to a string value. \u003cbr /\u003e | ||\n| From class [SemioticClassBuilder](/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder) |---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | C | [setAnimacy](/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder#setAnimacy(kotlin.String))`(`animacy:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Sets the animacy information for this instance. \u003cbr /\u003e | | C | [setCase](/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder#setCase(kotlin.String))`(`grammaticalCase:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Sets the grammatical case information for this instance. \u003cbr /\u003e | | C | [setGender](/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder#setGender(kotlin.String))`(`gender:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Sets the gender information for this instance. \u003cbr /\u003e | | C | [setMultiplicity](/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder#setMultiplicity(kotlin.String))`(`multiplicity:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Sets the multiplicity information for this instance. \u003cbr /\u003e | ||\n\nPublic constructors\n-------------------\n\n### TextBuilder\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nTextBuilder()\n```\n\nCreates a builder for a TtsSpan of type [TYPE_TEXT](/reference/kotlin/android/text/style/TtsSpan#TYPE_TEXT:kotlin.String). \n\n### TextBuilder\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nTextBuilder(text: String!)\n```\n\nCreates a TtsSpan of type [TYPE_TEXT](/reference/kotlin/android/text/style/TtsSpan#TYPE_TEXT:kotlin.String) and sets the [ARG_TEXT](/reference/kotlin/android/text/style/TtsSpan#ARG_TEXT:kotlin.String) argument.\n\n| Parameters ||\n|--------|----------------------------------------------------------------------------------------------------------------|\n| `text` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: The text to be synthesized. |\n\n**See Also**\n\n- [#setText(String)](#setText(kotlin.String))\n\nPublic methods\n--------------\n\n### setText\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun setText(text: String!): TtsSpan.TextBuilder!\n```\n\nSets the [ARG_TEXT](/reference/kotlin/android/text/style/TtsSpan#ARG_TEXT:kotlin.String) argument, the text to be synthesized.\n\n| Parameters ||\n|--------|-------------------------------------------------------------------------------------------------------------------------|\n| `text` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: The string that will be synthesized. |\n\n| Return ||\n|---------------------------|----------------|\n| [TtsSpan.TextBuilder](#)! | This instance. |"]]