Skip to content

Commit 66ef013

Browse files
oceanjulescopybara-github
authored andcommitted
[ui-compose] Better KDoc formatting
#cherrypick PiperOrigin-RevId: 731712846
1 parent 1ac82d9 commit 66ef013

6 files changed

Lines changed: 25 additions & 30 deletions

File tree

libraries/ui_compose/src/main/java/androidx/media3/ui/compose/state/NextButtonState.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import androidx.media3.common.util.UnstableApi
2828

2929
/**
3030
* Remembers the value of [NextButtonState] created based on the passed [Player] and launch a
31-
* coroutine to listen to [Player]'s changes. If the [Player] instance changes between compositions,
32-
* produce and remember a new value.
31+
* coroutine to listen to [Player's][Player] changes. If the [Player] instance changes between
32+
* compositions, produce and remember a new value.
3333
*/
3434
@UnstableApi
3535
@Composable

libraries/ui_compose/src/main/java/androidx/media3/ui/compose/state/PlayPauseButtonState.kt

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,16 @@ import androidx.compose.runtime.mutableStateOf
2323
import androidx.compose.runtime.remember
2424
import androidx.compose.runtime.setValue
2525
import androidx.media3.common.Player
26-
import androidx.media3.common.Timeline
2726
import androidx.media3.common.listen
2827
import androidx.media3.common.util.UnstableApi
29-
import androidx.media3.common.util.Util.handlePauseButtonAction
30-
import androidx.media3.common.util.Util.handlePlayButtonAction
3128
import androidx.media3.common.util.Util.handlePlayPauseButtonAction
3229
import androidx.media3.common.util.Util.shouldEnablePlayPauseButton
3330
import androidx.media3.common.util.Util.shouldShowPlayButton
3431

