diff --git a/Sora/ContentView.swift b/Sora/ContentView.swift index 44f1513..8238bd1 100644 --- a/Sora/ContentView.swift +++ b/Sora/ContentView.swift @@ -4,7 +4,6 @@ // // Created by Francesco on 06/01/25. // - import SwiftUI struct ContentView_Previews: PreviewProvider { diff --git a/Sora/Utils/TabBar/TabBar.swift b/Sora/Utils/TabBar/TabBar.swift index 0df4118..88c9bbf 100644 --- a/Sora/Utils/TabBar/TabBar.swift +++ b/Sora/Utils/TabBar/TabBar.swift @@ -75,11 +75,11 @@ struct TabBar: View { showSearch = false } }) { - Image(systemName: "x.circle") - .font(.system(size: 25)) + Image(systemName: "xmark") + .font(.system(size: 30)) .foregroundStyle(.gray) - .frame(width: 20, height: 20) - .matchedGeometryEffect(id: "x.circle", in: animation) + .frame(width: 24, height: 24) + .matchedGeometryEffect(id: "xmark", in: animation) .padding(16) .background( Circle() diff --git a/Sora/Views/MediaInfoView/EpisodeCell/EpisodeCell.swift b/Sora/Views/MediaInfoView/EpisodeCell/EpisodeCell.swift index 54bb828..9a24e50 100644 --- a/Sora/Views/MediaInfoView/EpisodeCell/EpisodeCell.swift +++ b/Sora/Views/MediaInfoView/EpisodeCell/EpisodeCell.swift @@ -769,6 +769,8 @@ struct EpisodeCell: View { if buttonCount == 3 { swipeDistance += 12 + } else if buttonCount == 4 { + swipeDistance += 24 } return swipeDistance diff --git a/Sora/Views/MediaInfoView/MediaInfoView.swift b/Sora/Views/MediaInfoView/MediaInfoView.swift index 12064e9..0dcd7c4 100644 --- a/Sora/Views/MediaInfoView/MediaInfoView.swift +++ b/Sora/Views/MediaInfoView/MediaInfoView.swift @@ -103,6 +103,7 @@ struct MediaInfoView: View { .navigationBarHidden(true) .navigationBarTitleDisplayMode(.inline) .navigationBarTitle("") + .navigationViewStyle(StackNavigationViewStyle()) .ignoresSafeArea(.container, edges: .top) .onAppear { if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, @@ -216,7 +217,6 @@ struct MediaInfoView: View { .aspectRatio(contentMode: .fill) .frame(width: UIScreen.main.bounds.width, height: 600) .clipped() - KFImage(URL(string: imageUrl)) .placeholder { EmptyView() } .setProcessor(ImageUpscaler.lanczosProcessor(scale: 3, sharpeningIntensity: 1, sharpeningRadius: 1)) @@ -248,12 +248,10 @@ struct MediaInfoView: View { endPoint: .bottom ) ) - VStack(spacing: 0) { Rectangle() .fill(Color.clear) .frame(height: 400) - VStack(alignment: .leading, spacing: 16) { headerSection if !episodeLinks.isEmpty { @@ -283,15 +281,33 @@ struct MediaInfoView: View { } .onAppear { UIScrollView.appearance().bounces = false - } + } .navigationBarTitleDisplayMode(.inline) .navigationBarTitle("") + .navigationViewStyle(StackNavigationViewStyle()) .ignoresSafeArea(.container, edges: .top) } @ViewBuilder private var headerSection: some View { VStack(alignment: .leading, spacing: 8) { + Spacer() + HStack(spacing: 16) { + + if !airdate.isEmpty && airdate != "N/A" && airdate != "No Data" { + HStack(spacing: 4) { + Image(systemName: "calendar") + .foregroundColor(.secondary) + + Text(airdate) + .font(.system(size: 14)) + .foregroundColor(.secondary) + } + } + + Spacer() + + } Text(title) .font(.system(size: 28, weight: .bold)) .foregroundColor(.primary) @@ -320,28 +336,7 @@ struct MediaInfoView: View { } playAndBookmarkSection - - // Metadata row - HStack(spacing: 16) { - sourceButton - - if !airdate.isEmpty && airdate != "N/A" && airdate != "No Data" { - HStack(spacing: 4) { - Image(systemName: "calendar") - .foregroundColor(.secondary) - - Text(airdate) - .font(.system(size: 14)) - .foregroundColor(.secondary) - } - } - - Spacer() - - menuButton - } - - // Single episode action buttons + if episodeLinks.count == 1 { VStack(spacing: 12) { HStack(spacing: 12) { @@ -449,22 +444,14 @@ struct MediaInfoView: View { Button(action: { openSafariViewController(with: href) }) { - HStack(spacing: 4) { - Text(module.metadata.sourceName) - .font(.system(size: 14, weight: .medium)) - .foregroundColor(.primary) - .lineLimit(1) - - Image(systemName: "safari") - .resizable() - .frame(width: 14, height: 14) - .foregroundColor(.primary) - } - .padding(.horizontal, 10) - .padding(.vertical, 6) - .background(Color.gray.opacity(0.2)) - .cornerRadius(15) - .gradientOutline() + Image(systemName: "safari") + .resizable() + .frame(width: 16, height: 16) + .foregroundColor(.primary) + .padding(6) + .background(Color.gray.opacity(0.2)) + .clipShape(Circle()) + .circularGradientOutline() } } @@ -583,13 +570,18 @@ struct MediaInfoView: View { Group { if !isGroupedBySeasons && episodeLinks.count <= episodeChunkSize { - Text("All episodes already shown") + Text("") .font(.system(size: 14)) .foregroundColor(.secondary) } else { episodeNavigationSection } } + + HStack(spacing: 4) { + sourceButton + menuButton + } } episodeListSection diff --git a/Sora/Views/SearchView/SearchComponents.swift b/Sora/Views/SearchView/SearchComponents.swift index 5958fbc..02c85aa 100644 --- a/Sora/Views/SearchView/SearchComponents.swift +++ b/Sora/Views/SearchView/SearchComponents.swift @@ -18,19 +18,16 @@ struct SearchItem: Identifiable { struct SearchHistorySection: View { let title: String let content: Content - init(title: String, @ViewBuilder content: () -> Content) { self.title = title self.content = content() } - var body: some View { VStack(alignment: .leading, spacing: 8) { Text(title.uppercased()) .font(.footnote) .foregroundStyle(Color.secondary) .padding(.horizontal, 20) - VStack(spacing: 0) { content } diff --git a/Sora/Views/SettingsView/SettingsSubViews/SettingsViewData.swift b/Sora/Views/SettingsView/SettingsSubViews/SettingsViewData.swift index 9f00350..b1a5fe5 100644 --- a/Sora/Views/SettingsView/SettingsSubViews/SettingsViewData.swift +++ b/Sora/Views/SettingsView/SettingsSubViews/SettingsViewData.swift @@ -203,6 +203,8 @@ struct SettingsViewData: View { } VStack { + Spacer() + if isCalculatingSize { ProgressView() .scaleEffect(0.7) @@ -231,7 +233,9 @@ struct SettingsViewData: View { .padding(.horizontal, 16) .padding(.vertical, 12) } - + Spacer() + + Divider().padding(.horizontal, 16) Button(action: clearAllCaches) { Text("Clear All Caches") .foregroundColor(.red) @@ -242,17 +246,9 @@ struct SettingsViewData: View { SettingsSection( title: "App Storage", - footer: "The caches used by Sora are stored images that help load content faster\nThe App Data should never be erased if you don't know what that will cause.\nClearing the documents folder will remove all the modules and downloads\n " + footer: "The App Data should never be erased if you don't know what that will cause.\nClearing the documents folder will remove all the modules and downloads\n " ) { VStack(spacing: 0) { - SettingsButtonRow( - icon: "trash", - title: "Clear Cache", - subtitle: formatSize(cacheSize), - action: clearCache - ) - Divider().padding(.horizontal, 16) - SettingsButtonRow( icon: "doc.text", title: "Remove All Files in Documents",