### Example of safeDrawingPadding with systemBarsPadding Source: https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/safeDrawingPadding.modifier This example demonstrates how `safeDrawingPadding` works in conjunction with `systemBarsPadding`. The outer `Box` uses `systemBarsPadding` to avoid the status and navigation bars, while the inner `Box` uses `safeDrawingPadding` to avoid the safe drawing insets. The `WindowCompat.setDecorFitsSystemWindows(window, false)` call is crucial for enabling window insets. ```kotlin import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.safeDrawingPadding import androidx.compose.foundation.layout.systemBars import androidx.compose.foundation.layout.systemBarsPadding import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.core.view.WindowCompat class SampleActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { WindowCompat.setDecorFitsSystemWindows(window, false) super.onCreate(savedInstanceState) setContent { Box(Modifier.background(Color.Black).systemBarsPadding()) { // The app content won't have anything drawing over it, but all the // background not in the status bars will be white. Box(Modifier.background(Color.White).safeDrawingPadding()) { // app content } } } } } ``` -------------------------------- ### Handle Load Start Source: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream Callback invoked when a load operation begins, either for the first time or after a retry. It indicates the retry count. ```kotlin fun onLoadStarted(     loadable: Chunk!,     elapsedRealtimeMs: Long,     loadDurationMs: Long,     retryCount: Int ): Unit ``` -------------------------------- ### Customizing SizeTransform with ContentTransform Source: https://developer.android.com/reference/kotlin/androidx/compose/animation/AnimatedContentTransitionScope This example demonstrates how to customize the SizeTransform of a ContentTransform using the `using` extension function. It applies different keyframe animations for size changes based on the transition between CartState.Collapsed and CartState.Expanded. ```kotlin import androidx.compose.animation.AnimatedContent import androidx.compose.animation.AnimatedContentTransitionScope import androidx.compose.animation.ContentTransform import androidx.compose.animation.SizeTransform import androidx.compose.animation.core.keyframes import androidx.compose.animation.core.tween import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut import androidx.compose.animation.togetherWith import androidx.compose.ui.unit.IntSize // enum class CartState { Expanded, Collapsed } val transitionSpec: AnimatedContentTransitionScope.() -> ContentTransform = { // Fade in with a delay so that it starts after fade out fadeIn(animationSpec = tween(150, delayMillis = 150)) .togetherWith(fadeOut(animationSpec = tween(150))) .using( SizeTransform { initialSize, targetSize -> // Using different SizeTransform for different state change if (CartState.Collapsed isTransitioningTo CartState.Expanded) { keyframes { durationMillis = 500 // Animate to full target width and by 200px in height at 150ms IntSize(targetSize.width, initialSize.height + 200) at 150 } } else { keyframes { durationMillis = 500 // Animate 1/2 the height without changing the width at 150ms. // The width and rest of the height will be animated in the // timeframe between 150ms and duration (i.e. 500ms) IntSize( initialSize.width, (initialSize.height + targetSize.height) / 2, ) at 150 } } } ) } ``` -------------------------------- ### Custom AnimatedContent TransitionSpec Source: https://developer.android.com/reference/kotlin/androidx/compose/animation/AnimatedContentTransitionScope This example demonstrates creating a `transitionSpec` for navigating a nested menu. It establishes a z-order for different menu levels and implies a spatial order using slide directions for navigating to child or parent menus. Ensure `targetContentZIndex` is set appropriately for each state. ```kotlin import androidx.compose.animation.AnimatedContent import androidx.compose.animation.AnimatedContentTransitionScope import androidx.compose.animation.AnimatedContentTransitionScope.SlideDirection import androidx.compose.animation.ContentTransform import androidx.compose.animation.ExitTransition import androidx.compose.animation.core.tween import androidx.compose.animation.togetherWith import androidx.compose.ui.unit.sp // enum class NestedMenuState { Level1, Level2, Level3 } // This is an example of creating a transitionSpec for navigating in a nested menu. The goal // is to 1) establish a z-order for different levels of the menu, and 2) imply a spatial // order between the menus via the different slide direction when navigating to child menu vs // parent menu. See the demos directory of the source code for a full demo. val transitionSpec: AnimatedContentTransitionScope.() -> ContentTransform = { if (initialState < targetState) { // Going from parent menu to child menu, slide towards left slideIntoContainer(towards = SlideDirection.Left) togetherWith // Keep exiting content in place while sliding in the incoming content. ExitTransition.KeepUntilTransitionsFinished } else { // Going from child menu to parent menu, slide towards right. // Slide parent by half amount compared to child menu to create an interesting // parallax visual effect. slideIntoContainer(towards = SlideDirection.Right) { offsetForFullSlide -> offsetForFullSlide / 2 } togetherWith slideOutOfContainer(towards = SlideDirection.Right) } .apply { // Here we can specify the zIndex for the target (i.e. incoming) content. targetContentZIndex = when (targetState) { NestedMenuState.Level1 -> 1f NestedMenuState.Level2 -> 2f NestedMenuState.Level3 -> 3f } } } ``` -------------------------------- ### Custom TransitionSpec for Nested Menus Source: https://developer.android.com/reference/kotlin/androidx/compose/animation/AnimatedContentTransitionScope Example of creating a transitionSpec for navigating a nested menu. It establishes z-order and spatial order using slide directions for parent-child menu navigation. The initialOffset lambda is used to create a parallax effect when navigating back to a parent menu. ```kotlin import androidx.compose.animation.AnimatedContent import androidx.compose.animation.AnimatedContentTransitionScope import androidx.compose.animation.AnimatedContentTransitionScope.SlideDirection import androidx.compose.animation.ContentTransform import androidx.compose.animation.ExitTransition import androidx.compose.animation.core.tween import androidx.compose.animation.togetherWith import androidx.compose.ui.unit.sp // enum class NestedMenuState { Level1, Level2, Level3 } // This is an example of creating a transitionSpec for navigating in a nested menu. The goal // is to 1) establish a z-order for different levels of the menu, and 2) imply a spatial // order between the menus via the different slide direction when navigating to child menu vs // parent menu. See the demos directory of the source code for a full demo. val transitionSpec: AnimatedContentTransitionScope.() -> ContentTransform = { if (initialState < targetState) { // Going from parent menu to child menu, slide towards left slideIntoContainer(towards = SlideDirection.Left) togetherWith // Keep exiting content in place while sliding in the incoming content. ExitTransition.KeepUntilTransitionsFinished } else { // Going from child menu to parent menu, slide towards right. // Slide parent by half amount compared to child menu to create an interesting // parallax visual effect. slideIntoContainer(towards = SlideDirection.Right) { offsetForFullSlide -> offsetForFullSlide / 2 } togetherWith slideOutOfContainer(towards = SlideDirection.Right) } .apply { // Here we can specify the zIndex for the target (i.e. incoming) content. targetContentZIndex = when (targetState) { NestedMenuState.Level1 -> 1f NestedMenuState.Level2 -> 2f NestedMenuState.Level3 -> 3f } } } ``` -------------------------------- ### Get Next Load Position Source: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream Returns the time of the next load operation, or `TIME_END_OF_SOURCE` if loading is complete. ```kotlin fun getNextLoadPositionUs(): Long ``` -------------------------------- ### removeRange(start: Int, end: Int) Source: https://developer.android.com/reference/kotlin/androidx/collection/MutableIntList Removes elements within a specified range (inclusive start, exclusive end) from the MutableIntList. ```APIDOC ## removeRange(start: Int, end: Int) ### Description Removes items from index `start` (inclusive) to `end` (exclusive). ### Parameters - **start** (Int) - The starting index of the range to remove (inclusive). - **end** (Int) - The ending index of the range to remove (exclusive). ### Returns - **Unit** ``` -------------------------------- ### Remove range of elements Source: https://developer.android.com/reference/kotlin/androidx/collection/MutableIntList Removes elements from a start index (inclusive) to an end index (exclusive). Throws exceptions for invalid indices or if start > end. ```kotlin fun removeRange(start: @IntRange(from = 0) Int, end: @IntRange(from = 0) Int): Unit ``` -------------------------------- ### capacity Source: https://developer.android.com/reference/kotlin/androidx/collection/MutableIntList Gets the current capacity of the MutableIntList. ```APIDOC ## capacity ### Description Returns the total number of elements that can be held before the `MutableIntList` must grow. ### Returns - **Int** - The current capacity. ``` -------------------------------- ### onLoadStarted Source: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream Callback invoked when a load operation begins. ```APIDOC ## onLoadStarted ### Description Called when a load has started for the first time or through a retry. This is called for the first time with `retryCount == 0` just **before** the load is started. ### Method ```kotlin fun onLoadStarted( loadable: Chunk!, elapsedRealtimeMs: Long, loadDurationMs: Long, retryCount: Int ): Unit ``` ### Parameters * `loadable` (Chunk!) - The loadable whose load has started. * `elapsedRealtimeMs` (Long) - `elapsedRealtime` when the load attempts to start. * `loadDurationMs` (Long) - The duration in milliseconds of the load since `startLoading` was called. * `retryCount` (Int) - The number of failed attempts since `startLoading` was called (this is zero for the first load attempt). ``` -------------------------------- ### build() Source: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ActionBuilders.AndroidLongExtra.Builder Builds an instance from accumulated values. ```APIDOC ## build() ### Description Builds an instance from accumulated values. ### Function Signature `fun build(): ActionBuilders.AndroidLongExtra` ``` -------------------------------- ### removeRange(start: Int, end: Int) Source: https://developer.android.com/reference/kotlin/androidx/collection/MutableIntList Removes a range of elements from the MutableIntList. ```APIDOC ## removeRange(start: Int, end: Int) ### Description Removes items from index `start` (inclusive) to `end` (exclusive). ### Signature ```kotlin fun removeRange(start: @IntRange(from = 0) Int, end: @IntRange(from = 0) Int): Unit ``` ### Parameters * `start` (Int) - The starting index of the range to remove (inclusive). * `end` (Int) - The ending index of the range to remove (exclusive). ### Throws * `IndexOutOfBoundsException` - if `start` or `end` isn't between 0 and `size`, inclusive. * `IllegalArgumentException` - if `start` is greater than `end`. ``` -------------------------------- ### Builder() Source: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ActionBuilders.AndroidLongExtra.Builder Creates an instance of Builder. ```APIDOC ## Builder() ### Description Creates an instance of `Builder`. ### Constructor `Builder()` ``` -------------------------------- ### Get Buffered Position Source: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream Returns an estimate of the position up to which data is currently buffered. ```kotlin fun getBufferedPositionUs(): Long ``` -------------------------------- ### Get String Representation of ActivityStack Source: https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityStack Returns a string representation of the ActivityStack. Overrides the default toString function. ```kotlin open fun toString(): String ``` -------------------------------- ### continueLoading Source: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream Attempts to continue loading media. ```APIDOC ## continueLoading ### Description Attempts to continue loading. ### Parameters - **loadingInfo** (LoadingInfo!) - The `LoadingInfo` when attempting to continue loading. ### Returns - **Boolean** - True if progress was made, meaning that `getNextLoadPositionUs` will return a different value than prior to the call. False otherwise. ``` -------------------------------- ### Get Hash Code for ActivityStack Source: https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityStack Returns the hash code for this ActivityStack. Overrides the default hashCode function. ```kotlin open fun hashCode(): Int ``` -------------------------------- ### Supported Audio MIME Types Constant Source: https://developer.android.com/reference/kotlin/androidx/media3/muxer/FragmentedMp4Muxer Provides a list of supported MIME types for audio samples. This is useful for validating audio formats before muxing. ```kotlin const val SUPPORTED_AUDIO_SAMPLE_MIME_TYPES: ImmutableList! ``` -------------------------------- ### isReady Source: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream Returns whether data is available to be read. ```APIDOC ## isReady ### Description Returns whether data is available to be read. Note: If the stream has ended then a buffer with the end of stream flag can always be read from `readData`. Hence an ended stream is always ready. ### Returns - **Boolean** - Whether data is available to be read. ``` -------------------------------- ### Get MutableIntList capacity Source: https://developer.android.com/reference/kotlin/androidx/collection/MutableIntList Returns the total number of elements the MutableIntList can hold before its internal storage needs to grow. ```kotlin val capacity: Int ``` -------------------------------- ### Get Adjusted Seek Position Source: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream Adjusts a seek position based on `SeekParameters`, using chunk boundaries as sync points. ```kotlin fun getAdjustedSeekPositionUs( positionUs: Long, seekParameters: SeekParameters! ): Long ``` -------------------------------- ### Supported Video MIME Types Constant Source: https://developer.android.com/reference/kotlin/androidx/media3/muxer/FragmentedMp4Muxer Provides a list of supported MIME types for video samples. This is useful for validating video formats before muxing. ```kotlin const val SUPPORTED_VIDEO_SAMPLE_MIME_TYPES: ImmutableList! ``` -------------------------------- ### Continue Loading Media Source: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream Attempts to continue loading media data for the stream. Returns true if progress was made. ```kotlin fun continueLoading(loadingInfo: LoadingInfo!): Boolean ``` -------------------------------- ### EmbeddingConfiguration isAutoSaveEmbeddingState Property Source: https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingConfiguration Indicates whether auto-save embedding state is enabled. This property is available starting from API level 1.5.0. ```kotlin val isAutoSaveEmbeddingState: Boolean ``` -------------------------------- ### toString Source: https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityStack Returns a string representation of the ActivityStack. ```APIDOC ## fun toString(): String ### Method ``` open fun toString(): String ``` ``` -------------------------------- ### StaticLayoutFactory Source: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/android/package-summary Factory for creating StaticLayout instances. ```APIDOC ## Object: StaticLayoutFactory ### Description Factory for creating StaticLayout instances. ### Usage This object is used to instantiate `StaticLayout` objects, which are responsible for laying out text. ### Methods (No specific methods are detailed in the source, but it's implied to be a factory for `StaticLayout`) ``` -------------------------------- ### EmbeddingConfiguration dimAreaBehavior Property Source: https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingConfiguration Retrieves the requested dim area behavior for embedded activities. This property is available starting from API level 1.4.0. ```kotlin val dimAreaBehavior: EmbeddingConfiguration.DimAreaBehavior ``` -------------------------------- ### Get or Put Value in MutableLongIntMap Source: https://developer.android.com/reference/kotlin/androidx/collection/MutableLongIntMap Returns the value for a key, or computes and inserts a new value if the key is not present. This is an efficient way to ensure a key has a corresponding value. ```kotlin inline Int getOrPut(key: Long, defaultValue: () -> Int) ``` -------------------------------- ### InstantiationException Constructor Source: https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment.InstantiationException Constructs a new InstantiationException with the specified detail message and cause. This exception is thrown when an instantiation failure occurs. ```APIDOC ## InstantiationException(msg: String, cause: Exception?) ### Description Constructs a new `InstantiationException` with the specified detail message and cause. ### Parameters * **msg** (String) - The detail message. * **cause** (Exception?) - The cause of the instantiation failure. ``` -------------------------------- ### Create MutableIntList Source: https://developer.android.com/reference/kotlin/androidx/collection/MutableIntList Creates a MutableIntList with a specified initial capacity. Defaults to 16 if not provided. ```kotlin MutableIntList(initialCapacity: Int = 16) ``` -------------------------------- ### Get or Put Value in MutableLongIntMap Source: https://developer.android.com/reference/kotlin/androidx/collection/MutableLongIntMap Retrieves the value associated with a key. If the key is not found or the value is null, it calls the defaultValue lambda, stores the returned value in the map, and then returns it. This is useful for initializing values that might not exist. ```kotlin inline fun getOrPut(key: Long, defaultValue: () -> Int): Int ``` -------------------------------- ### Implement onAspectRatioUpdated Callback Source: https://developer.android.com/reference/kotlin/androidx/media3/ui/AspectRatioFrameLayout.AspectRatioListener This method is called when the target aspect ratio set via `setAspectRatio` or the view's natural aspect ratio is updated. It provides the target aspect ratio, the view's natural aspect ratio, and a boolean indicating if there's a mismatch that would affect resizing. ```kotlin fun onAspectRatioUpdated(    targetAspectRatio:  Float,     naturalAspectRatio:  Float,     aspectRatioMismatch:  Boolean  ) : Unit ``` -------------------------------- ### ChunkSampleStream Constructor Source: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream Constructs an instance of ChunkSampleStream with various parameters for media loading and playback. ```kotlin ChunkSampleStream( @C.TrackType primaryTrackType: Int, embeddedTrackTypes: IntArray?, embeddedTrackFormats: Array?, chunkSource: T!, callback: SequenceableLoader.Callback!>!, allocator: Allocator!, positionUs: Long, drmSessionManager: DrmSessionManager!, drmEventDispatcher: DrmSessionEventListener.EventDispatcher!, loadErrorHandlingPolicy: LoadErrorHandlingPolicy!, mediaSourceEventDispatcher: MediaSourceEventListener.EventDispatcher!, handleInitialDiscontinuity: Boolean, firstChunkStartTimeUs: Long, downloadExecutor: ReleasableExecutor? ) ``` -------------------------------- ### Is Loading Source: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream Checks if the stream is currently in the process of loading media data. ```kotlin fun isLoading(): Boolean ``` -------------------------------- ### Create Audio and Video Sequence Source: https://developer.android.com/reference/kotlin/androidx/media3/transformer/EditedMediaItemSequence Creates a new EditedMediaItemSequence that includes both audio and video tracks from a list of EditedMediaItems. This is equivalent to using the Builder and explicitly setting track types for audio and video. ```java java-static fun withAudioAndVideoFrom(editedMediaItems: (Mutable)List!): EditedMediaItemSequence! ``` -------------------------------- ### ChunkSampleStream Constructor Source: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream Constructs an instance of ChunkSampleStream. Requires various parameters including track types, chunk source, callback, allocator, DRM management, error handling policy, and an optional download executor. ```kotlin ChunkSampleStream( @C.TrackType primaryTrackType: Int, embeddedTrackTypes: IntArray?, embeddedTrackFormats: Array?, chunkSource: T!, callback: SequenceableLoader.Callback!>!, allocator: Allocator!, positionUs: Long, drmSessionManager: DrmSessionManager!, drmEventDispatcher: DrmSessionEventListener.EventDispatcher!, loadErrorHandlingPolicy: LoadErrorHandlingPolicy!, mediaSourceEventDispatcher: MediaSourceEventListener.EventDispatcher!, handleInitialDiscontinuity: Boolean, firstChunkStartTimeUs: Long, downloadExecutor: ReleasableExecutor? ) ``` -------------------------------- ### Is Ready Source: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream Determines if data is available to be read from the stream. An ended stream is always considered ready. ```kotlin fun isReady(): Boolean ``` -------------------------------- ### Handle Loader Release Source: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream Callback invoked when the Loader has finished its release process. ```kotlin fun onLoaderReleased(): Unit ``` -------------------------------- ### Public Functions Source: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream Provides methods for managing media loading, buffering, seeking, and error handling within a ChunkSampleStream. ```APIDOC ## consumeInitialDiscontinuity() ### Description Consumes a pending initial discontinuity. ### Returns `Boolean` - True if a discontinuity was consumed, false otherwise. ``` ```APIDOC ## continueLoading(loadingInfo: LoadingInfo) ### Description Attempts to continue loading media data. ### Parameters - **loadingInfo** (LoadingInfo) - Information about the current loading state. ### Returns `Boolean` - True if loading was continued, false otherwise. ``` ```APIDOC ## discardBuffer(positionUs: Long, toKeyframe: Boolean) ### Description Discards buffered media up to the specified position. ### Parameters - **positionUs** (Long) - The position in microseconds up to which to discard. - **toKeyframe** (Boolean) - Whether to discard up to the nearest keyframe. ``` ```APIDOC ## discardUpstreamSamplesForClippedDuration(clippedDurationUs: Long) ### Description Discards upstream samples that exceed the given clipped duration of the stream. ### Parameters - **clippedDurationUs** (Long) - The clipped duration in microseconds. ``` ```APIDOC ## getAdjustedSeekPositionUs(positionUs: Long, seekParameters: SeekParameters) ### Description Adjusts a seek position given the specified SeekParameters. ### Parameters - **positionUs** (Long) - The original seek position in microseconds. - **seekParameters** (SeekParameters) - The seek parameters to apply. ### Returns `Long` - The adjusted seek position in microseconds. ``` ```APIDOC ## getBufferedPositionUs() ### Description Returns an estimate of the position up to which data is buffered. ### Returns `Long` - The buffered position in microseconds. ``` ```APIDOC ## getNextLoadPositionUs() ### Description Returns the next load time, or `TIME_END_OF_SOURCE` if loading has finished. ### Returns `Long` - The next load position in microseconds or `TIME_END_OF_SOURCE`. ``` ```APIDOC ## isLoading() ### Description Returns whether the loader is currently loading. ### Returns `Boolean` - True if loading, false otherwise. ``` ```APIDOC ## isReady() ### Description Returns whether data is available to be read. ### Returns `Boolean` - True if data is ready, false otherwise. ``` ```APIDOC ## mayHaveInitialDiscontinuity() ### Description Returns whether there could be a pending initial discontinuity that needs to be consumed by `consumeInitialDiscontinuity`. ### Returns `Boolean` - True if an initial discontinuity may be pending, false otherwise. ``` ```APIDOC ## maybeThrowError() ### Description Throws an error that's preventing data from being read. ### Throws `IOException` - If an error is preventing data from being read. ``` ```APIDOC ## onLoadCanceled(loadable: Chunk, elapsedRealtimeMs: Long, loadDurationMs: Long, released: Boolean) ### Description Called when a load has been canceled. ### Parameters - **loadable** (Chunk) - The canceled loadable. - **elapsedRealtimeMs** (Long) - The real time elapsed since the load started. - **loadDurationMs** (Long) - The duration of the load in milliseconds. - **released** (Boolean) - Whether the loader was released. ``` ```APIDOC ## onLoadCompleted(loadable: Chunk, elapsedRealtimeMs: Long, loadDurationMs: Long) ### Description Called when a load has completed. ### Parameters - **loadable** (Chunk) - The completed loadable. - **elapsedRealtimeMs** (Long) - The real time elapsed since the load started. - **loadDurationMs** (Long) - The duration of the load in milliseconds. ``` ```APIDOC ## onLoadError(loadable: Chunk, elapsedRealtimeMs: Long, loadDurationMs: Long, error: IOException, errorCount: Int) ### Description Called when a load encounters an error. ### Parameters - **loadable** (Chunk) - The loadable that encountered an error. - **elapsedRealtimeMs** (Long) - The real time elapsed since the load started. - **loadDurationMs** (Long) - The duration of the load in milliseconds. - **error** (IOException) - The error that occurred. - **errorCount** (Int) - The number of times this load has errored. ### Returns `Loader.LoadErrorAction` - The action to take in response to the error. ``` ```APIDOC ## onLoadStarted(loadable: Chunk, elapsedRealtimeMs: Long, loadDurationMs: Long, retryCount: Int) ### Description Called when a load has started for the first time or through a retry. ### Parameters - **loadable** (Chunk) - The loadable that started loading. - **elapsedRealtimeMs** (Long) - The real time elapsed since the load started. - **loadDurationMs** (Long) - The duration of the load in milliseconds. - **retryCount** (Int) - The number of retries attempted. ``` ```APIDOC ## onLoaderReleased() ### Description Called when the `Loader` has finished being released. ``` ```APIDOC ## readData(formatHolder: FormatHolder, buffer: DecoderInputBuffer, readFlags: Int) ### Description Attempts to read from the stream. ### Parameters - **formatHolder** (FormatHolder) - A holder for the format. - **buffer** (DecoderInputBuffer) - The buffer to read data into. - **readFlags** (Int) - Flags indicating how to read the data. ### Returns `Int` - The number of bytes read, or a `C.RESULT_` value. ``` ```APIDOC ## reevaluateBuffer(positionUs: Long) ### Description Re-evaluates the buffer given the playback position. ### Parameters - **positionUs** (Long) - The current playback position in microseconds. ``` ```APIDOC ## release() ### Description Releases the stream. ``` ```APIDOC ## release(callback: ChunkSampleStream.ReleaseCallback?) ### Description Releases the stream with an optional callback. ### Parameters - **callback** (ChunkSampleStream.ReleaseCallback?) - The callback to be invoked upon release. ``` ```APIDOC ## seekToUs(positionUs: Long) ### Description Seeks to the specified position in microseconds. ### Parameters - **positionUs** (Long) - The position to seek to in microseconds. ``` ```APIDOC ## selectEmbeddedTrack(positionUs: Long, trackType: Int) ### Description Selects the embedded track, returning a new `EmbeddedSampleStream` from which the track's samples can be consumed. ### Parameters - **positionUs** (Long) - The position in microseconds at which to select the track. - **trackType** (Int) - The type of the track to select. ### Returns `ChunkSampleStream.EmbeddedSampleStream` - A new `EmbeddedSampleStream` for the selected track. ``` ```APIDOC ## setEndPositionUs(endPositionUs: Long) ### Description Sets the end position at which the period stops loading and providing samples. ### Parameters - **endPositionUs** (Long) - The end position in microseconds. ``` ```APIDOC ## setSuppressRead(suppressRead: Boolean) ### Description Sets whether to suppress any read operation from the stream. ### Parameters - **suppressRead** (Boolean) - True to suppress reads, false otherwise. ``` ```APIDOC ## skipData(positionUs: Long) ### Description Attempts to skip to the keyframe before the specified position, or to the end of the stream if `positionUs` is beyond it. ### Parameters - **positionUs** (Long) - The target position in microseconds. ### Returns `Int` - The number of bytes skipped. ``` -------------------------------- ### EditedMediaItemSequence Static Factory Methods Source: https://developer.android.com/reference/kotlin/androidx/media3/transformer/EditedMediaItemSequence Static methods for creating EditedMediaItemSequence instances with specific track configurations. ```APIDOC ## Static Factory Methods ### `withAudioAndVideoFrom` ``` java-static fun withAudioAndVideoFrom(editedMediaItems: (Mutable)List!): EditedMediaItemSequence! ``` Creates a sequence with both audio and video from a list of `EditedMediaItem`s. This is equivalent to using the `Builder` and setting the track types to include `TRACK_TYPE_AUDIO` and `TRACK_TYPE_VIDEO`. The sequence will produce both audio and video output. #### Parameters - **editedMediaItems** (`(Mutable)List!`) - The list of `EditedMediaItem`s to add to the sequence. #### Returns - `EditedMediaItemSequence!` - A new audio and video `EditedMediaItemSequence`. ``` ```APIDOC ### `withAudioFrom` ``` java-static fun withAudioFrom(editedMediaItems: (Mutable)List!): EditedMediaItemSequence! ``` Creates an audio-only sequence from a list of `EditedMediaItem`s. This is equivalent to using the `Builder` and setting the track types to only include `TRACK_TYPE_AUDIO`. The sequence will only produce an audio output. #### Parameters - **editedMediaItems** (`(Mutable)List!`) - The list of `EditedMediaItem`s to add to the sequence. #### Returns - `EditedMediaItemSequence!` - A new audio-only `EditedMediaItemSequence`. ``` ```APIDOC ### `withVideoFrom` ``` java-static fun withVideoFrom(editedMediaItems: (Mutable)List!): EditedMediaItemSequence! ``` Creates an video-only sequence from a list of `EditedMediaItem`s. This is equivalent to using the `Builder` and setting the track types to only include `TRACK_TYPE_VIDEO`. The sequence will only produce a video output. #### Parameters - **editedMediaItems** (`(Mutable)List!`) - The list of `EditedMediaItem`s to add to the sequence. #### Returns - `EditedMediaItemSequence!` - A new video-only `EditedMediaItemSequence`. ``` -------------------------------- ### Check for Initial Discontinuity Source: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream Use this method to determine if there's a pending initial discontinuity that needs to be consumed. ```kotlin fun mayHaveInitialDiscontinuity(): Boolean ``` -------------------------------- ### MutableIntList Constructor Source: https://developer.android.com/reference/kotlin/androidx/collection/MutableIntList Creates a MutableIntList with a specified initial capacity. ```APIDOC ## MutableIntList(initialCapacity: Int) ### Description Creates a `MutableIntList` with a capacity of `initialCapacity`. ### Parameters #### Path Parameters - **initialCapacity** (Int) - Required - The initial capacity of the list. ``` -------------------------------- ### MutableIntList Constructor Source: https://developer.android.com/reference/kotlin/androidx/collection/MutableIntList Creates a MutableIntList with a specified initial capacity. ```APIDOC ## MutableIntList Constructor ### Description Creates a `MutableIntList` with a `capacity` of `initialCapacity`. ### Signature ```kotlin MutableIntList(initialCapacity: Int = 16) ``` ### Parameters * `initialCapacity` (Int) - The initial capacity of the list. Defaults to 16. ``` -------------------------------- ### InstantiationException Constructor Source: https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment.InstantiationException The constructor for InstantiationException, which takes a message string and an optional Exception as a cause. Use this constructor to provide details about the instantiation failure. ```kotlin InstantiationException(msg: String, cause: Exception?) ``` -------------------------------- ### putAll: Add all entries from another map Source: https://developer.android.com/reference/kotlin/androidx/collection/MutableLongIntMap Copies all key-value mappings from the specified map into this map. This is equivalent to calling put for each entry in the source map. ```kotlin fun putAll(from: LongIntMap): Unit ``` -------------------------------- ### ChunkSampleStream Constructor Source: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream Constructs an instance of ChunkSampleStream. ```APIDOC ## ChunkSampleStream Constructor ### Description Constructs an instance of `ChunkSampleStream`. ### Parameters - **primaryTrackType** (Int) - The `type` of the primary track. - **embeddedTrackTypes** (IntArray?) - The types of any embedded tracks, or null. - **embeddedTrackFormats** (Array?) - The formats of the embedded tracks, or null. - **chunkSource** (T!) - A `ChunkSource` from which chunks to load are obtained. - **callback** (SequenceableLoader.Callback!>!) - An `Callback` for the stream. - **allocator** (Allocator!) - An `Allocator` from which allocations can be obtained. - **positionUs** (Long) - The position from which to start loading media. - **drmSessionManager** (DrmSessionManager!) - The `DrmSessionManager` to obtain `DrmSessions` from. - **drmEventDispatcher** (DrmSessionEventListener.EventDispatcher!) - A dispatcher to notify of `DrmSessionEventListener` events. - **loadErrorHandlingPolicy** (LoadErrorHandlingPolicy!) - The `LoadErrorHandlingPolicy`. - **mediaSourceEventDispatcher** (MediaSourceEventListener.EventDispatcher!) - A dispatcher to notify of `MediaSourceEventListener` events. - **handleInitialDiscontinuity** (Boolean) - Whether the stream needs to handle an initial discontinuity if the first chunk can't start at the beginning and needs to preroll data. - **firstChunkStartTimeUs** (Long) - The start time of the first chunk in microseconds, or `TIME_UNSET` if not known yet. - **downloadExecutor** (ReleasableExecutor?) - An optional externally provided `ReleasableExecutor` for loading and extracting media. ``` -------------------------------- ### EditedMediaItemSequence.Builder Source: https://developer.android.com/reference/kotlin/androidx/media3/transformer/EditedMediaItemSequence Provides a builder for creating and configuring EditedMediaItemSequence instances. ```APIDOC ## Class EditedMediaItemSequence.Builder ### Description A builder for instances of `EditedMediaItemSequence`. ### Methods #### `buildUpon()` ``` fun buildUpon(): EditedMediaItemSequence.Builder! ``` Returns a `Builder` initialized with the values of this instance. ``` -------------------------------- ### Size and Counting Source: https://developer.android.com/reference/kotlin/androidx/collection/MutableIntList Methods for determining the number of elements in the list. ```APIDOC ## count() ### Description Returns the number of elements in this list. ### Method `inline Int` ### Usage ```kotlin val list = mutableIntListOf(5, 10, 15) val size = list.count() // size will be 3 ``` ``` ```APIDOC ## count(predicate: (element: Int) -> Boolean) ### Description Counts the number of elements in the list that match the given `predicate`. ### Method `inline Int` ### Usage ```kotlin val list = mutableIntListOf(1, 2, 3, 4, 5) val evenCount = list.count { it % 2 == 0 } // evenCount will be 2 ``` ``` -------------------------------- ### isLoading Source: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream Returns whether the loader is currently loading. ```APIDOC ## isLoading ### Description Returns whether the loader is currently loading. ### Returns - **Boolean** ``` -------------------------------- ### EmbeddingConfiguration toString Function Source: https://developer.android.com/reference/kotlin/androidx/window/embedding/EmbeddingConfiguration Returns a string representation of this EmbeddingConfiguration instance. ```kotlin open fun toString():  String ``` -------------------------------- ### Deprecated from() Function Source: https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting.BooleanUserStyleSetting.BooleanOption A deprecated companion function to create a BooleanOption from a Boolean value. Use Watch Face Format instead. ```kotlin fun ~~from~~(value: Boolean): UserStyleSetting.BooleanUserStyleSetting.BooleanOption ``` -------------------------------- ### Add all elements from IntList using plusAssign Source: https://developer.android.com/reference/kotlin/androidx/collection/MutableIntList Adds all elements from another IntList to the end of the list using the '+=' operator. ```kotlin inline operator fun plusAssign(elements: IntList): Unit ``` -------------------------------- ### Fragment.InstantiationException Class Definition Source: https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment.InstantiationException Defines the InstantiationException class, which extends RuntimeException. This class is used to signal errors during Fragment instantiation. ```kotlin class Fragment.InstantiationException : RuntimeException ``` -------------------------------- ### ChunkSampleStream Constructor Source: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream Constructs a new ChunkSampleStream instance with the specified parameters. ```APIDOC ## ChunkSampleStream Constructor ### Description Constructs an instance of ChunkSampleStream. ### Parameters - **primaryTrackType** (Int) - The primary track type. - **embeddedTrackTypes** (IntArray?) - An array of embedded track types, or null. - **embeddedTrackFormats** (Array?) - An array of embedded track formats, or null. - **chunkSource** (T!) - The ChunkSource providing the media chunks. - **callback** (SequenceableLoader.Callback!>!) - The callback to notify on loading events. - **allocator** (Allocator!) - The allocator for managing buffers. - **positionUs** (Long) - The initial position in microseconds. - **drmSessionManager** (DrmSessionManager!) - The DRM session manager. - **drmEventDispatcher** (DrmSessionEventListener.EventDispatcher!) - The event dispatcher for DRM events. - **loadErrorHandlingPolicy** (LoadErrorHandlingPolicy!) - The policy for handling load errors. - **mediaSourceEventDispatcher** (MediaSourceEventListener.EventDispatcher!) - The event dispatcher for media source events. - **handleInitialDiscontinuity** (Boolean) - Whether to handle an initial discontinuity. - **firstChunkStartTimeUs** (Long) - The start time of the first chunk in microseconds. - **downloadExecutor** (ReleasableExecutor?) - The executor for download operations, or null. ``` -------------------------------- ### putAll Source: https://developer.android.com/reference/kotlin/androidx/collection/MutableLongIntMap Copies all key-value mappings from the specified map into this map. Existing keys in this map will be overwritten by mappings from the source map. ```APIDOC ## putAll ### Description Puts all the key/value mappings in the `from` map into this map. ### Method `putAll` ### Parameters - **from** (LongIntMap) - The map whose entries will be added to this map. ### Code Example ```kotlin fun putAll(from: LongIntMap): Unit ``` ``` -------------------------------- ### DAILY_STEPS Data Source Key Source: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/PlatformHealthSources.Keys Use this constant to access daily step count data. The data resets at midnight according to the device's timezone, which may cause the daily period to exceed or fall short of 24 hours if the timezone changes. ```kotlin @RequiresPermission(value = Manifest.permission.ACTIVITY_RECOGNITION) const val DAILY_STEPS: PlatformDataKey ``` -------------------------------- ### set: Add or update a key-value pair using indexer syntax Source: https://developer.android.com/reference/kotlin/androidx/collection/MutableLongIntMap Provides an alternative syntax for adding or updating a key-value pair using the square bracket operator. Similar to the put method, it replaces the value if the key exists. ```kotlin operator fun set(key: Long, value: Int): Unit ``` -------------------------------- ### DAILY_STEPS Source: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/PlatformHealthSources.Keys The data source key for daily step count data from platform health sources. This is the total step count over a day and it resets when 00:00 is reached (in whatever is the timezone set at that time). This can result in the DAILY period being greater than or less than 24 hours when the timezone of the device is changed. ```APIDOC ## DAILY_STEPS ### Description The data source key for daily step count data from platform health sources. This is the total step count over a day and it resets when 00:00 is reached (in whatever is the timezone set at that time). This can result in the DAILY period being greater than or less than 24 hours when the timezone of the device is changed. ### Permissions Requires `Manifest.permission.ACTIVITY_RECOGNITION`. ### Type `PlatformDataKey` ``` -------------------------------- ### UserStyleSetting.BooleanUserStyleSetting.BooleanOption Source: https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting.BooleanUserStyleSetting.BooleanOption Represents a true or false option in the BooleanUserStyleSetting. This class and its members are deprecated. ```APIDOC ## Class: UserStyleSetting.BooleanUserStyleSetting.BooleanOption ### Description Represents a true or false option in the `BooleanUserStyleSetting`. ### Deprecation Note This class and its members are deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. ### Companion Functions #### `from(value: Boolean)` **Deprecated.** Creates a `BooleanOption` from a boolean value. ### Companion Properties #### `FALSE` **Deprecated.** A constant representing the false option. #### `TRUE` **Deprecated.** A constant representing the true option. ### Functions #### `toString()` **Deprecated.** Returns a string representation of the option. ### Properties #### `value` (Boolean) **Deprecated.** The boolean value this instance represents. ``` -------------------------------- ### TextDefaults Source: https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/TextDefaults The TextDefaults object provides default values for the Text composable, including minimum padding for list content. ```APIDOC ## TextDefaults Contains the default values used by `Text`. ### Public properties * `minimumBottomListContentPadding`: The minimum bottom content padding for the list when a `Text` is placed at the bottom. * `minimumTopListContentPadding`: The minimum top content padding for the list when a `Text` is placed at the top. ``` -------------------------------- ### release with callback Source: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream Releases the stream with an optional callback that is invoked on the loading thread once the loader has been released. ```APIDOC ## release ### Description Releases the stream. This method should be called when the stream is no longer required. Either this method or `release` can be used to release this stream. ### Parameters - **callback** (`ChunkSampleStream.ReleaseCallback?`) - An optional callback to be called on the loading thread once the loader has been released. ``` -------------------------------- ### onAspectRatioUpdated Source: https://developer.android.com/reference/kotlin/androidx/media3/ui/AspectRatioFrameLayout.AspectRatioListener Called when either the target aspect ratio or the view aspect ratio is updated. This callback provides information about the target aspect ratio, the natural aspect ratio of the view, and whether there's a mismatch that would affect resizing. ```APIDOC ## onAspectRatioUpdated ### Description Called when either the target aspect ratio or the view aspect ratio is updated. ### Parameters #### Parameters - **targetAspectRatio** (Float) - The aspect ratio that has been set in `setAspectRatio`. - **naturalAspectRatio** (Float) - The natural aspect ratio of this view (before its width and height are modified to satisfy the target aspect ratio). - **aspectRatioMismatch** (Boolean) - Whether the target and natural aspect ratios differ enough for changing the resize mode to have an effect. ### Returns - **Unit** ``` -------------------------------- ### ContentTransform.using Source: https://developer.android.com/reference/kotlin/androidx/compose/animation/AnimatedContentTransitionScope Customizes the SizeTransform of a given ContentTransform. ```APIDOC ## ContentTransform.using ### Description Customizes the `SizeTransform` of a given `ContentTransform`. ### Signature `infix ContentTransform` | `ContentTransform.using(sizeTransform: SizeTransform?) ### Parameters * `sizeTransform` (SizeTransform?) - The `SizeTransform` to apply to the content transform. ``` -------------------------------- ### Equality and Hashing Source: https://developer.android.com/reference/kotlin/androidx/collection/MutableIntList Methods for comparing lists and generating hash codes. ```APIDOC ## equals(other: Any?) ### Description Returns `true` if `other` is a `IntList` and its contents are identical to this list, `false` otherwise. ### Method `open operator Boolean` ### Usage ```kotlin val list1 = mutableIntListOf(1, 2, 3) val list2 = mutableIntListOf(1, 2, 3) val list3 = mutableIntListOf(3, 2, 1) val areEqual = list1.equals(list2) // areEqual will be true val areDifferent = list1.equals(list3) // areDifferent will be false ``` ``` ```APIDOC ## hashCode() ### Description Returns a hash code value for this list, based on its contents. ### Method `open Int` ### Usage ```kotlin val list = mutableIntListOf(1, 2, 3) val hashCode = list.hashCode() // hashCode will be a specific integer value ``` ``` -------------------------------- ### none() Source: https://developer.android.com/reference/kotlin/androidx/collection/MutableIntList Checks if the list is empty. Returns true if there are no elements, false otherwise. ```APIDOC ## none() ### Description Returns `true` if the collection has no elements in it. ### Method `inline Boolean` ### Returns `Boolean` - `true` if the list is empty, `false` otherwise. ``` -------------------------------- ### consumeInitialDiscontinuity Source: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkSampleStream Consumes a pending initial discontinuity. ```APIDOC ## consumeInitialDiscontinuity ### Description Consumes a pending initial discontinuity. ### Returns - **Boolean** - Whether the stream had an initial discontinuity. ``` -------------------------------- ### addAll(index: Int, elements: IntList) Source: https://developer.android.com/reference/kotlin/androidx/collection/MutableIntList Adds all elements from another IntList at a specific index in the MutableIntList. ```APIDOC ## addAll(index: Int, elements: IntList) ### Description Adds all `elements` from the `IntList` to the `MutableIntList` at the given `index`, shifting over any elements at `index` and after. ### Parameters - **index** (Int) - The index at which to add the elements. Must be between 0 and the current size of the list (inclusive). - **elements** (IntList) - The `IntList` of integers to add. ### Returns - **Boolean** - `true` if the `MutableIntList` was changed. ``` -------------------------------- ### addAll(index: Int, elements: IntList) Source: https://developer.android.com/reference/kotlin/androidx/collection/MutableIntList Adds all elements from another IntList at a specific index in the MutableIntList. ```APIDOC ## addAll(index: Int, elements: IntList) ### Description Adds all `elements` from the `IntList` to the `MutableIntList` at the given `index`, shifting over any elements at `index` and after. ### Signature ```kotlin fun addAll(index: @IntRange(from = 0) Int, elements: IntList): Boolean ``` ### Parameters * `index` (Int) - The index at which to add the elements. Must be between 0 and `size` (inclusive). * `elements` (IntList) - The `IntList` of integers to add. ### Returns * `Boolean` - `true` if the `MutableIntList` was changed or `false` if `elements` was empty. ### Throws * `IndexOutOfBoundsException` - if `index` isn't between 0 and `size`, inclusive. ``` -------------------------------- ### equals Source: https://developer.android.com/reference/kotlin/androidx/window/embedding/ActivityStack Compares this ActivityStack to another object for equality. ```APIDOC ## fun equals(other: Any?): Boolean ### Method ``` open operator fun equals(other: Any?): Boolean ``` ``` -------------------------------- ### plusAssign: Add all entries from another map Source: https://developer.android.com/reference/kotlin/androidx/collection/MutableLongIntMap Appends all key-value pairs from a source map to the current map. This operation modifies the current map in place. ```kotlin inline operator fun plusAssign(from: LongIntMap): Unit ```