Skip to content
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

Open watch app's Now Playing screen when tapping on episode screen's Play icon #990

Merged
merged 2 commits into from
May 24, 2023

Conversation

ashiagr
Copy link
Contributor

@ashiagr ashiagr commented May 23, 2023

Description

This opens watch app's Now Playing screen when tapping on episode screen's Play icon

Testing Instructions

  1. Install the app
  2. Login with an account having podcasts
  3. Open Podcasts -> Podcast -> Episode screen
  4. Tap play on the Episode screen
  5. ✅ Notice that Now playing screen is shown
  6. Comment out lines 243, 245-247 inside EpisodeViewModel's fun onPlayClicked(showStreamingConfirmation: () -> Unit) to show the streaming dialog confirmation
  7. Reinstall the app and repeat steps 3-4
  8. Notice that Streaming confirmation dialog is shown
  9. Tap X
  10. Notice that Streaming confirmation dialog is dismissed and you're not navigated to the Now playing screen
  11. Re-tap play on the Episode screen
  12. Notice that Streaming confirmation dialog is shown
  13. Tap ✔️
  14. ✅ Notice that Now playing screen is shown

Screenshots or Screencast

Screen_recording_20230523_155918.mp4
Screen_recording_20230523_162005.mp4

Checklist

  • If this is a user-facing change, I have added an entry in CHANGELOG.md
  • I have considered whether it makes sense to add tests for my changes
  • All strings that need to be localized are in modules/services/localization/src/main/res/values/strings.xml
  • Any jetpack compose components I added or changed are covered by compose previews

I have tested any UI changes...

  • with different themes
  • with a landscape orientation
  • with the device set to have a large display and font size
  • for accessibility with TalkBack

@ashiagr ashiagr added the [Area] Wear OS watch app label May 23, 2023
@ashiagr ashiagr requested a review from a team as a code owner May 23, 2023 10:52
Base automatically changed from task/825-wear-app-podcast-screen-ui to main May 23, 2023 18:32
Copy link
Contributor

@mchowning mchowning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. This ended up being pretty tricky, and I like how you handled it.

Comment on lines 107 to 108
var showNowPlaying = MutableSharedFlow<Boolean>()
private set
Copy link
Contributor

@mchowning mchowning May 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it might be worth adding a comment here noting that we're using a shared flow here because we need the event to only be sent one time and then discarded? Just to make it clear why we're not using a state flow like we normally do.

Also, the private set var on the mutable flow reads a bit odd to me because I read it as implying that we might want to switch out this flow for an entirely different flow. Maybe something like this would work instead and make it clearer that it's a single flow and we just want it to be updated from inside the view model.

val _showNowPlaying = MutableSharedFlow<Boolean>()
val showNowPlaying = _showNowPlaying.asSharedFlow()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense 👍
Addressed in bd5a809

@ashiagr ashiagr enabled auto-merge May 24, 2023 04:24
@ashiagr ashiagr merged commit 8f74482 into main May 24, 2023
@ashiagr ashiagr deleted the task/825-wear-app-episode-to-now-playing-page branch May 24, 2023 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants