diff --git a/PocketCastsTests/Tests/End of Year/StoriesModelTests.swift b/PocketCastsTests/Tests/End of Year/StoriesModelTests.swift index 1995f3653..4200b9d16 100644 --- a/PocketCastsTests/Tests/End of Year/StoriesModelTests.swift +++ b/PocketCastsTests/Tests/End of Year/StoriesModelTests.swift @@ -151,6 +151,8 @@ class StoriesModelTests: XCTestCase { } class MockStoriesDataSource: StoriesDataSource { + var indicatorColor: Color = .white + var numberOfStories: Int = 2 var didCallStoryForWithStoryNumber: Int? @@ -192,6 +194,8 @@ class MockStoriesDataSource: StoriesDataSource { } class MockStoriesWithPlusDataSource: StoriesDataSource { + var indicatorColor: Color = .white + var numberOfStories: Int = 4 var didCallStoryForWithStoryNumber: Int? diff --git a/podcasts/End of Year/End of Year 2023/EndOfYear2023StoriesModel.swift b/podcasts/End of Year/End of Year 2023/EndOfYear2023StoriesModel.swift index d1e0749de..f77134d33 100644 --- a/podcasts/End of Year/End of Year 2023/EndOfYear2023StoriesModel.swift +++ b/podcasts/End of Year/End of Year 2023/EndOfYear2023StoriesModel.swift @@ -7,6 +7,10 @@ class EndOfYear2023StoriesModel: StoryModel { var stories = [EndOfYear2023Story]() var data = EndOfYear2023StoriesData() + var indicatorColor: Color { + .white + } + required init() {} func populate(with dataManager: DataManager) { diff --git a/podcasts/End of Year/End of Year 2024/EndOfYear2024StoriesModel.swift b/podcasts/End of Year/End of Year 2024/EndOfYear2024StoriesModel.swift index 0aa752c0e..53b4de7ff 100644 --- a/podcasts/End of Year/End of Year 2024/EndOfYear2024StoriesModel.swift +++ b/podcasts/End of Year/End of Year 2024/EndOfYear2024StoriesModel.swift @@ -7,6 +7,10 @@ class EndOfYear2024StoriesModel: StoryModel { var stories = [EndOfYear2024Story]() var data = EndOfYear2024StoriesData() + var indicatorColor: Color { + .black + } + required init() { } func populate(with dataManager: DataManager) { diff --git a/podcasts/End of Year/EndOfYearStoriesBuilder.swift b/podcasts/End of Year/EndOfYearStoriesBuilder.swift index d0b351fdb..f9bc37b91 100644 --- a/podcasts/End of Year/EndOfYearStoriesBuilder.swift +++ b/podcasts/End of Year/EndOfYearStoriesBuilder.swift @@ -59,4 +59,5 @@ protocol StoryModel { func overlaidShareView() -> AnyView? /// Shown at the bottom of the story as an additional safe area func footerShareView() -> AnyView? + var indicatorColor: Color { get } } diff --git a/podcasts/End of Year/Stories/EndOfYearStoriesDataSource.swift b/podcasts/End of Year/Stories/EndOfYearStoriesDataSource.swift index ce96149e1..f79deef88 100644 --- a/podcasts/End of Year/Stories/EndOfYearStoriesDataSource.swift +++ b/podcasts/End of Year/Stories/EndOfYearStoriesDataSource.swift @@ -51,6 +51,10 @@ class EndOfYearStoriesDataSource: StoriesDataSource { func footerShareView() -> AnyView? { model.footerShareView() } + + var indicatorColor: Color { + model.indicatorColor + } } extension Array where Element: CaseIterable & Equatable { diff --git a/podcasts/End of Year/StoriesDataSource.swift b/podcasts/End of Year/StoriesDataSource.swift index c9051ec67..6bd5fe001 100644 --- a/podcasts/End of Year/StoriesDataSource.swift +++ b/podcasts/End of Year/StoriesDataSource.swift @@ -37,6 +37,8 @@ protocol StoriesDataSource { func overlaidShareView() -> AnyView? /// Shown at the bottom of the story as an additional safe area func footerShareView() -> AnyView? + + var indicatorColor: Color { get } } extension StoriesDataSource { diff --git a/podcasts/End of Year/StoriesModel.swift b/podcasts/End of Year/StoriesModel.swift index f11f02439..b2a94a5a1 100644 --- a/podcasts/End of Year/StoriesModel.swift +++ b/podcasts/End of Year/StoriesModel.swift @@ -246,6 +246,10 @@ class StoriesModel: ObservableObject { func footerShareView() -> AnyView? { dataSource.footerShareView() } + + var indicatorColor: Color { + dataSource.indicatorColor + } } private extension StoriesModel { diff --git a/podcasts/End of Year/Views/StoriesView.swift b/podcasts/End of Year/Views/StoriesView.swift index 83812e24f..9516b4aa4 100644 --- a/podcasts/End of Year/Views/StoriesView.swift +++ b/podcasts/End of Year/Views/StoriesView.swift @@ -62,6 +62,7 @@ struct StoriesView: View { } header + .foregroundStyle(model.indicatorColor) // Hide the share button if needed if model.showShareButton(index: model.currentStoryIndex) && !model.shouldShowUpsell(), let shareView = model.overlaidShareView() { @@ -256,8 +257,8 @@ private struct CloseButtonStyle: ButtonStyle { func makeBody(configuration: Configuration) -> some View { Image("eoy-close") + .renderingMode(.template) .font(style: .body, maxSizeCategory: .extraExtraExtraLarge) - .foregroundColor(.white) .padding(Constants.closeButtonPadding) .background(showButtonShapes ? Color.white.opacity(0.2) : nil) .cornerRadius(Constants.closeButtonRadius) diff --git a/podcasts/End of Year/Views/StoryIndicator.swift b/podcasts/End of Year/Views/StoryIndicator.swift index 9365b741e..e46806b7a 100644 --- a/podcasts/End of Year/Views/StoryIndicator.swift +++ b/podcasts/End of Year/Views/StoryIndicator.swift @@ -9,12 +9,12 @@ struct StoryIndicator: View { GeometryReader { geometry in ZStack(alignment: .leading) { Rectangle() - .foregroundColor(Color.white.opacity(Constants.storyIndicatorBackgroundOpacity)) + .opacity(Constants.storyIndicatorBackgroundOpacity) .cornerRadius(Constants.storyIndicatorBorderRadius) Rectangle() .frame(width: geometry.size.width * (model.progress - CGFloat(index)).clamped(to: 0.0 ..< 1.0), height: nil, alignment: .leading) - .foregroundColor(Color.white.opacity(Constants.storyIndicatorForegroundOpacity)) + .opacity(Constants.storyIndicatorForegroundOpacity) .cornerRadius(Constants.storyIndicatorBorderRadius) } }