Stay organized with collections
Save and categorize content based on your preferences.
DurationBuilder
open class DurationBuilder : TtsSpan.SemioticClassBuilder<TtsSpan.DurationBuilder!>
A builder for TtsSpans of type TYPE_DURATION
.
Summary
Public constructors |
Creates a builder for a TtsSpan of type TYPE_DURATION .
|
Public constructors
DurationBuilder
DurationBuilder()
Creates a builder for a TtsSpan of type TYPE_DURATION
.
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-03-13 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-03-13 UTC."],[],[],null,["# TtsSpan.DurationBuilder\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nDurationBuilder\n===============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/text/style/TtsSpan.DurationBuilder \"View this page in Java\") \n\n```\nopen class DurationBuilder : TtsSpan.SemioticClassBuilder\u003cTtsSpan.DurationBuilder!\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.DurationBuilder](#)\\\u003e ||\n| | | ↳ | [android.text.style.TtsSpan.DurationBuilder](#) |\n\nA builder for TtsSpans of type [TYPE_DURATION](/reference/kotlin/android/text/style/TtsSpan#TYPE_DURATION:kotlin.String).\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [DurationBuilder](#DurationBuilder())`()` Creates a builder for a TtsSpan of type [TYPE_DURATION](/reference/kotlin/android/text/style/TtsSpan#TYPE_DURATION:kotlin.String). |\n\n| Public methods ||\n|-----------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [TtsSpan.DurationBuilder](#) | [setHours](#setHours(kotlin.Int))`(`hours:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the [ARG_HOURS](/reference/kotlin/android/text/style/TtsSpan#ARG_HOURS:kotlin.String) argument. |\n| open [TtsSpan.DurationBuilder](#) | [setMinutes](#setMinutes(kotlin.Int))`(`minutes:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the [ARG_MINUTES](/reference/kotlin/android/text/style/TtsSpan#ARG_MINUTES:kotlin.String) argument. |\n| open [TtsSpan.DurationBuilder](#) | [setSeconds](#setSeconds(kotlin.Int))`(`seconds:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the [ARG_SECONDS](/reference/kotlin/android/text/style/TtsSpan#ARG_SECONDS:kotlin.String) argument. |\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### DurationBuilder\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nDurationBuilder()\n```\n\nCreates a builder for a TtsSpan of type [TYPE_DURATION](/reference/kotlin/android/text/style/TtsSpan#TYPE_DURATION:kotlin.String).\n\nPublic methods\n--------------\n\n### setHours\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun setHours(hours: Int): TtsSpan.DurationBuilder\n```\n\nSets the [ARG_HOURS](/reference/kotlin/android/text/style/TtsSpan#ARG_HOURS:kotlin.String) argument.\n\n| Parameters ||\n|---------|------------------------------------------------------------------------------------------------------------|\n| `hours` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The value to be set for hours. |\n\n| Return ||\n|------------------------------|---------------------------------------------|\n| [TtsSpan.DurationBuilder](#) | This instance. This value cannot be `null`. |\n\n### setMinutes\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun setMinutes(minutes: Int): TtsSpan.DurationBuilder\n```\n\nSets the [ARG_MINUTES](/reference/kotlin/android/text/style/TtsSpan#ARG_MINUTES:kotlin.String) argument.\n\n| Parameters ||\n|-----------|--------------------------------------------------------------------------------------------------------------|\n| `minutes` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The value to be set for minutes. |\n\n| Return ||\n|------------------------------|---------------------------------------------|\n| [TtsSpan.DurationBuilder](#) | This instance. This value cannot be `null`. |\n\n### setSeconds\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun setSeconds(seconds: Int): TtsSpan.DurationBuilder\n```\n\nSets the [ARG_SECONDS](/reference/kotlin/android/text/style/TtsSpan#ARG_SECONDS:kotlin.String) argument.\n\n| Parameters ||\n|-----------|--------------------------------------------------------------------------------------------------------------|\n| `seconds` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The value to be set for seconds. |\n\n| Return ||\n|------------------------------|---------------------------------------------|\n| [TtsSpan.DurationBuilder](#) | This instance. This value cannot be `null`. |"]]