swiftformat

This commit is contained in:
jhays 2022-05-03 22:31:35 -05:00
parent 158fbb1064
commit d0978ff1ae
10 changed files with 39 additions and 41 deletions

View File

@ -28,13 +28,13 @@ struct CinematicNextUpCardView: View {
item.getSeriesThumbImage(maxWidth: 350), item.getSeriesThumbImage(maxWidth: 350),
item.getSeriesBackdropImage(maxWidth: 350), item.getSeriesBackdropImage(maxWidth: 350),
]) ])
.frame(width: 350, height: 210) .frame(width: 350, height: 210)
} else { } else {
ImageView([ ImageView([
.init(url: item.getThumbImage(maxWidth: 350)), .init(url: item.getThumbImage(maxWidth: 350)),
.init(url: item.getBackdropImage(maxWidth: 350), blurHash: item.getBackdropImageBlurHash()), .init(url: item.getBackdropImage(maxWidth: 350), blurHash: item.getBackdropImageBlurHash()),
]) ])
.frame(width: 350, height: 210) .frame(width: 350, height: 210)
} }
LinearGradient(colors: [.clear, .black], LinearGradient(colors: [.clear, .black],

View File

@ -29,13 +29,13 @@ struct CinematicResumeCardView: View {
item.getSeriesThumbImage(maxWidth: 350), item.getSeriesThumbImage(maxWidth: 350),
item.getSeriesBackdropImage(maxWidth: 350), item.getSeriesBackdropImage(maxWidth: 350),
]) ])
.frame(width: 350, height: 210) .frame(width: 350, height: 210)
} else { } else {
ImageView([ ImageView([
.init(url: item.getThumbImage(maxWidth: 350)), .init(url: item.getThumbImage(maxWidth: 350)),
.init(url: item.getBackdropImage(maxWidth: 350), blurHash: item.getBackdropImageBlurHash()), .init(url: item.getBackdropImage(maxWidth: 350), blurHash: item.getBackdropImageBlurHash()),
]) ])
.frame(width: 350, height: 210) .frame(width: 350, height: 210)
} }
LinearGradient(colors: [.clear, .black], LinearGradient(colors: [.clear, .black],

View File

@ -62,18 +62,18 @@ struct tvOSLiveTVOverlay: View {
SFSymbolButton(systemName: "chevron.left.circle", action: { SFSymbolButton(systemName: "chevron.left.circle", action: {
viewModel.playerOverlayDelegate?.didSelectPlayPreviousItem() viewModel.playerOverlayDelegate?.didSelectPlayPreviousItem()
}) })
.frame(maxWidth: 30, maxHeight: 30) .frame(maxWidth: 30, maxHeight: 30)
.disabled(viewModel.previousItemVideoPlayerViewModel == nil) .disabled(viewModel.previousItemVideoPlayerViewModel == nil)
.foregroundColor(viewModel.nextItemVideoPlayerViewModel == nil ? .gray : .white) .foregroundColor(viewModel.nextItemVideoPlayerViewModel == nil ? .gray : .white)
} }
if viewModel.shouldShowPlayNextItem { if viewModel.shouldShowPlayNextItem {
SFSymbolButton(systemName: "chevron.right.circle", action: { SFSymbolButton(systemName: "chevron.right.circle", action: {
viewModel.playerOverlayDelegate?.didSelectPlayNextItem() viewModel.playerOverlayDelegate?.didSelectPlayNextItem()
}) })
.frame(maxWidth: 30, maxHeight: 30) .frame(maxWidth: 30, maxHeight: 30)
.disabled(viewModel.nextItemVideoPlayerViewModel == nil) .disabled(viewModel.nextItemVideoPlayerViewModel == nil)
.foregroundColor(viewModel.nextItemVideoPlayerViewModel == nil ? .gray : .white) .foregroundColor(viewModel.nextItemVideoPlayerViewModel == nil ? .gray : .white)
} }
if viewModel.shouldShowAutoPlay { if viewModel.shouldShowAutoPlay {

View File

@ -62,18 +62,18 @@ struct tvOSVLCOverlay: View {
SFSymbolButton(systemName: "chevron.left.circle", action: { SFSymbolButton(systemName: "chevron.left.circle", action: {
viewModel.playerOverlayDelegate?.didSelectPlayPreviousItem() viewModel.playerOverlayDelegate?.didSelectPlayPreviousItem()
}) })
.frame(maxWidth: 30, maxHeight: 30) .frame(maxWidth: 30, maxHeight: 30)
.disabled(viewModel.previousItemVideoPlayerViewModel == nil) .disabled(viewModel.previousItemVideoPlayerViewModel == nil)
.foregroundColor(viewModel.nextItemVideoPlayerViewModel == nil ? .gray : .white) .foregroundColor(viewModel.nextItemVideoPlayerViewModel == nil ? .gray : .white)
} }
if viewModel.shouldShowPlayNextItem { if viewModel.shouldShowPlayNextItem {
SFSymbolButton(systemName: "chevron.right.circle", action: { SFSymbolButton(systemName: "chevron.right.circle", action: {
viewModel.playerOverlayDelegate?.didSelectPlayNextItem() viewModel.playerOverlayDelegate?.didSelectPlayNextItem()
}) })
.frame(maxWidth: 30, maxHeight: 30) .frame(maxWidth: 30, maxHeight: 30)
.disabled(viewModel.nextItemVideoPlayerViewModel == nil) .disabled(viewModel.nextItemVideoPlayerViewModel == nil)
.foregroundColor(viewModel.nextItemVideoPlayerViewModel == nil ? .gray : .white) .foregroundColor(viewModel.nextItemVideoPlayerViewModel == nil ? .gray : .white)
} }
if viewModel.shouldShowAutoPlay { if viewModel.shouldShowAutoPlay {

View File

@ -48,9 +48,9 @@ struct PortraitImageHStackView<TopBarView: View, ItemType: PortraitImageStackabl
failureView: { failureView: {
InitialFailureView(item.failureInitials) InitialFailureView(item.failureInitials)
}) })
.portraitPoster(width: maxWidth) .portraitPoster(width: maxWidth)
.shadow(radius: 4, y: 2) .shadow(radius: 4, y: 2)
.accessibilityIgnoresInvertColors() .accessibilityIgnoresInvertColors()
if item.showTitle { if item.showTitle {
Text(item.title) Text(item.title)

View File

@ -40,9 +40,9 @@ struct PortraitItemButton<ItemType: PortraitImageStackable>: View {
failureView: { failureView: {
InitialFailureView(item.failureInitials) InitialFailureView(item.failureInitials)
}) })
.portraitPoster(width: maxWidth) .portraitPoster(width: maxWidth)
.shadow(radius: 4, y: 2) .shadow(radius: 4, y: 2)
.accessibilityIgnoresInvertColors() .accessibilityIgnoresInvertColors()
if item.showTitle { if item.showTitle {
Text(item.title) Text(item.title)

View File

@ -33,13 +33,13 @@ struct ContinueWatchingView: View {
item.getSeriesThumbImage(maxWidth: 320), item.getSeriesThumbImage(maxWidth: 320),
item.getSeriesBackdropImage(maxWidth: 320), item.getSeriesBackdropImage(maxWidth: 320),
]) ])
.frame(width: 320, height: 180) .frame(width: 320, height: 180)
} else { } else {
ImageView(sources: [ ImageView(sources: [
item.getThumbImage(maxWidth: 320), item.getThumbImage(maxWidth: 320),
item.getBackdropImage(maxWidth: 320), item.getBackdropImage(maxWidth: 320),
]) ])
.frame(width: 320, height: 180) .frame(width: 320, height: 180)
} }
} }
.accessibilityIgnoresInvertColors() .accessibilityIgnoresInvertColors()

