mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
tvOS filters for all views
Vertical list for trending, popular, playlists, search Fix #413, #415
This commit is contained in:
@@ -26,7 +26,7 @@ struct VerticalCells<Header: View>: View {
|
||||
|
||||
var body: some View {
|
||||
ScrollView(.vertical, showsIndicators: scrollViewShowsIndicators) {
|
||||
LazyVGrid(columns: columns, alignment: .center) {
|
||||
LazyVGrid(columns: adaptiveItem, alignment: .center) {
|
||||
Section(header: header) {
|
||||
ForEach(contentItems) { item in
|
||||
ContentItemView(item: item)
|
||||
@@ -58,14 +58,6 @@ struct VerticalCells<Header: View>: View {
|
||||
}
|
||||
}
|
||||
|
||||
var columns: [GridItem] {
|
||||
#if os(tvOS)
|
||||
contentItems.count < 3 ? Array(repeating: GridItem(.fixed(500)), count: [contentItems.count, 1].max()!) : adaptiveItem
|
||||
#else
|
||||
adaptiveItem
|
||||
#endif
|
||||
}
|
||||
|
||||
var adaptiveItem: [GridItem] {
|
||||
if listingStyle == .list {
|
||||
return [.init(.flexible())]
|
||||
|
Reference in New Issue
Block a user