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

[WIP] tvOS - Episode Item View Backdrop Substitute #1388

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ extension BaseItemDto: Poster {
case .episode:
seasonEpisodeLabel
case .video:
extraType?.displayTitle
/// Don't show any subtitle if it's unknown
if let extraType, extraType != .unknown {
extraType.displayTitle
} else {
nil
}
default:
nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,60 +89,82 @@ extension EpisodeItemView.ContentView {
.focusable()
.focused($focusedLayer, equals: .top)

HStack(alignment: .bottom) {
VStack(alignment: .leading, spacing: 16) {

VStack(alignment: .leading, spacing: 20) {
if let seriesName = viewModel.item.seriesName {
Text(seriesName)
.font(.headline)
.fontWeight(.semibold)
.foregroundColor(.secondary)
}

if let seriesName = viewModel.item.seriesName {
Text(seriesName)
.font(.headline)
.fontWeight(.semibold)
.foregroundColor(.secondary)
}
HStack(alignment: .bottom) {

Text(viewModel.item.displayTitle)
.font(.title2)
.fontWeight(.semibold)
.lineLimit(1)
.multilineTextAlignment(.leading)
.foregroundColor(.white)

if let overview = viewModel.item.overview {
Text(overview)
.font(.subheadline)
.lineLimit(3)
} else {
L10n.noOverviewAvailable.text
}
HStack(alignment: .bottom, spacing: 16) {

HStack {
DotHStack {
if let premiereYear = viewModel.item.premiereDateYear {
Text(premiereYear)
ImageView(viewModel.item.imageSource(
.primary,
maxHeight: 250
))
.placeholder { _ in
EmptyView()
}
.failure {
EmptyView()
}
.aspectRatio(contentMode: .fit)
.posterShadow()
.frame(maxHeight: 250, alignment: .bottomLeading)
.clipShape(RoundedRectangle(cornerRadius: 10, style: .continuous))

VStack(alignment: .leading, spacing: 20) {

Text(viewModel.item.displayTitle)
.font(.title2)
.fontWeight(.semibold)
.lineLimit(1)
.multilineTextAlignment(.leading)
.foregroundColor(.white)

if let overview = viewModel.item.overview {
Text(overview)
.font(.subheadline)
.multilineTextAlignment(.leading)
.lineLimit(3)
} else {
L10n.noOverviewAvailable.text
}

if let playButtonitem = viewModel.playButtonItem, let runtime = playButtonitem.runTimeLabel {
Text(runtime)
HStack {
DotHStack {
if let premiereYear = viewModel.item.premiereDateYear {
Text(premiereYear)
}

if let playButtonitem = viewModel.playButtonItem, let runtime = playButtonitem.runTimeLabel {
Text(runtime)
}
}
.font(.caption)
.foregroundColor(Color(UIColor.lightGray))

ItemView.AttributesHStack(viewModel: viewModel)
}
}
.font(.caption)
.foregroundColor(Color(UIColor.lightGray))

ItemView.AttributesHStack(viewModel: viewModel)
}
}

Spacer()
Spacer()

VStack {
ItemView.PlayButton(viewModel: viewModel)
.focused($focusedLayer, equals: .playButton)
VStack {
ItemView.PlayButton(viewModel: viewModel)
.focused($focusedLayer, equals: .playButton)

ItemView.ActionButtonHStack(viewModel: viewModel)
.frame(width: 400)
ItemView.ActionButtonHStack(viewModel: viewModel)
.frame(width: 400)
}
.frame(width: 450)
.padding(.leading, 150)
}
.frame(width: 450)
.padding(.leading, 150)
}
}
.padding(.horizontal, 50)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extension ItemView {
var body: some View {
ZStack {
if viewModel.item.type == .episode {
ImageView(viewModel.item.imageSource(.primary, maxWidth: 1920))
ImageView(viewModel.item.seriesImageSource(.backdrop, maxWidth: 1920))
} else {
ImageView(viewModel.item.imageSource(.backdrop, maxWidth: 1920))
}
Expand Down