View File

@ -69,7 +69,7 @@ struct ItemViewBody: View {
selectedAction: { genre in selectedAction: { genre in
itemRouter.route(to: \.library, (viewModel: .init(genre: genre), title: genre.title)) itemRouter.route(to: \.library, (viewModel: .init(genre: genre), title: genre.title))
}) })
.padding(.bottom) .padding(.bottom)
} }
// MARK: Studios // MARK: Studios

View File

@ -242,7 +242,7 @@ class LiveTVPlayerViewController: UIViewController {
@objc @objc
private func didTap() { private func didTap() {
didGenerallyTap(point: nil) didGenerallyTap(point: nil)
} }
@objc @objc
@ -904,15 +904,13 @@ extension LiveTVPlayerViewController: PlayerOverlayDelegate {
} }
} }
func didGenerallyTap(point: CGPoint?) { func didGenerallyTap(point: CGPoint?) {
toggleOverlay() toggleOverlay()
restartOverlayDismissTimer(interval: 5) restartOverlayDismissTimer(interval: 5)
} }
func didLongPress() { func didLongPress() {}
}
func didBeginScrubbing() { func didBeginScrubbing() {
stopOverlayDismissTimer() stopOverlayDismissTimer()

View File

@ -375,16 +375,16 @@ struct VLCPlayerOverlayView: View {
ValueSlider(value: $viewModel.sliderPercentage, onEditingChanged: { editing in ValueSlider(value: $viewModel.sliderPercentage, onEditingChanged: { editing in
viewModel.sliderIsScrubbing = editing viewModel.sliderIsScrubbing = editing
}) })
.valueSliderStyle(HorizontalValueSliderStyle(track: .valueSliderStyle(HorizontalValueSliderStyle(track:
HorizontalValueTrack(view: HorizontalValueTrack(view:
Capsule().foregroundColor(.purple)) Capsule().foregroundColor(.purple))
.background(Capsule().foregroundColor(Color.gray.opacity(0.25))) .background(Capsule().foregroundColor(Color.gray.opacity(0.25)))
.frame(height: 4), .frame(height: 4),
thumb: Circle().foregroundColor(.purple), thumb: Circle().foregroundColor(.purple),
thumbSize: CGSize.Circle(radius: viewModel.sliderIsScrubbing ? 20 : 15), thumbSize: CGSize.Circle(radius: viewModel.sliderIsScrubbing ? 20 : 15),
thumbInteractiveSize: CGSize.Circle(radius: 40), thumbInteractiveSize: CGSize.Circle(radius: 40),
options: .defaultOptions)) options: .defaultOptions))
.frame(maxHeight: 50) .frame(maxHeight: 50)
Text(viewModel.rightLabelText) Text(viewModel.rightLabelText)
.font(.system(size: 18, weight: .semibold, design: .default)) .font(.system(size: 18, weight: .semibold, design: .default))