-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Demonstrate an alternative architectural approach #2431
base: main
Are you sure you want to change the base?
Conversation
… with the Media3 `Player` interface.
This looks promising. If you go to https://github.com/JolandaVerhoef/horologist/actions/workflows/fixup.yml, and run against your branch, it should fix API, screenshots and some lint. |
...e/src/main/java/com/google/android/horologist/mediasample/ui/player/UampMediaPlayerScreen.kt
Outdated
Show resolved
Hide resolved
media/sample/src/main/java/com/google/android/horologist/mediasample/ui/app/UampWearApp.kt
Outdated
Show resolved
Hide resolved
@JolandaVerhoef nice, this is looking promising. |
) { | ||
val player: Player? by newHotnessPlayerScreenViewModel.player.collectAsStateWithLifecycle() | ||
val player by experimentalUiModePlayerScreenViewModel.player.collectAsStateWithLifecycle() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we should use the null pattern* to handle this outside the screen. And rely on the ViewModel to cache the current player on resuming the player activity.
So it's never null, you can always show something, but no media will be shown, no actions enabled, and the screen can check and use that as a loading state if it wants.
Approach is hard-linked with the Media3
Player
interface.WHAT
WHY
HOW
Checklist 📋