Channels layout improvements, other UI fixes

This commit is contained in:
Arkadiusz Fal
2021-08-31 23:17:50 +02:00
parent 1651110a5d
commit b00b54ad2a
28 changed files with 633 additions and 192 deletions

View File

@@ -38,21 +38,26 @@ struct TVNavigationView: View {
VideoDetailsView(video)
}
}
.fullScreenCover(isPresented: $navigationState.showingChannel, onDismiss: {
navigationState.showVideoDetailsIfNeeded()
}) {
if let channel = navigationState.channel {
ChannelView(id: channel.id)
}
}
.fullScreenCover(isPresented: $navigationState.showingVideo) {
if let video = navigationState.video {
VideoPlayerView(video)
.environmentObject(playbackState)
}
}
.fullScreenCover(isPresented: $navigationState.isChannelOpen, onDismiss: {
navigationState.closeChannel(presentedChannel)
}) {
if presentedChannel != nil {
ChannelVideosView(presentedChannel)
.background(.thickMaterial)
}
}
.onPlayPauseCommand { showingOptions.toggle() }
}
fileprivate var presentedChannel: Channel! {
navigationState.openChannels.first
}
}
struct TVNavigationView_Previews: PreviewProvider {