diff --git a/JellyfinPlayer.xcodeproj/project.pbxproj b/JellyfinPlayer.xcodeproj/project.pbxproj index a14cc354..82fa766e 100644 --- a/JellyfinPlayer.xcodeproj/project.pbxproj +++ b/JellyfinPlayer.xcodeproj/project.pbxproj @@ -10,6 +10,7 @@ 5302F82A2658791C00647A2E /* Sentry in Frameworks */ = {isa = PBXBuildFile; productRef = 5302F8292658791C00647A2E /* Sentry */; }; 53192D5D265AA78A008A4215 /* DeviceProfileBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53192D5C265AA78A008A4215 /* DeviceProfileBuilder.swift */; }; 5335256E265E8D5A006CCA86 /* VideoPlayerViewRefactored.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5335256D265E8D5A006CCA86 /* VideoPlayerViewRefactored.swift */; }; + 53352571265EA0A0006CCA86 /* Introspect in Frameworks */ = {isa = PBXBuildFile; productRef = 53352570265EA0A0006CCA86 /* Introspect */; }; 5338F74E263B61370014BF09 /* ConnectToServerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5338F74D263B61370014BF09 /* ConnectToServerView.swift */; }; 5338F754263B65E10014BF09 /* SwiftyRequest in Frameworks */ = {isa = PBXBuildFile; productRef = 5338F753263B65E10014BF09 /* SwiftyRequest */; }; 5338F757263B7E2E0014BF09 /* KeychainSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 5338F756263B7E2E0014BF09 /* KeychainSwift */; }; @@ -115,6 +116,7 @@ 5338F757263B7E2E0014BF09 /* KeychainSwift in Frameworks */, 53D5E3DD264B47EE00BADDC8 /* MobileVLCKit.xcframework in Frameworks */, 5338F754263B65E10014BF09 /* SwiftyRequest in Frameworks */, + 53352571265EA0A0006CCA86 /* Introspect in Frameworks */, 5302F82A2658791C00647A2E /* Sentry in Frameworks */, 5389277A263CBFE70035E14B /* SwiftyJSON in Frameworks */, ); @@ -251,6 +253,7 @@ 53892779263CBFE70035E14B /* SwiftyJSON */, 538CD953263E3DC100BB5AF0 /* SDWebImageSwiftUI */, 5302F8292658791C00647A2E /* Sentry */, + 53352570265EA0A0006CCA86 /* Introspect */, ); productName = JellyfinPlayer; productReference = 5377CBF1263B596A003A4E83 /* JellyfinPlayer.app */; @@ -288,6 +291,7 @@ 53892778263CBFE70035E14B /* XCRemoteSwiftPackageReference "SwiftyJSON" */, 538CD952263E3DC100BB5AF0 /* XCRemoteSwiftPackageReference "SDWebImageSwiftUI" */, 5302F8282658791C00647A2E /* XCRemoteSwiftPackageReference "sentry-cocoa" */, + 5335256F265EA0A0006CCA86 /* XCRemoteSwiftPackageReference "SwiftUI-Introspect" */, ); productRefGroup = 5377CBF2263B596A003A4E83 /* Products */; projectDirPath = ""; @@ -553,6 +557,14 @@ minimumVersion = 7.1.0; }; }; + 5335256F265EA0A0006CCA86 /* XCRemoteSwiftPackageReference "SwiftUI-Introspect" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/siteline/SwiftUI-Introspect"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 0.1.3; + }; + }; 5338F752263B65E10014BF09 /* XCRemoteSwiftPackageReference "SwiftyRequest" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/Kitura/SwiftyRequest"; @@ -593,6 +605,11 @@ package = 5302F8282658791C00647A2E /* XCRemoteSwiftPackageReference "sentry-cocoa" */; productName = Sentry; }; + 53352570265EA0A0006CCA86 /* Introspect */ = { + isa = XCSwiftPackageProductDependency; + package = 5335256F265EA0A0006CCA86 /* XCRemoteSwiftPackageReference "SwiftUI-Introspect" */; + productName = Introspect; + }; 5338F753263B65E10014BF09 /* SwiftyRequest */ = { isa = XCSwiftPackageProductDependency; package = 5338F752263B65E10014BF09 /* XCRemoteSwiftPackageReference "SwiftyRequest" */; diff --git a/JellyfinPlayer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/JellyfinPlayer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 20f88694..627e89b9 100644 --- a/JellyfinPlayer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/JellyfinPlayer.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -100,6 +100,15 @@ "version": "2.13.1" } }, + { + "package": "Introspect", + "repositoryURL": "https://github.com/siteline/SwiftUI-Introspect", + "state": { + "branch": null, + "revision": "2e09be8af614401bc9f87d40093ec19ce56ccaf2", + "version": "0.1.3" + } + }, { "package": "SwiftyJSON", "repositoryURL": "https://github.com/SwiftyJSON/SwiftyJSON", diff --git a/JellyfinPlayer/ContentView.swift b/JellyfinPlayer/ContentView.swift index b4625692..1e69710a 100644 --- a/JellyfinPlayer/ContentView.swift +++ b/JellyfinPlayer/ContentView.swift @@ -130,6 +130,10 @@ struct ContentView: View { } } } + + dump(_libraries.wrappedValue) + dump(_librariesShowRecentlyAdded.wrappedValue) + dump(_library_names.wrappedValue) } catch { } @@ -181,8 +185,8 @@ struct ContentView: View { } else { if(!jsi.did) { LoadingView(isShowing: $isLoading) { - NavigationView() { - TabView(selection: $tabSelection) { + TabView(selection: $tabSelection) { + NavigationView() { VStack(alignment: .leading) { ScrollView() { Spacer().frame(height: orientationInfo.orientation == .portrait ? 0 : 15) @@ -213,23 +217,24 @@ struct ContentView: View { } } }.fullScreenCover( isPresented: $showSettingsPopover) { SettingsView(viewModel: SettingsViewModel(), close: $showSettingsPopover) } - .tabItem({ - Text("Home") - Image(systemName: "house") - }) - .tag("Home") - - NavigationView() { - LibraryView(prefill: "", names: library_names, libraries: libraries) - }.navigationViewStyle(StackNavigationViewStyle()) - .tabItem({ - Text("All Media") - Image(systemName: "folder") - }) - .tag("All Media") } + .navigationViewStyle(StackNavigationViewStyle()) + .tabItem({ + Text("Home") + Image(systemName: "house") + }) + .tag("Home") + + NavigationView() { + LibraryView(prefill: "", names: library_names, libraries: libraries) + } + .navigationViewStyle(StackNavigationViewStyle()) + .tabItem({ + Text("All Media") + Image(systemName: "folder") + }) + .tag("All Media") } - .navigationViewStyle(StackNavigationViewStyle()) } .environmentObject(globalData) .onAppear(perform: startup) diff --git a/JellyfinPlayer/ItemView.swift b/JellyfinPlayer/ItemView.swift index 5fe78993..07790b7c 100644 --- a/JellyfinPlayer/ItemView.swift +++ b/JellyfinPlayer/ItemView.swift @@ -6,6 +6,7 @@ // import SwiftUI +import Introspect struct ItemView: View { var item: ResumeItem; @@ -15,16 +16,31 @@ struct ItemView: View { } var body: some View { - if(item.Type == "Movie") { - MovieItemView(item: self.item) - } else if(item.Type == "Season") { - SeasonItemView(item: self.item) - } else if(item.Type == "Series") { - SeriesItemView(item: self.item) - } else if(item.Type == "Episode") { - EpisodeItemView(item: self.item) - } else { - Text("Type: \(item.Type) not implemented yet :(") + Group { + NavigationLink(destination: EmptyView(), label: {}) + NavigationLink(destination: EmptyView(), label: {}) + if(item.Type == "Movie") { + MovieItemView(item: self.item) + } else if(item.Type == "Season") { + SeasonItemView(item: self.item) + } else if(item.Type == "Series") { + SeriesItemView(item: self.item) + } else if(item.Type == "Episode") { + EpisodeItemView(item: self.item) + } else { + Text("Type: \(item.Type) not implemented yet :(") + } } + .introspectTabBarController { (UITabBarController) in + UITabBarController.tabBar.isHidden = false + } + .navigationBarHidden(false) + .navigationBarBackButtonHidden(false) + .statusBar(hidden: false) + .prefersHomeIndicatorAutoHidden(false) + .preferredColorScheme(.none) + .edgesIgnoringSafeArea([]) + .overrideViewPreference(.unspecified) + .supportedOrientations(.allButUpsideDown) } } diff --git a/JellyfinPlayer/LibraryView.swift b/JellyfinPlayer/LibraryView.swift index 838b081f..bdb9d473 100644 --- a/JellyfinPlayer/LibraryView.swift +++ b/JellyfinPlayer/LibraryView.swift @@ -280,6 +280,8 @@ struct LibraryView: View { .onChange(of: filterString) { tag in isLoading = true; items = []; + firstItemIndex = 0; + lastItemIndex = itemsPerPage; loadItems(); } .navigationTitle(extraParam == "" ? (library_names[prefill_id] ?? "Library") : title) @@ -322,7 +324,7 @@ struct LibraryView: View { Text(library_names[id] ?? "").foregroundColor(Color.primary) } } - }.onAppear(perform: listOnAppear).overrideViewPreference(.unspecified).navigationTitle("All Media") + }.onAppear(perform: listOnAppear).navigationTitle("All Media") .toolbar { ToolbarItemGroup(placement: .navigationBarTrailing) { NavigationLink(destination: LibrarySearchView(url: "/Users/\(globalData.user?.user_id ?? "")/Items?Limit=300&StartIndex=0&Recursive=true&Fields=PrimaryImageAspectRatio%2CBasicSyncInfo&ImageTypeLimit=1&EnableImageTypes=Primary%2CBackdrop%2CThumb%2CBanner&IncludeItemTypes=Movie,Series\(extraParam)", close: $closeSearch), isActive: $closeSearch) { diff --git a/JellyfinPlayer/VideoPlayerViewRefactored.swift b/JellyfinPlayer/VideoPlayerViewRefactored.swift index ba88f1fe..dbd0b4b4 100644 --- a/JellyfinPlayer/VideoPlayerViewRefactored.swift +++ b/JellyfinPlayer/VideoPlayerViewRefactored.swift @@ -15,6 +15,9 @@ struct VideoPlayerViewRefactored: View { var body: some View { LoadingView(isShowing: $shouldShowLoadingView) { Text("content") + .introspectTabBarController { (UITabBarController) in + UITabBarController.tabBar.isHidden = true + } } .navigationBarHidden(true) .navigationBarBackButtonHidden(true) @@ -23,5 +26,7 @@ struct VideoPlayerViewRefactored: View { .preferredColorScheme(.dark) .edgesIgnoringSafeArea(.all) .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity) + .overrideViewPreference(.unspecified) + .supportedOrientations(.landscape) } }