From 440ec57d592900765ac52978a8349e485e1bc0fe Mon Sep 17 00:00:00 2001 From: 50/50 <80717571+50n50@users.noreply.github.com> Date: Tue, 10 Jun 2025 20:37:54 +0200 Subject: [PATCH] Fixes, read description (#168) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fixed episodecells getting stuck sliding * Enabled device scaling for ipad not good enough yet, not applied everywhere cuz idk where to apply exactly 💯 * Fixed blur in continue watching cells * Keyboard controls player * fixed downloadview buttons * Reduced tab bar outline opacity --------- Co-authored-by: cranci <100066266+cranci1@users.noreply.github.com> --- Sora/Localizable.xcstrings | 31 +++++++++-- .../CustomPlayer/CustomPlayer.swift | 51 +++++++++++++++++++ Sora/Utils/TabBar/TabBar.swift | 2 +- Sora/Views/DownloadView.swift | 47 +++++------------ Sora/Views/LibraryView/LibraryView.swift | 2 - .../xcshareddata/swiftpm/Package.resolved | 3 +- 6 files changed, 92 insertions(+), 44 deletions(-) diff --git a/Sora/Localizable.xcstrings b/Sora/Localizable.xcstrings index d66b847..1b90ac5 100644 --- a/Sora/Localizable.xcstrings +++ b/Sora/Localizable.xcstrings @@ -71,6 +71,9 @@ }, "App Data" : { + }, + "Are you sure you want to clear all cached data? This will help free up storage space." : { + }, "Are you sure you want to delete '%@'?" : { @@ -90,6 +93,9 @@ }, "Are you sure you want to erase all app data? This action cannot be undone." : { + }, + "Are you sure you want to remove all downloaded media files (.mov, .mp4, .pkg)? This action cannot be undone." : { + }, "Are you sure you want to remove all files in the Documents folder? This will remove all modules." : { @@ -112,10 +118,10 @@ "Clear" : { }, - "Clear All Caches" : { + "Clear All Downloads" : { }, - "Clear All Downloads" : { + "Clear Cache" : { }, "Clear Library Only" : { @@ -138,9 +144,6 @@ }, "cranci1" : { - }, - "Current Cache Size" : { - }, "DATA/LOGS" : { @@ -255,6 +258,9 @@ }, "Mark as Watched" : { + }, + "Mark watched" : { + }, "Match with AniList" : { @@ -333,9 +339,15 @@ }, "Remove" : { + }, + "Remove All Caches" : { + }, "Remove Documents" : { + }, + "Remove Downloaded Media" : { + }, "Remove from Bookmarks" : { @@ -348,9 +360,15 @@ }, "Reset AniList ID" : { + }, + "Reset progress" : { + }, "Reset Progress" : { + }, + "Revert Module Poster" : { + }, "Running Sora %@ - cranci1" : { @@ -372,6 +390,9 @@ }, "Season %lld" : { + }, + "Segments Color" : { + }, "Select Module" : { diff --git a/Sora/Utils/MediaPlayer/CustomPlayer/CustomPlayer.swift b/Sora/Utils/MediaPlayer/CustomPlayer/CustomPlayer.swift index fcf4bf2..2995830 100644 --- a/Sora/Utils/MediaPlayer/CustomPlayer/CustomPlayer.swift +++ b/Sora/Utils/MediaPlayer/CustomPlayer/CustomPlayer.swift @@ -2701,6 +2701,57 @@ class CustomMediaPlayerViewController: UIViewController, UIGestureRecognizerDele default: return .white } } + + override var canBecomeFirstResponder: Bool { + return true + } + + override var keyCommands: [UIKeyCommand]? { + return [ + UIKeyCommand(input: " ", modifierFlags: [], action: #selector(handleSpaceKey), discoverabilityTitle: "Play/Pause"), + UIKeyCommand(input: UIKeyCommand.inputLeftArrow, modifierFlags: [], action: #selector(handleLeftArrow), discoverabilityTitle: "Seek Backward 10s"), + UIKeyCommand(input: UIKeyCommand.inputRightArrow, modifierFlags: [], action: #selector(handleRightArrow), discoverabilityTitle: "Seek Forward 10s"), + UIKeyCommand(input: UIKeyCommand.inputUpArrow, modifierFlags: [], action: #selector(handleUpArrow), discoverabilityTitle: "Seek Forward 60s"), + UIKeyCommand(input: UIKeyCommand.inputDownArrow, modifierFlags: [], action: #selector(handleDownArrow), discoverabilityTitle: "Seek Backward 60s"), + UIKeyCommand(input: UIKeyCommand.inputEscape, modifierFlags: [], action: #selector(handleEscape), discoverabilityTitle: "Dismiss Player") + ] + } + + @objc private func handleSpaceKey() { + togglePlayPause() + } + + @objc private func handleLeftArrow() { + let skipValue = 10.0 + currentTimeVal = max(currentTimeVal - skipValue, 0) + player.seek(to: CMTime(seconds: currentTimeVal, preferredTimescale: 600)) + animateButtonRotation(backwardButton, clockwise: false) + } + + @objc private func handleRightArrow() { + let skipValue = 10.0 + currentTimeVal = min(currentTimeVal + skipValue, duration) + player.seek(to: CMTime(seconds: currentTimeVal, preferredTimescale: 600)) + animateButtonRotation(forwardButton) + } + + @objc private func handleUpArrow() { + let skipValue = 60.0 + currentTimeVal = min(currentTimeVal + skipValue, duration) + player.seek(to: CMTime(seconds: currentTimeVal, preferredTimescale: 600)) + animateButtonRotation(forwardButton) + } + + @objc private func handleDownArrow() { + let skipValue = 60.0 + currentTimeVal = max(currentTimeVal - skipValue, 0) + player.seek(to: CMTime(seconds: currentTimeVal, preferredTimescale: 600)) + animateButtonRotation(backwardButton, clockwise: false) + } + + @objc private func handleEscape() { + dismiss(animated: true, completion: nil) + } } class GradientOverlayButton: UIButton { diff --git a/Sora/Utils/TabBar/TabBar.swift b/Sora/Utils/TabBar/TabBar.swift index a646e58..ef3758c 100644 --- a/Sora/Utils/TabBar/TabBar.swift +++ b/Sora/Utils/TabBar/TabBar.swift @@ -90,7 +90,7 @@ struct TabBar: View { .stroke( LinearGradient( gradient: Gradient(stops: [ - .init(color: Color.accentColor.opacity(gradientOpacity), location: 0), + .init(color: Color.accentColor.opacity(0.25), location: 0), .init(color: Color.accentColor.opacity(0), location: 1) ]), startPoint: .top, diff --git a/Sora/Views/DownloadView.swift b/Sora/Views/DownloadView.swift index 6871a74..31afe1b 100644 --- a/Sora/Views/DownloadView.swift +++ b/Sora/Views/DownloadView.swift @@ -293,29 +293,15 @@ struct CustomDownloadHeader: View { Image(systemName: isSearchActive ? "xmark.circle.fill" : "magnifyingglass") .resizable() .scaledToFit() - .frame(width: 24, height: 24) + .frame(width: 18, height: 18) .foregroundColor(.accentColor) - .padding(6) + .padding(10) .background( Circle() .fill(Color.gray.opacity(0.2)) .shadow(color: .accentColor.opacity(0.2), radius: 2) ) - .overlay( - Circle() - .stroke( - LinearGradient( - gradient: Gradient(stops: [ - .init(color: Color.accentColor.opacity(0.25), location: 0), - .init(color: Color.accentColor.opacity(0), location: 1) - ]), - startPoint: .top, - endPoint: .bottom - ), - lineWidth: 0.5 - ) - .frame(width: 32, height: 32) - ) + .circularGradientOutline() } if showSortMenu { @@ -336,28 +322,15 @@ struct CustomDownloadHeader: View { Image(systemName: "arrow.up.arrow.down") .resizable() .scaledToFit() - .frame(width: 24, height: 24) + .frame(width: 18, height: 18) .foregroundColor(.accentColor) - .padding(6) + .padding(10) .background( Circle() .fill(Color.gray.opacity(0.2)) .shadow(color: .accentColor.opacity(0.2), radius: 2) ) - .overlay( - Circle() - .stroke( - LinearGradient( - gradient: Gradient(stops: [ - .init(color: Color.accentColor.opacity(0.25), location: 0), - .init(color: Color.accentColor.opacity(0), location: 1) - ]), - startPoint: .top, - endPoint: .bottom - ), - lineWidth: 0.5 - ) - ) + .circularGradientOutline() } } } @@ -370,8 +343,10 @@ struct CustomDownloadHeader: View { HStack(spacing: 12) { HStack(spacing: 12) { Image(systemName: "magnifyingglass") + .resizable() + .scaledToFit() + .frame(width: 18, height: 18) .foregroundColor(.secondary) - .font(.body) TextField("Search downloads", text: $searchText) .textFieldStyle(PlainTextFieldStyle()) @@ -382,8 +357,10 @@ struct CustomDownloadHeader: View { searchText = "" }) { Image(systemName: "xmark.circle.fill") + .resizable() + .scaledToFit() + .frame(width: 18, height: 18) .foregroundColor(.secondary) - .font(.body) } } } diff --git a/Sora/Views/LibraryView/LibraryView.swift b/Sora/Views/LibraryView/LibraryView.swift index 1aa5829..b25ae8e 100644 --- a/Sora/Views/LibraryView/LibraryView.swift +++ b/Sora/Views/LibraryView/LibraryView.swift @@ -303,8 +303,6 @@ struct ContinueWatchingCell: View { } .overlay( ZStack { - ProgressiveBlurView() - .cornerRadius(10, corners: [.bottomLeft, .bottomRight]) VStack(alignment: .leading, spacing: 4) { Spacer() diff --git a/Sulfur.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Sulfur.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 0b5a161..d8a331d 100644 --- a/Sulfur.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Sulfur.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,4 +1,5 @@ { + "originHash" : "e12f82ce5205016ea66a114308acd41450cfe950ccb1aacfe0e26181d2036fa4", "pins" : [ { "identity" : "drops", @@ -28,5 +29,5 @@ } } ], - "version" : 2 + "version" : 3 }