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

Add new Medium "Now Playing" widget #1876

Merged
merged 15 commits into from
Aug 26, 2024
Merged

Conversation

jgcaruso
Copy link
Contributor

@jgcaruso jgcaruso commented Jul 4, 2024

Follow up to #1343 that introduces the new medium Now Playing widget from Lkt7fuf9Nq3XvfAFPCfpTD-fi-995_4119

Also adapts the existing "nothing playing" view for the medium size.

iOS 17

light dark
Simulator Screenshot - iPhone 15 Plus - 2024-07-04 at 14 54 43 Simulator Screenshot - iPhone 15 Plus - 2024-07-04 at 14 55 18

iOS 16

light dark
Simulator Screenshot - iPhone SE (3rd generation) - 2024-07-04 at 15 42 59 Simulator Screenshot - iPhone SE (3rd generation) - 2024-07-04 at 15 42 35

Nothing Playing

light dark
Simulator Screenshot - iPhone 15 Plus - 2024-08-01 at 16 23 14 Simulator Screenshot - iPhone 15 Plus - 2024-08-01 at 16 23 00

To test

  1. pull branch, build and run on device or simulator
  2. Open the widget chooser, scroll through the options for Pocket Casts. You should see the new medium Now Playing widget in both styles after the "small" variation
  3. Add one (or both) to your home screen
  4. The widget should match the designs
  5. If you added the white version, flipping into "dark" mode should turn it black. Or if it was already black, flipping into "light" mode should turn it white.
  6. In iOS 17, the widget should be interactive. Tapping play should start the podcast, tapping pause should stop it.
    • tapping anywhere else should open Pocket Casts to the episode
  7. In iOS 16, tapping anywhere should open Pocket Casts to the episode
  8. When there isn't a "Now Playing" episode, the default state will match the "small" size and simply show the current Pocket Casts icon -- Waiting on design to review this since it won't work well as-is if a custom icon is chosen p1720121313396209-slack-C05RR9P9RAT

NOTE: I'm not entirely sure when showsWidgetContainerBackground will ever be false for these widgets, but if you want to simulate that you can set Line 8 of NowPlayingEntryView.swift force var showsWidgetBackground = false and then see how it renders. It won't be pretty because padding is removed for some reason, but that isn't done as part of this PR.

Checklist

  • I have considered if this change warrants user-facing release notes and have added them to CHANGELOG.md if necessary.
  • I have considered adding unit tests for my changes.
  • I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.

@jgcaruso jgcaruso self-assigned this Jul 4, 2024
Comment on lines 22 to 25
if family == .systemSmall {
smallWidget(playingEpisode: playingEpisode)
} else {
mediumWidget(playingEpisode: playingEpisode)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit:
I would use a switch here when dealing with enums

@danielebogo
Copy link
Contributor

Following the test instructions, it worked as described 👌

@jgcaruso jgcaruso marked this pull request as ready for review August 1, 2024 21:00
@jgcaruso jgcaruso requested a review from a team as a code owner August 1, 2024 21:00
@jgcaruso jgcaruso requested review from bjtitus and danielebogo and removed request for a team August 1, 2024 21:00
@danielebogo danielebogo added this to the 7.72 milestone Aug 13, 2024
CHANGELOG.md Outdated
@@ -3,6 +3,7 @@
- A new button is added under Account Settings: "Change Avatar". It opens the in-app Safari with Gravatar's Avatar Quick Editor. [#1770](https://github.com/Automattic/pocket-casts-ios/pull/1770)
- Adds the ability to rate podcasts [#1879](https://github.com/Automattic/pocket-casts-ios/issues/1879)
- Improve the sort by name algorithm [#1959](https://github.com/Automattic/pocket-casts-ios/issues/1959)
- Adds a medium size for the Now Playing widget [#1876](https://github.com/Automattic/pocket-casts-ios/pull/1876)
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's update this following the assigned milestone. For now I set it to 7.72

Copy link
Contributor

@bjtitus bjtitus left a comment

Choose a reason for hiding this comment

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

👍 Testing looked good on both iOS 17 and iOS 16 with and without something playing.

Just left one small nit in the comments.

.foregroundColor(widgetColorScheme.bottomTextColor.opacity(0.6))
Spacer()
Image(widgetColorScheme.iconAssetName)
.frame(width: 28, height: 28)
Copy link
Contributor

@bjtitus bjtitus Aug 14, 2024

Choose a reason for hiding this comment

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

⛏️ It seems like this icon size is used three times, could it be put into a Constants or some other local property?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call. Wasn't sure where best to add it but I found a CommonWidgetHelper class to add the property to, and found all cases where widget icon frame was being defined (it was more than 3) and updated them all.

@danielebogo
Copy link
Contributor

Pinging @david-gonzalez-a8c to give it some 👀 on the design

@jgcaruso jgcaruso merged commit 0a8cb31 into trunk Aug 26, 2024
4 of 6 checks passed
@jgcaruso jgcaruso deleted the add/widget-now-playing-medium branch August 26, 2024 17:27
@pachlava pachlava added the [Type] Enhancement Improve an existing feature. label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement Improve an existing feature. Widgets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants