-
-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into tvOSLetterPicker
- Loading branch information
Showing
23 changed files
with
376 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
Swiftfin tvOS/Views/ItemView/Components/AboutView/Components/ImageCard.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// | ||
// Swiftfin is subject to the terms of the Mozilla Public | ||
// License, v2.0. If a copy of the MPL was not distributed with this | ||
// file, you can obtain one at https://mozilla.org/MPL/2.0/. | ||
// | ||
// Copyright (c) 2025 Jellyfin & Jellyfin Contributors | ||
// | ||
|
||
import Defaults | ||
import JellyfinAPI | ||
import SwiftUI | ||
|
||
extension ItemView.AboutView { | ||
|
||
struct ImageCard: View { | ||
|
||
// MARK: - Environment & Observed Objects | ||
|
||
@EnvironmentObject | ||
private var router: ItemCoordinator.Router | ||
|
||
@ObservedObject | ||
var viewModel: ItemViewModel | ||
|
||
// MARK: - Body | ||
|
||
var body: some View { | ||
PosterButton(item: viewModel.item, type: .portrait) | ||
.content { EmptyView() } | ||
.imageOverlay { EmptyView() } | ||
.onSelect(onSelect) | ||
.frame(height: 405) | ||
} | ||
|
||
// MARK: - On Select | ||
|
||
// Switch case to allow other funcitonality if we need to expand this beyond episode > series | ||
private func onSelect() { | ||
switch viewModel.item.type { | ||
case .episode: | ||
if let episodeViewModel = viewModel as? EpisodeItemViewModel, | ||
let seriesItem = episodeViewModel.seriesItem | ||
{ | ||
router.route(to: \.item, seriesItem) | ||
} | ||
default: | ||
break | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
Swiftfin tvOS/Views/ItemView/Components/ActionButtons/VersionMenu.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// | ||
// Swiftfin is subject to the terms of the Mozilla Public | ||
// License, v2.0. If a copy of the MPL was not distributed with this | ||
// file, you can obtain one at https://mozilla.org/MPL/2.0/. | ||
// | ||
// Copyright (c) 2025 Jellyfin & Jellyfin Contributors | ||
// | ||
|
||
import JellyfinAPI | ||
import SwiftUI | ||
|
||
extension ItemView { | ||
|
||
struct VersionMenu: View { | ||
|
||
// MARK: - Focus State | ||
|
||
@FocusState | ||
private var isFocused: Bool | ||
|
||
@ObservedObject | ||
var viewModel: ItemViewModel | ||
|
||
let mediaSources: [MediaSourceInfo] | ||
|
||
// MARK: - Body | ||
|
||
var body: some View { | ||
Menu { | ||
ForEach(mediaSources, id: \.hashValue) { mediaSource in | ||
Button { | ||
viewModel.send(.selectMediaSource(mediaSource)) | ||
} label: { | ||
if let selectedMediaSource = viewModel.selectedMediaSource, selectedMediaSource == mediaSource { | ||
Label(selectedMediaSource.displayTitle, systemImage: "checkmark") | ||
} else { | ||
Text(mediaSource.displayTitle) | ||
} | ||
} | ||
} | ||
} label: { | ||
ZStack { | ||
RoundedRectangle(cornerRadius: 10) | ||
.fill(isFocused ? Color.white : Color.white.opacity(0.5)) | ||
|
||
Label(L10n.version, systemImage: "list.dash") | ||
.font(.title3) | ||
.fontWeight(.semibold) | ||
.foregroundStyle(.black) | ||
.labelStyle(.iconOnly) | ||
} | ||
} | ||
.focused($isFocused) | ||
.scaleEffect(isFocused ? 1.20 : 1.0) | ||
.animation(.easeInOut(duration: 0.15), value: isFocused) | ||
.menuStyle(.borderlessButton) | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
Swiftfin tvOS/Views/ItemView/Components/EpisodeSelector/Components/EmptyCard.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// | ||
// Swiftfin is subject to the terms of the Mozilla Public | ||
// License, v2.0. If a copy of the MPL was not distributed with this | ||
// file, you can obtain one at https://mozilla.org/MPL/2.0/. | ||
// | ||
// Copyright (c) 2025 Jellyfin & Jellyfin Contributors | ||
// | ||
|
||
import SwiftUI | ||
|
||
extension SeriesEpisodeSelector { | ||
|
||
struct EmptyCard: View { | ||
|
||
private var onSelect: () -> Void | ||
|
||
init() { | ||
self.onSelect = {} | ||
} | ||
|
||
func onSelect(perform action: @escaping () -> Void) -> Self { | ||
copy(modifying: \.onSelect, with: action) | ||
} | ||
|
||
var body: some View { | ||
VStack(alignment: .leading) { | ||
Button { | ||
onSelect() | ||
} label: { | ||
Color.secondarySystemFill | ||
.opacity(0.75) | ||
.posterStyle(.landscape) | ||
.overlay { | ||
Image(systemName: "questionmark") | ||
.font(.system(size: 40)) | ||
} | ||
} | ||
.buttonStyle(.card) | ||
.posterShadow() | ||
|
||
SeriesEpisodeSelector.EpisodeContent( | ||
subHeader: .emptyDash, | ||
header: L10n.noResults, | ||
content: L10n.noEpisodesAvailable | ||
) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.