Channels search, add SDWebImage framework

This commit is contained in:
Arkadiusz Fal
2021-10-22 01:29:10 +02:00
parent bb8a8dee05
commit 0e54cbcad0
35 changed files with 859 additions and 431 deletions

View File

@@ -0,0 +1,50 @@
import Defaults
import SwiftUI
struct HorizontalCells: View {
#if os(iOS)
@Environment(\.verticalSizeClass) private var verticalSizeClass
#endif
var items = [ContentItem]()
var body: some View {
ScrollView(.horizontal, showsIndicators: false) {
LazyHStack(spacing: 20) {
ForEach(items) { item in
ContentItemView(item: item)
.environment(\.horizontalCells, true)
#if os(tvOS)
.frame(width: 580)
.padding(.trailing, 20)
.padding(.bottom, 40)
#else
.frame(width: 300)
#endif
}
}
#if os(tvOS)
.padding(.horizontal, 40)
.padding(.vertical, 30)
#else
.padding(.horizontal, 15)
.padding(.vertical, 10)
#endif
}
.id(UUID())
#if os(tvOS)
.frame(height: 560)
#else
.frame(height: 250)
#endif
.edgesIgnoringSafeArea(.horizontal)
}
}
struct HorizontalCells_Previews: PreviewProvider {
static var previews: some View {
HorizontalCells(items: ContentItem.array(of: Video.allFixtures))
.injectFixtureEnvironmentObjects()
}
}