3532
/**
3633
* Remembers the value of [PlayPauseButtonState] created based on the passed [Player] and launch a
37-
* coroutine to listen to [Player]'s changes. If the [Player] instance changes between compositions,
38-
* produce and remember a new value.
34+
* coroutine to listen to [Player's][Player] changes. If the [Player] instance changes between
35+
* compositions, produce and remember a new value.
3936
*/
4037
@UnstableApi
4138
@Composable
@@ -50,7 +47,7 @@ fun rememberPlayPauseButtonState(player: Player): PlayPauseButtonState {
5047
* component representing a PlayPause button.
5148
*
5249
* @property[isEnabled] determined by `isCommandAvailable(Player.COMMAND_PLAY_PAUSE)` and having
53-
* something in the [Timeline] to play
50+
* something in the [Timeline][androidx.media3.common.Timeline] to play
5451
* @property[showPlay] determined by [shouldShowPlayButton]
5552
*/
5653
@UnstableApi
@@ -68,9 +65,9 @@ class PlayPauseButtonState(private val player: Player) {
6865
* The [Player] update that follows can take a form of [Player.play], [Player.pause],
6966
* [Player.prepare] or [Player.seekToDefaultPosition].
7067
*
71-
* @see [handlePlayButtonAction]
72-
* @see [handlePauseButtonAction]
73-
* @see [shouldShowPlayButton]
68+
* @see [androidx.media3.common.util.Util.handlePlayButtonAction]
69+
* @see [androidx.media3.common.util.Util.handlePauseButtonAction]
70+
* @see [androidx.media3.common.util.Util.shouldShowPlayButton]
7471
*/
7572
fun onClick() {
7673
handlePlayPauseButtonAction(player)

libraries/ui_compose/src/main/java/androidx/media3/ui/compose/state/PresentationState.kt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ import androidx.compose.runtime.mutableStateOf
2424
import androidx.compose.runtime.remember
2525
import androidx.compose.runtime.setValue
2626
import androidx.compose.ui.geometry.Size
27-
import androidx.compose.ui.unit.Density
28-
import androidx.compose.ui.unit.Dp
2927
import androidx.media3.common.C
3028
import androidx.media3.common.Player
3129
import androidx.media3.common.Timeline
@@ -35,8 +33,8 @@ import androidx.media3.common.util.UnstableApi
3533

3634
/**
3735
* Remembers the value of [PresentationState] created based on the passed [Player] and launches a
38-
* coroutine to listen to [Player]'s changes. If the [Player] instance changes between compositions,
39-
* produces and remembers a new value.
36+
* coroutine to listen to [Player's][Player] changes. If the [Player] instance changes between
37+
* compositions, produces and remembers a new value.
4038
*/
4139
@UnstableApi
4240
@Composable
@@ -52,11 +50,11 @@ fun rememberPresentationState(player: Player): PresentationState {
5250
*
5351
* @property[videoSizeDp] wraps [Player.getVideoSize] in Compose's [Size], becomes `null` when
5452
* either height or width of the video is zero. Takes into account
55-
* [VideoSize.pixelWidthHeightRatio] to return a Size in [Dp], i.e. device-independent pixel. To
56-
* use this measurement in Compose's Drawing and Layout stages, convert it into pixels using
57-
* [Density.toPx]. Note that for cases where `pixelWidthHeightRatio` is not equal to 1, the
58-
* rescaling will be down, i.e. reducing the width or the height to achieve the same aspect ratio
59-
* in square pixels.
53+
* [VideoSize.pixelWidthHeightRatio] to return a Size in [Dp][androidx.compose.ui.unit.Dp], i.e.
54+
* device-independent pixel. To use this measurement in Compose's Drawing and Layout stages,
55+
* convert it into pixels using [Density.toPx][androidx.compose.ui.unit.Density.toPx]. Note that
56+
* for cases where `pixelWidthHeightRatio` is not equal to 1, the rescaling will be down, i.e.
57+
* reducing the width or the height to achieve the same aspect ratio in square pixels.
6058
* @property[coverSurface] set to false when the Player emits [Player.EVENT_RENDERED_FIRST_FRAME]
6159
* and reset back to true on [Player.EVENT_TRACKS_CHANGED] depending on the number and type of
6260
* tracks.

libraries/ui_compose/src/main/java/androidx/media3/ui/compose/state/PreviousButtonState.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import androidx.media3.common.util.UnstableApi
2828

2929
/**
3030
* Remembers the value of [PreviousButtonState] created based on the passed [Player] and launch a
31-
* coroutine to listen to [Player]'s changes. If the [Player] instance changes between compositions,
32-
* produce and remember a new value.
31+
* coroutine to listen to [Player's][Player] changes. If the [Player] instance changes between
32+
* compositions, produce and remember a new value.
3333
*/
3434
@UnstableApi
3535
@Composable

libraries/ui_compose/src/main/java/androidx/media3/ui/compose/state/RepeatButtonState.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ import androidx.media3.common.util.UnstableApi
2929

3030
/**
3131
* Remember the value of [RepeatButtonState] created based on the passed [Player] and launch a
32-
* coroutine to listen to [Player]'s changes. If the [Player] instance changes between compositions,
33-
* produce and remember a new value.
32+
* coroutine to listen to [Player's][Player] changes. If the [Player] instance changes between
33+
* compositions, produce and remember a new value.
3434
*/
3535
@UnstableApi
3636
@Composable
@@ -53,9 +53,9 @@ fun rememberRepeatButtonState(
5353
* button is clicked. Defaults to [Player.REPEAT_MODE_OFF], [Player.REPEAT_MODE_ONE],
5454
* [Player.REPEAT_MODE_ALL].
5555
* @property[isEnabled] determined by `isCommandAvailable(Player.COMMAND_SET_REPEAT_MODE)`
56-
* @property[repeatModeState] determined by [Player]'s `repeatMode`. Note that there is no guarantee
57-
* for this state to be one from [toggleModeSequence]. A button click in such case will toggle the
58-
* mode into the first one of [toggleModeSequence].
56+
* @property[repeatModeState] determined by [Player's][Player] `repeatMode`. Note that there is no
57+
* guarantee for this state to be one from [toggleModeSequence]. A button click in such case will
58+
* toggle the mode into the first one of [toggleModeSequence].
5959
*/
6060
@UnstableApi
6161
class RepeatButtonState(

libraries/ui_compose/src/main/java/androidx/media3/ui/compose/state/ShuffleButtonState.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import androidx.media3.common.util.UnstableApi
2828

2929
/**
3030
* Remember the value of [ShuffleButtonState] created based on the passed [Player] and launch a
31-
* coroutine to listen to [Player]'s changes. If the [Player] instance changes between compositions,
32-
* produce and remember a new value.
31+
* coroutine to listen to [Player's][Player] changes. If the [Player] instance changes between
32+
* compositions, produce and remember a new value.
3333
*/
3434
@UnstableApi
3535
@Composable
@@ -44,7 +44,7 @@ fun rememberShuffleButtonState(player: Player): ShuffleButtonState {
4444
* On/Off button.
4545
*
4646
* @property[isEnabled] determined by `isCommandAvailable(Player.COMMAND_SET_SHUFFLE_MODE)`
47-
* @property[shuffleOn] determined by [Player]'s `shuffleModeEnabled`
47+
* @property[shuffleOn] determined by [Player's][Player] `shuffleModeEnabled`
4848
*/
4949
@UnstableApi
5050
class ShuffleButtonState(private val player: Player) {

0 commit comments

Comments
 (0)