Fix building and LiveTV item layout (#752)
This commit is contained in:
parent
5c957051ec
commit
a9db83d26a
|
@ -92,12 +92,11 @@ struct LiveTVChannelItemElement: View {
|
||||||
programLabel(
|
programLabel(
|
||||||
timeText: currentProgramText.timeDisplay,
|
timeText: currentProgramText.timeDisplay,
|
||||||
titleText: currentProgramText.title,
|
titleText: currentProgramText.title,
|
||||||
color: Color("TextHighlightColor"),
|
color: Color.primary,
|
||||||
font: Font.system(size: 20, weight: .bold, design: .default)
|
font: Font.system(size: 20, weight: .bold, design: .default)
|
||||||
)
|
)
|
||||||
if !nextProgramsText.isEmpty,
|
if !nextProgramsText.isEmpty {
|
||||||
let nextItem = nextProgramsText[0]
|
let nextItem = nextProgramsText[0]
|
||||||
{
|
|
||||||
programLabel(
|
programLabel(
|
||||||
timeText: nextItem.timeDisplay,
|
timeText: nextItem.timeDisplay,
|
||||||
titleText: nextItem.title,
|
titleText: nextItem.title,
|
||||||
|
@ -105,9 +104,8 @@ struct LiveTVChannelItemElement: View {
|
||||||
font: Font.system(size: 20, design: .default)
|
font: Font.system(size: 20, design: .default)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if nextProgramsText.count > 1,
|
if nextProgramsText.count > 1 {
|
||||||
let nextItem2 = nextProgramsText[1]
|
let nextItem2 = nextProgramsText[1]
|
||||||
{
|
|
||||||
programLabel(
|
programLabel(
|
||||||
timeText: nextItem2.timeDisplay,
|
timeText: nextItem2.timeDisplay,
|
||||||
titleText: nextItem2.title,
|
titleText: nextItem2.title,
|
||||||
|
@ -141,6 +139,7 @@ struct LiveTVChannelItemElement: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.frame(minWidth: 400, minHeight: 400)
|
||||||
.overlay(
|
.overlay(
|
||||||
RoundedRectangle(cornerRadius: 20)
|
RoundedRectangle(cornerRadius: 20)
|
||||||
.stroke(isFocused ? Color.blue : Color.clear, lineWidth: 4)
|
.stroke(isFocused ? Color.blue : Color.clear, lineWidth: 4)
|
||||||
|
|
|
@ -21,9 +21,8 @@ struct LiveTVProgramsView: View {
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollView {
|
ScrollView {
|
||||||
LazyVStack(alignment: .leading) {
|
LazyVStack(alignment: .leading) {
|
||||||
if !viewModel.recommendedItems.isEmpty,
|
if !viewModel.recommendedItems.isEmpty {
|
||||||
let items = viewModel.recommendedItems
|
let items = viewModel.recommendedItems
|
||||||
{
|
|
||||||
Text("On Now")
|
Text("On Now")
|
||||||
.font(.headline)
|
.font(.headline)
|
||||||
.fontWeight(.semibold)
|
.fontWeight(.semibold)
|
||||||
|
@ -47,9 +46,8 @@ struct LiveTVProgramsView: View {
|
||||||
}
|
}
|
||||||
}.frame(height: 350)
|
}.frame(height: 350)
|
||||||
}
|
}
|
||||||
if !viewModel.seriesItems.isEmpty,
|
if !viewModel.seriesItems.isEmpty {
|
||||||
let items = viewModel.seriesItems
|
let items = viewModel.seriesItems
|
||||||
{
|
|
||||||
Text("Shows")
|
Text("Shows")
|
||||||
.font(.headline)
|
.font(.headline)
|
||||||
.fontWeight(.semibold)
|
.fontWeight(.semibold)
|
||||||
|
@ -73,9 +71,8 @@ struct LiveTVProgramsView: View {
|
||||||
}
|
}
|
||||||
}.frame(height: 350)
|
}.frame(height: 350)
|
||||||
}
|
}
|
||||||
if !viewModel.movieItems.isEmpty,
|
if !viewModel.movieItems.isEmpty {
|
||||||
let items = viewModel.movieItems
|
let items = viewModel.movieItems
|
||||||
{
|
|
||||||
Text("Movies")
|
Text("Movies")
|
||||||
.font(.headline)
|
.font(.headline)
|
||||||
.fontWeight(.semibold)
|
.fontWeight(.semibold)
|
||||||
|
@ -99,9 +96,8 @@ struct LiveTVProgramsView: View {
|
||||||
}
|
}
|
||||||
}.frame(height: 350)
|
}.frame(height: 350)
|
||||||
}
|
}
|
||||||
if !viewModel.sportsItems.isEmpty,
|
if !viewModel.sportsItems.isEmpty {
|
||||||
let items = viewModel.sportsItems
|
let items = viewModel.sportsItems
|
||||||
{
|
|
||||||
Text("Sports")
|
Text("Sports")
|
||||||
.font(.headline)
|
.font(.headline)
|
||||||
.fontWeight(.semibold)
|
.fontWeight(.semibold)
|
||||||
|
@ -125,9 +121,8 @@ struct LiveTVProgramsView: View {
|
||||||
}
|
}
|
||||||
}.frame(height: 350)
|
}.frame(height: 350)
|
||||||
}
|
}
|
||||||
if !viewModel.kidsItems.isEmpty,
|
if !viewModel.kidsItems.isEmpty {
|
||||||
let items = viewModel.kidsItems
|
let items = viewModel.kidsItems
|
||||||
{
|
|
||||||
Text("Kids")
|
Text("Kids")
|
||||||
.font(.headline)
|
.font(.headline)
|
||||||
.fontWeight(.semibold)
|
.fontWeight(.semibold)
|
||||||
|
@ -151,9 +146,8 @@ struct LiveTVProgramsView: View {
|
||||||
}
|
}
|
||||||
}.frame(height: 350)
|
}.frame(height: 350)
|
||||||
}
|
}
|
||||||
if !viewModel.newsItems.isEmpty,
|
if !viewModel.newsItems.isEmpty {
|
||||||
let items = viewModel.newsItems
|
let items = viewModel.newsItems
|
||||||
{
|
|
||||||
Text("News")
|
Text("News")
|
||||||
.font(.headline)
|
.font(.headline)
|
||||||
.fontWeight(.semibold)
|
.fontWeight(.semibold)
|
||||||
|
|
|
@ -105,14 +105,12 @@ struct LiveTVChannelItemWideElement: View {
|
||||||
titleText: currentProgramText.title,
|
titleText: currentProgramText.title,
|
||||||
color: Color("TextHighlightColor")
|
color: Color("TextHighlightColor")
|
||||||
)
|
)
|
||||||
if !nextProgramsText.isEmpty,
|
if !nextProgramsText.isEmpty {
|
||||||
let nextItem = nextProgramsText[0]
|
let nextItem = nextProgramsText[0]
|
||||||
{
|
|
||||||
programLabel(timeText: nextItem.timeDisplay, titleText: nextItem.title, color: Color.gray)
|
programLabel(timeText: nextItem.timeDisplay, titleText: nextItem.title, color: Color.gray)
|
||||||
}
|
}
|
||||||
if nextProgramsText.count > 1,
|
if nextProgramsText.count > 1 {
|
||||||
let nextItem2 = nextProgramsText[1]
|
let nextItem2 = nextProgramsText[1]
|
||||||
{
|
|
||||||
programLabel(timeText: nextItem2.timeDisplay, titleText: nextItem2.title, color: Color.gray)
|
programLabel(timeText: nextItem2.timeDisplay, titleText: nextItem2.title, color: Color.gray)
|
||||||
}
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
|
@ -19,9 +19,8 @@ struct LiveTVProgramsView: View {
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollView {
|
ScrollView {
|
||||||
LazyVStack(alignment: .leading) {
|
LazyVStack(alignment: .leading) {
|
||||||
if !viewModel.recommendedItems.isEmpty,
|
if !viewModel.recommendedItems.isEmpty {
|
||||||
let items = viewModel.recommendedItems
|
let items = viewModel.recommendedItems
|
||||||
{
|
|
||||||
PosterHStack(title: "On Now", type: .portrait, items: items)
|
PosterHStack(title: "On Now", type: .portrait, items: items)
|
||||||
// .onSelect { item in
|
// .onSelect { item in
|
||||||
// if let chanId = item.channelId,
|
// if let chanId = item.channelId,
|
||||||
|
@ -33,9 +32,8 @@ struct LiveTVProgramsView: View {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
if !viewModel.seriesItems.isEmpty,
|
if !viewModel.seriesItems.isEmpty {
|
||||||
let items = viewModel.seriesItems
|
let items = viewModel.seriesItems
|
||||||
{
|
|
||||||
PosterHStack(title: "Shows", type: .portrait, items: items)
|
PosterHStack(title: "Shows", type: .portrait, items: items)
|
||||||
// .onSelect { item in
|
// .onSelect { item in
|
||||||
// if let chanId = item.channelId,
|
// if let chanId = item.channelId,
|
||||||
|
@ -47,9 +45,8 @@ struct LiveTVProgramsView: View {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
if !viewModel.movieItems.isEmpty,
|
if !viewModel.movieItems.isEmpty {
|
||||||
let items = viewModel.movieItems
|
let items = viewModel.movieItems
|
||||||
{
|
|
||||||
PosterHStack(title: "Movies", type: .portrait, items: items)
|
PosterHStack(title: "Movies", type: .portrait, items: items)
|
||||||
// .onSelect { item in
|
// .onSelect { item in
|
||||||
// if let chanId = item.channelId,
|
// if let chanId = item.channelId,
|
||||||
|
@ -61,9 +58,8 @@ struct LiveTVProgramsView: View {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
if !viewModel.sportsItems.isEmpty,
|
if !viewModel.sportsItems.isEmpty {
|
||||||
let items = viewModel.sportsItems
|
let items = viewModel.sportsItems
|
||||||
{
|
|
||||||
PosterHStack(title: "Sports", type: .portrait, items: items)
|
PosterHStack(title: "Sports", type: .portrait, items: items)
|
||||||
// .onSelect { item in
|
// .onSelect { item in
|
||||||
// if let chanId = item.channelId,
|
// if let chanId = item.channelId,
|
||||||
|
@ -75,9 +71,8 @@ struct LiveTVProgramsView: View {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
if !viewModel.kidsItems.isEmpty,
|
if !viewModel.kidsItems.isEmpty {
|
||||||
let items = viewModel.kidsItems
|
let items = viewModel.kidsItems
|
||||||
{
|
|
||||||
PosterHStack(title: "Kids", type: .portrait, items: items)
|
PosterHStack(title: "Kids", type: .portrait, items: items)
|
||||||
// .onSelect { item in
|
// .onSelect { item in
|
||||||
// if let chanId = item.channelId,
|
// if let chanId = item.channelId,
|
||||||
|
@ -89,9 +84,8 @@ struct LiveTVProgramsView: View {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
if !viewModel.newsItems.isEmpty,
|
if !viewModel.newsItems.isEmpty {
|
||||||
let items = viewModel.newsItems
|
let items = viewModel.newsItems
|
||||||
{
|
|
||||||
PosterHStack(title: "News", type: .portrait, items: items)
|
PosterHStack(title: "News", type: .portrait, items: items)
|
||||||
// .onSelect { item in
|
// .onSelect { item in
|
||||||
// if let chanId = item.channelId,
|
// if let chanId = item.channelId,
|
||||||
|
|
Loading…
Reference in New Issue