diff --git a/README.md b/README.md index 49f254c739..f9edda2149 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,12 @@ Horologist is a group of libraries that aim to supplement Wear OS developers wit --- -## 🎵 Media UI +## 🎵 Media -UI and Data layers for media player. `PlayerScreen` and individual UI components. +Domain model for Media related functionality. `PlayerScreen` and individual UI components. +- [horologist-media](./media) - [horologist-media-ui](./media-ui) -- [horologist-media-data](./media-data) | PlayerScreen | |-------------------------------------------------------------------------------------------------------------------------------| diff --git a/compose-tools/README.md b/compose-tools/README.md index 91f04ced10..f1249ddf97 100644 --- a/compose-tools/README.md +++ b/compose-tools/README.md @@ -1,4 +1,4 @@ -# Testing Library +# Compose Tools Library [![Maven Central](https://img.shields.io/maven-central/v/com.google.android.horologist/horologist-compose-tools)](https://search.maven.org/search?q=g:com.google.android.horologist) diff --git a/docs/media-data.md b/docs/media-data.md index bcea9fc425..47b9f66a87 100644 --- a/docs/media-data.md +++ b/docs/media-data.md @@ -1,5 +1,9 @@ # Media Data library +[![Maven Central](https://img.shields.io/maven-central/v/com.google.android.horologist/horologist-media-data)](https://search.maven.org/search?q=g:com.google.android.horologist) + +For more information, visit the documentation: https://google.github.io/horologist/media-data + ## Download ```groovy diff --git a/docs/media-playerscreen.md b/docs/media-playerscreen.md index 782a4f9643..c0bc8c62a8 100644 --- a/docs/media-playerscreen.md +++ b/docs/media-playerscreen.md @@ -20,14 +20,18 @@ also called on the `Player` (see `setPlaybackSpeed`). class PlayerRepositoryImpl( private val player: Player ) : PlayerRepository { - - private var _playing = MutableStateFlow(false) - override val isPlaying: StateFlow = _playing + + private val _currentState: MutableStateFlow = MutableStateFlow(PlayerState.Idle) + override val currentState: StateFlow = _currentState private val listener = object : Player.Listener { override fun onIsPlayingChanged(isPlaying: Boolean) { - _playing.value = isPlaying + _currentState.value = if (isPlaying) { + PlayerState.Playing + } else { + PlayerState.Ready + } } } diff --git a/docs/media-ui/playerscreen.png b/docs/media-ui/playerscreen.png index b9461340f1..d10686d16b 100644 Binary files a/docs/media-ui/playerscreen.png and b/docs/media-ui/playerscreen.png differ diff --git a/docs/media.md b/docs/media.md new file mode 100644 index 0000000000..3b8a48863e --- /dev/null +++ b/docs/media.md @@ -0,0 +1,13 @@ +# Media library + +## Download + +```groovy +repositories { + mavenCentral() +} + +dependencies { + implementation "com.google.android.horologist:horologist-media:" +} +``` diff --git a/media/README.md b/media/README.md new file mode 100644 index 0000000000..0046eef123 --- /dev/null +++ b/media/README.md @@ -0,0 +1,17 @@ +# Media library + +[![Maven Central](https://img.shields.io/maven-central/v/com.google.android.horologist/horologist-media)](https://search.maven.org/search?q=g:com.google.android.horologist) + +For more information, visit the documentation: https://google.github.io/horologist/media + +## Download + +```groovy +repositories { + mavenCentral() +} + +dependencies { + implementation "com.google.android.horologist:horologist-media:" +} +``` diff --git a/mkdocs.yml b/mkdocs.yml index 6e2b84077c..78a5f6d119 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -23,8 +23,9 @@ nav: - 'Compose Layout': - 'Guide': compose-layout.md - 'Media': - - 'Media UI Guide': media-ui.md - - 'Media Data Guide': media-data.md + - 'Domain Guide': media.md + - 'UI Guide': media-ui.md + - 'Data Guide': media-data.md - 'Stateful PlayerScreen Guide': media-playerscreen.md - 'Tiles': - 'Guide': tiles.md