ok maybe too many UI elements

This commit is contained in:
Francesco 2025-06-05 18:58:42 +02:00
parent aca5cc6906
commit 2a4af77e6a

View file

@ -105,35 +105,6 @@ struct MediaInfoView: View {
var body: some View {
ZStack {
bodyContent
.navigationBarHidden(true)
.ignoresSafeArea(.container, edges: .top)
VStack {
HStack {
Button(action: {
dismiss()
}) {
Image(systemName: "chevron.left")
.font(.system(size: 24))
.foregroundColor(.primary)
.padding(12)
.background(Color.gray.opacity(0.2))
.clipShape(Circle())
.circularGradientOutline()
}
.padding(.top, 8)
.padding(.leading, 16)
Spacer()
}
Spacer()
}
}
}
@ViewBuilder
private var bodyContent: some View {
Group {
if isLoading {
ProgressView()
@ -153,8 +124,6 @@ struct MediaInfoView: View {
self.imageUrl = savedPoster
}
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
if !hasFetched {
DropManager.shared.showDrop(title: "Fetching Data", subtitle: "Please wait while fetching.", duration: 0.5, icon: UIImage(systemName: "arrow.triangle.2.circlepath"))
fetchDetails()
@ -170,16 +139,9 @@ struct MediaInfoView: View {
selectedRange = 0..<episodeChunkSize
hasFetched = true
AnalyticsManager.shared.sendEvent(event: "search", additionalData: ["title": title])
AnalyticsManager.shared.sendEvent(event: "MediaInfoView", additionalData: ["title": title])
}
tabBarController.hideTabBar()
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let window = windowScene.windows.first,
let navigationController = window.rootViewController?.children.first as? UINavigationController {
navigationController.interactivePopGestureRecognizer?.isEnabled = true
navigationController.interactivePopGestureRecognizer?.delegate = nil
}
}
.onDisappear(){
tabBarController.showTabBar()
@ -202,6 +164,28 @@ struct MediaInfoView: View {
isFetchingEpisode = false
showStreamLoadingView = false
}
VStack {
HStack {
Button(action: {
dismiss()
}) {
Image(systemName: "chevron.left")
.font(.system(size: 24))
.foregroundColor(.primary)
.padding(12)
.background(Color.gray.opacity(0.2))
.clipShape(Circle())
.circularGradientOutline()
}
.padding(.top, 8)
.padding(.leading, 16)
Spacer()
}
Spacer()
}
}
}
@ViewBuilder
@ -584,6 +568,10 @@ struct MediaInfoView: View {
private var playAndBookmarkSection: some View {
HStack(spacing: 12) {
ZStack(alignment: .leading) {
RoundedRectangle(cornerRadius: 25)
.fill(Color.accentColor)
.frame(height: 48)
Button(action: {
playFirstUnwatchedEpisode()
}) {
@ -597,6 +585,7 @@ struct MediaInfoView: View {
.frame(maxWidth: .infinity)
.padding(.vertical, 12)
.padding(.horizontal, 20)
.background(Color.clear)
.contentShape(RoundedRectangle(cornerRadius: 25))
}
.disabled(isFetchingEpisode)