tvOS layout fixes

This commit is contained in:
Arkadiusz Fal
2022-11-10 22:51:30 +01:00
parent d779ec7215
commit 21b61982ad
6 changed files with 25 additions and 17 deletions

View File

@@ -58,7 +58,11 @@ struct PlayerQueueRow: View {
} label: {
VideoBanner(video: item.video, playbackTime: watchStoppedAt, videoDuration: watch?.videoDuration)
}
#if os(tvOS)
.buttonStyle(.card)
#else
.buttonStyle(.plain)
#endif
}
private var watch: Watch? {

View File

@@ -167,10 +167,6 @@ struct TrendingView: View {
}
}
#if os(iOS)
Spacer()
#endif
HStack {
Text("Country")
.foregroundColor(.secondary)
@@ -178,13 +174,11 @@ struct TrendingView: View {
countryButton
}
#if os(tvOS)
if let favoriteItem {
FavoriteButton(item: favoriteItem)
.id(favoriteItem.id)
.labelStyle(.iconOnly)
}
#endif
if let favoriteItem {
FavoriteButton(item: favoriteItem)
.id(favoriteItem.id)
.labelStyle(.iconOnly)
}
}
}
#endif

View File

@@ -71,8 +71,17 @@ struct VideoBanner: View {
.padding(.vertical, playbackTime.isNil ? 0 : 5)
}
.contentShape(Rectangle())
.buttonStyle(.plain)
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: 100, alignment: .center)
#if os(tvOS)
.buttonStyle(.card)
#else
.buttonStyle(.plain)
#endif
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: 100, alignment: .center)
#if os(tvOS)
.padding(.vertical, 20)
.padding(.trailing, 10)
#endif
}
private var stackAlignment: VerticalAlignment {

View File

@@ -25,12 +25,12 @@ struct PopularView: View {
.navigationTitle("Popular")
#endif
}
#if !os(tvOS)
.toolbar {
ToolbarItem(placement: .automatic) {
FavoriteButton(item: FavoriteItem(section: .popular))
}
}
#if !os(tvOS)
.background(
Button("Refresh") {
resource?.load()

View File

@@ -37,12 +37,13 @@ struct SubscriptionsView: View {
#endif
}
}
#if !os(tvOS)
.toolbar {
ToolbarItem(placement: .automatic) {
FavoriteButton(item: FavoriteItem(section: .subscriptions))
}
}
#if !os(tvOS)
.background(
Button("Refresh") {
loadResources(force: true)