[ui-compose] Better KDoc formatting

#cherrypick

PiperOrigin-RevId: 731712846
(cherry picked from commit 66ef013cb85e8d7db5679242190202745abf3110)
This commit is contained in:
jbibik 2025-02-27 07:06:04 -08:00 committed by oceanjules
parent 2cb6d4312b
commit 768f25e163
6 changed files with 25 additions and 30 deletions

View File

@ -28,8 +28,8 @@ import androidx.media3.common.util.UnstableApi
/** /**
* Remembers the value of [NextButtonState] created based on the passed [Player] and launch a * Remembers the value of [NextButtonState] created based on the passed [Player] and launch a
* coroutine to listen to [Player]'s changes. If the [Player] instance changes between compositions, * coroutine to listen to [Player's][Player] changes. If the [Player] instance changes between
* produce and remember a new value. * compositions, produce and remember a new value.
*/ */
@UnstableApi @UnstableApi
@Composable @Composable

View File

@ -23,19 +23,16 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.media3.common.Player import androidx.media3.common.Player
import androidx.media3.common.Timeline
import androidx.media3.common.listen import androidx.media3.common.listen
import androidx.media3.common.util.UnstableApi import androidx.media3.common.util.UnstableApi
import androidx.media3.common.util.Util.handlePauseButtonAction
import androidx.media3.common.util.Util.handlePlayButtonAction
import androidx.media3.common.util.Util.handlePlayPauseButtonAction import androidx.media3.common.util.Util.handlePlayPauseButtonAction
import androidx.media3.common.util.Util.shouldEnablePlayPauseButton import androidx.media3.common.util.Util.shouldEnablePlayPauseButton
import androidx.media3.common.util.Util.shouldShowPlayButton import androidx.media3.common.util.Util.shouldShowPlayButton
/** /**
* Remembers the value of [PlayPauseButtonState] created based on the passed [Player] and launch a * Remembers the value of [PlayPauseButtonState] created based on the passed [Player] and launch a
* coroutine to listen to [Player]'s changes. If the [Player] instance changes between compositions, * coroutine to listen to [Player's][Player] changes. If the [Player] instance changes between
* produce and remember a new value. * compositions, produce and remember a new value.
*/ */
@UnstableApi @UnstableApi
@Composable @Composable
@ -50,7 +47,7 @@ fun rememberPlayPauseButtonState(player: Player): PlayPauseButtonState {
* component representing a PlayPause button. * component representing a PlayPause button.
* *
* @property[isEnabled] determined by `isCommandAvailable(Player.COMMAND_PLAY_PAUSE)` and having * @property[isEnabled] determined by `isCommandAvailable(Player.COMMAND_PLAY_PAUSE)` and having
* something in the [Timeline] to play * something in the [Timeline][androidx.media3.common.Timeline] to play
* @property[showPlay] determined by [shouldShowPlayButton] * @property[showPlay] determined by [shouldShowPlayButton]
*/ */
@UnstableApi @UnstableApi
@ -68,9 +65,9 @@ class PlayPauseButtonState(private val player: Player) {
* The [Player] update that follows can take a form of [Player.play], [Player.pause], * The [Player] update that follows can take a form of [Player.play], [Player.pause],
* [Player.prepare] or [Player.seekToDefaultPosition]. * [Player.prepare] or [Player.seekToDefaultPosition].
* *
* @see [handlePlayButtonAction] * @see [androidx.media3.common.util.Util.handlePlayButtonAction]
* @see [handlePauseButtonAction] * @see [androidx.media3.common.util.Util.handlePauseButtonAction]
* @see [shouldShowPlayButton] * @see [androidx.media3.common.util.Util.shouldShowPlayButton]
*/ */
fun onClick() { fun onClick() {
handlePlayPauseButtonAction(player) handlePlayPauseButtonAction(player)

View File

@ -24,8 +24,6 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.geometry.Size import androidx.compose.ui.geometry.Size
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.Dp
import androidx.media3.common.C import androidx.media3.common.C
import androidx.media3.common.Player import androidx.media3.common.Player
import androidx.media3.common.Timeline import androidx.media3.common.Timeline
@ -35,8 +33,8 @@ import androidx.media3.common.util.UnstableApi
/** /**
* Remembers the value of [PresentationState] created based on the passed [Player] and launches a * Remembers the value of [PresentationState] created based on the passed [Player] and launches a
* coroutine to listen to [Player]'s changes. If the [Player] instance changes between compositions, * coroutine to listen to [Player's][Player] changes. If the [Player] instance changes between
* produces and remembers a new value. * compositions, produces and remembers a new value.
*/ */
@UnstableApi @UnstableApi
@Composable @Composable
@ -52,11 +50,11 @@ fun rememberPresentationState(player: Player): PresentationState {
* *
* @property[videoSizeDp] wraps [Player.getVideoSize] in Compose's [Size], becomes `null` when * @property[videoSizeDp] wraps [Player.getVideoSize] in Compose's [Size], becomes `null` when
* either height or width of the video is zero. Takes into account * either height or width of the video is zero. Takes into account
* [VideoSize.pixelWidthHeightRatio] to return a Size in [Dp], i.e. device-independent pixel. To * [VideoSize.pixelWidthHeightRatio] to return a Size in [Dp][androidx.compose.ui.unit.Dp], i.e.
* use this measurement in Compose's Drawing and Layout stages, convert it into pixels using * device-independent pixel. To use this measurement in Compose's Drawing and Layout stages,
* [Density.toPx]. Note that for cases where `pixelWidthHeightRatio` is not equal to 1, the * convert it into pixels using [Density.toPx][androidx.compose.ui.unit.Density.toPx]. Note that
* rescaling will be down, i.e. reducing the width or the height to achieve the same aspect ratio * for cases where `pixelWidthHeightRatio` is not equal to 1, the rescaling will be down, i.e.
* in square pixels. * reducing the width or the height to achieve the same aspect ratio in square pixels.
* @property[coverSurface] set to false when the Player emits [Player.EVENT_RENDERED_FIRST_FRAME] * @property[coverSurface] set to false when the Player emits [Player.EVENT_RENDERED_FIRST_FRAME]
* and reset back to true on [Player.EVENT_TRACKS_CHANGED] depending on the number and type of * and reset back to true on [Player.EVENT_TRACKS_CHANGED] depending on the number and type of
* tracks. * tracks.

View File

@ -28,8 +28,8 @@ import androidx.media3.common.util.UnstableApi
/** /**
* Remembers the value of [PreviousButtonState] created based on the passed [Player] and launch a * Remembers the value of [PreviousButtonState] created based on the passed [Player] and launch a
* coroutine to listen to [Player]'s changes. If the [Player] instance changes between compositions, * coroutine to listen to [Player's][Player] changes. If the [Player] instance changes between
* produce and remember a new value. * compositions, produce and remember a new value.
*/ */
@UnstableApi @UnstableApi
@Composable @Composable

View File

@ -29,8 +29,8 @@ import androidx.media3.common.util.UnstableApi
/** /**
* Remember the value of [RepeatButtonState] created based on the passed [Player] and launch a * Remember the value of [RepeatButtonState] created based on the passed [Player] and launch a
* coroutine to listen to [Player]'s changes. If the [Player] instance changes between compositions, * coroutine to listen to [Player's][Player] changes. If the [Player] instance changes between
* produce and remember a new value. * compositions, produce and remember a new value.
*/ */
@UnstableApi @UnstableApi
@Composable @Composable
@ -53,9 +53,9 @@ fun rememberRepeatButtonState(
* button is clicked. Defaults to [Player.REPEAT_MODE_OFF], [Player.REPEAT_MODE_ONE], * button is clicked. Defaults to [Player.REPEAT_MODE_OFF], [Player.REPEAT_MODE_ONE],
* [Player.REPEAT_MODE_ALL]. * [Player.REPEAT_MODE_ALL].
* @property[isEnabled] determined by `isCommandAvailable(Player.COMMAND_SET_REPEAT_MODE)` * @property[isEnabled] determined by `isCommandAvailable(Player.COMMAND_SET_REPEAT_MODE)`
* @property[repeatModeState] determined by [Player]'s `repeatMode`. Note that there is no guarantee * @property[repeatModeState] determined by [Player's][Player] `repeatMode`. Note that there is no
* for this state to be one from [toggleModeSequence]. A button click in such case will toggle the * guarantee for this state to be one from [toggleModeSequence]. A button click in such case will
* mode into the first one of [toggleModeSequence]. * toggle the mode into the first one of [toggleModeSequence].
*/ */
@UnstableApi @UnstableApi
class RepeatButtonState( class RepeatButtonState(

View File

@ -28,8 +28,8 @@ import androidx.media3.common.util.UnstableApi
/** /**
* Remember the value of [ShuffleButtonState] created based on the passed [Player] and launch a * Remember the value of [ShuffleButtonState] created based on the passed [Player] and launch a
* coroutine to listen to [Player]'s changes. If the [Player] instance changes between compositions, * coroutine to listen to [Player's][Player] changes. If the [Player] instance changes between
* produce and remember a new value. * compositions, produce and remember a new value.
*/ */
@UnstableApi @UnstableApi
@Composable @Composable
@ -44,7 +44,7 @@ fun rememberShuffleButtonState(player: Player): ShuffleButtonState {
* On/Off button. * On/Off button.
* *
* @property[isEnabled] determined by `isCommandAvailable(Player.COMMAND_SET_SHUFFLE_MODE)` * @property[isEnabled] determined by `isCommandAvailable(Player.COMMAND_SET_SHUFFLE_MODE)`
* @property[shuffleOn] determined by [Player]'s `shuffleModeEnabled` * @property[shuffleOn] determined by [Player's][Player] `shuffleModeEnabled`
*/ */
@UnstableApi @UnstableApi
class ShuffleButtonState(private val player: Player) { class ShuffleButtonState(private val player: Player) {