Stay organized with collections
Save and categorize content based on your preferences.
CaptioningChangeListener
abstract class CaptioningChangeListener
Listener for changes in captioning properties, including enabled state and user style preferences.
Summary
Public methods |
open Unit |
Called when the captioning enabled state changes.
|
open Unit |
Called when the captioning font scaling factor changes.
|
open Unit |
Called when the captioning locale changes.
|
open Unit |
Called when the system audio caption enabled state changes.
|
open Unit |
Called when the system audio caption UI enabled state changes.
|
open Unit |
Called when the captioning user style changes.
|
Public constructors
CaptioningChangeListener
CaptioningChangeListener()
Public methods
onEnabledChanged
open fun onEnabledChanged(enabled: Boolean): Unit
Called when the captioning enabled state changes.
Parameters |
enabled |
Boolean: the user's new preferred captioning enabled state |
onFontScaleChanged
open fun onFontScaleChanged(fontScale: Float): Unit
Called when the captioning font scaling factor changes.
Parameters |
fontScale |
Float: the preferred font scaling factor |
onLocaleChanged
open fun onLocaleChanged(locale: Locale?): Unit
Called when the captioning locale changes.
Parameters |
locale |
Locale?: the preferred captioning locale, or null if not specified |
onSystemAudioCaptioningChanged
open fun onSystemAudioCaptioningChanged(enabled: Boolean): Unit
Called when the system audio caption enabled state changes.
Parameters |
enabled |
Boolean: the system audio caption enabled state |
onSystemAudioCaptioningUiChanged
open fun onSystemAudioCaptioningUiChanged(enabled: Boolean): Unit
Called when the system audio caption UI enabled state changes.
Parameters |
enabled |
Boolean: the system audio caption UI enabled state |
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,["# CaptioningManager.CaptioningChangeListener\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nCaptioningChangeListener\n========================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/view/accessibility/CaptioningManager.CaptioningChangeListener \"View this page in Java\") \n\n```\nabstract class CaptioningChangeListener\n```\n\n|---|----------------------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.view.accessibility.CaptioningManager.CaptioningChangeListener](#) |\n\nListener for changes in captioning properties, including enabled state and user style preferences.\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------------------------|---|\n| [CaptioningChangeListener](#CaptioningChangeListener())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onEnabledChanged](#onEnabledChanged(kotlin.Boolean))`(`enabled:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Called when the captioning enabled state changes. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onFontScaleChanged](#onFontScaleChanged(kotlin.Float))`(`fontScale:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` Called when the captioning font scaling factor changes. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onLocaleChanged](#onLocaleChanged(java.util.Locale))`(`locale:` `[Locale](../../../java/util/Locale.html#)?`)` Called when the captioning locale changes. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onSystemAudioCaptioningChanged](#onSystemAudioCaptioningChanged(kotlin.Boolean))`(`enabled:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Called when the system audio caption enabled state changes. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onSystemAudioCaptioningUiChanged](#onSystemAudioCaptioningUiChanged(kotlin.Boolean))`(`enabled:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Called when the system audio caption UI enabled state changes. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onUserStyleChanged](#onUserStyleChanged(android.view.accessibility.CaptioningManager.CaptionStyle))`(`userStyle:` `[CaptioningManager.CaptionStyle](/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle)`)` Called when the captioning user style changes. |\n\nPublic constructors\n-------------------\n\n### CaptioningChangeListener\n\n```\nCaptioningChangeListener()\n```\n\nPublic methods\n--------------\n\n### onEnabledChanged\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onEnabledChanged(enabled: Boolean): Unit\n```\n\nCalled when the captioning enabled state changes.\n\n| Parameters ||\n|-----------|---------------------------------------------------------------------------------------------------------------------------------------|\n| `enabled` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): the user's new preferred captioning enabled state |\n\n### onFontScaleChanged\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onFontScaleChanged(fontScale: Float): Unit\n```\n\nCalled when the captioning font scaling factor changes.\n\n| Parameters ||\n|-------------|-------------------------------------------------------------------------------------------------------------------|\n| `fontScale` | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html): the preferred font scaling factor |\n\n**See Also**\n\n- [android.view.accessibility.CaptioningManager#getFontScale()](/reference/kotlin/android/view/accessibility/CaptioningManager#getFontScale()) \n\n### onLocaleChanged\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onLocaleChanged(locale: Locale?): Unit\n```\n\nCalled when the captioning locale changes.\n\n| Parameters ||\n|----------|---------------------------------------------------------------------------------------------------------|\n| `locale` | [Locale](../../../java/util/Locale.html#)?: the preferred captioning locale, or `null` if not specified |\n\n**See Also**\n\n- [android.view.accessibility.CaptioningManager#getLocale()](/reference/kotlin/android/view/accessibility/CaptioningManager#getLocale()) \n\n### onSystemAudioCaptioningChanged\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onSystemAudioCaptioningChanged(enabled: Boolean): Unit\n```\n\nCalled when the system audio caption enabled state changes.\n\n| Parameters ||\n|-----------|----------------------------------------------------------------------------------------------------------------------------|\n| `enabled` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): the system audio caption enabled state |\n\n### onSystemAudioCaptioningUiChanged\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onSystemAudioCaptioningUiChanged(enabled: Boolean): Unit\n```\n\nCalled when the system audio caption UI enabled state changes.\n\n| Parameters ||\n|-----------|-------------------------------------------------------------------------------------------------------------------------------|\n| `enabled` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): the system audio caption UI enabled state |\n\n### onUserStyleChanged\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onUserStyleChanged(userStyle: CaptioningManager.CaptionStyle): Unit\n```\n\nCalled when the captioning user style changes.\n\n| Parameters ||\n|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `userStyle` | [CaptioningManager.CaptionStyle](/reference/kotlin/android/view/accessibility/CaptioningManager.CaptionStyle): the user's new preferred style This value cannot be `null`. |\n\n**See Also**\n\n- [android.view.accessibility.CaptioningManager#getUserStyle()](/reference/kotlin/android/view/accessibility/CaptioningManager#getUserStyle())"]]