mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-05-28 01:28:27 +01:00
Signed-off-by: Lance Chant <13349722+lancechant@users.noreply.github.com> Co-authored-by: Fredrik Burmester <fredrik.burmester@gmail.com>
192 lines
7.3 KiB
Diff
192 lines
7.3 KiB
Diff
diff --git a/node_modules/react-native-screens/.bun-tag-10a3b0add1bd4de6 b/.bun-tag-10a3b0add1bd4de6
|
|
new file mode 100644
|
|
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
|
|
diff --git a/node_modules/react-native-screens/.bun-tag-6a8504b742d5cfff b/.bun-tag-6a8504b742d5cfff
|
|
new file mode 100644
|
|
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
|
|
diff --git a/node_modules/react-native-screens/.bun-tag-d28396854bc27a3d b/.bun-tag-d28396854bc27a3d
|
|
new file mode 100644
|
|
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
|
|
diff --git a/ios/RNSScreenStack.mm b/ios/RNSScreenStack.mm
|
|
index 51f021831aed26a4eed3c85014020423b7b3108b..2f621547932806b94ab1e75ecc73772facd209d0 100644
|
|
--- a/ios/RNSScreenStack.mm
|
|
+++ b/ios/RNSScreenStack.mm
|
|
@@ -34,6 +34,11 @@
|
|
#import "integrations/RNSDismissibleModalProtocol.h"
|
|
#import "utils/UINavigationBar+RNSUtility.h"
|
|
|
|
+#if TARGET_OS_TV
|
|
+#import <React/RCTTVNavigationEventNotification.h>
|
|
+#import <React/RCTTVRemoteHandler.h>
|
|
+#endif // TARGET_OS_TV
|
|
+
|
|
#ifdef RNS_GAMMA_ENABLED
|
|
#import "RNSFrameCorrectionProvider.h"
|
|
#import "Swift-Bridging.h"
|
|
@@ -43,6 +48,12 @@
|
|
namespace react = facebook::react;
|
|
#endif // RCT_NEW_ARCH_ENABLED
|
|
|
|
+#if TARGET_OS_TV
|
|
+@interface RNSNavigationController ()
|
|
+@property (nonatomic, strong) UITapGestureRecognizer *rnscreens_menuGestureRecognizer;
|
|
+@end
|
|
+#endif // TARGET_OS_TV
|
|
+
|
|
@interface RNSScreenStackView () <
|
|
UINavigationControllerDelegate,
|
|
UIAdaptivePresentationControllerDelegate,
|
|
@@ -62,6 +73,57 @@ namespace react = facebook::react;
|
|
|
|
@implementation RNSNavigationController
|
|
|
|
+#if TARGET_OS_TV
|
|
+- (void)viewDidLoad
|
|
+{
|
|
+ [super viewDidLoad];
|
|
+
|
|
+ self.rnscreens_menuGestureRecognizer =
|
|
+ [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(rnscreens_menuPressed:)];
|
|
+ self.rnscreens_menuGestureRecognizer.allowedPressTypes = @[ @(UIPressTypeMenu) ];
|
|
+
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self
|
|
+ selector:@selector(rnscreens_enableMenuGesture)
|
|
+ name:RCTTVEnableMenuKeyNotification
|
|
+ object:nil];
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self
|
|
+ selector:@selector(rnscreens_disableMenuGesture)
|
|
+ name:RCTTVDisableMenuKeyNotification
|
|
+ object:nil];
|
|
+
|
|
+ if ([RCTTVRemoteHandler useMenuKey]) {
|
|
+ [self rnscreens_enableMenuGesture];
|
|
+ }
|
|
+}
|
|
+
|
|
+- (void)dealloc
|
|
+{
|
|
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
|
|
+}
|
|
+
|
|
+- (void)rnscreens_enableMenuGesture
|
|
+{
|
|
+ if (![self.view.gestureRecognizers containsObject:self.rnscreens_menuGestureRecognizer]) {
|
|
+ [self.view addGestureRecognizer:self.rnscreens_menuGestureRecognizer];
|
|
+ }
|
|
+}
|
|
+
|
|
+- (void)rnscreens_disableMenuGesture
|
|
+{
|
|
+ if ([self.view.gestureRecognizers containsObject:self.rnscreens_menuGestureRecognizer]) {
|
|
+ [self.view removeGestureRecognizer:self.rnscreens_menuGestureRecognizer];
|
|
+ }
|
|
+}
|
|
+
|
|
+- (void)rnscreens_menuPressed:(UIGestureRecognizer *)recognizer
|
|
+{
|
|
+ [[NSNotificationCenter defaultCenter] postNavigationPressEventWithType:RCTTVRemoteEventMenu
|
|
+ keyAction:recognizer.eventKeyAction
|
|
+ tag:nil
|
|
+ target:nil];
|
|
+}
|
|
+#endif // TARGET_OS_TV
|
|
+
|
|
#if !TARGET_OS_TV
|
|
- (UIViewController *)childViewControllerForStatusBarStyle
|
|
{
|
|
diff --git a/ios/gamma/split-view/RNSSplitViewAppearanceApplicator.swift b/ios/gamma/split-view/RNSSplitViewAppearanceApplicator.swift
|
|
index 95c76ccf3528d3a8828e90b272a1d79b0828a139..f29d4df21440d23523ae7a2f6fe71c32154e3928 100644
|
|
--- a/ios/gamma/split-view/RNSSplitViewAppearanceApplicator.swift
|
|
+++ b/ios/gamma/split-view/RNSSplitViewAppearanceApplicator.swift
|
|
@@ -79,11 +79,13 @@ class RNSSplitViewAppearanceApplicator {
|
|
maxWidth: splitView.maximumSupplementaryColumnWidth)
|
|
|
|
#if compiler(>=6.2)
|
|
+ #if !os(tvOS)
|
|
if #available(iOS 26.0, *) {
|
|
validateColumnConstraints(
|
|
minWidth: splitView.minimumInspectorColumnWidth,
|
|
maxWidth: splitView.maximumInspectorColumnWidth)
|
|
}
|
|
+ #endif
|
|
#endif
|
|
|
|
// Step 2.2 - applying updates to columns
|
|
@@ -126,6 +128,7 @@ class RNSSplitViewAppearanceApplicator {
|
|
}
|
|
|
|
#if compiler(>=6.2)
|
|
+ #if !os(tvOS)
|
|
if #available(iOS 26.0, *) {
|
|
if splitView.minimumSecondaryColumnWidth >= 0 {
|
|
splitViewController.minimumSecondaryColumnWidth = splitView.minimumSecondaryColumnWidth
|
|
@@ -159,6 +162,7 @@ class RNSSplitViewAppearanceApplicator {
|
|
splitView.preferredInspectorColumnWidthOrFraction
|
|
}
|
|
}
|
|
+ #endif
|
|
#endif
|
|
|
|
// Step 2.3 - manipulating with inspector column
|
|
diff --git a/ios/gamma/split-view/RNSSplitViewHostController.swift b/ios/gamma/split-view/RNSSplitViewHostController.swift
|
|
index 0421e3ea92fc7bcdf57417b5ee3a62348fce34f5..cd878ab638d3c78a661e2df4c4c1b21011dfcf48 100644
|
|
--- a/ios/gamma/split-view/RNSSplitViewHostController.swift
|
|
+++ b/ios/gamma/split-view/RNSSplitViewHostController.swift
|
|
@@ -386,7 +386,7 @@ extension RNSSplitViewHostController: RNSSplitViewNavigationControllerViewFrameO
|
|
/// @param inspectors An array of inspector-type RNSSplitViewScreenComponentView subviews.
|
|
///
|
|
func maybeSetupInspector(_ inspectors: [RNSSplitViewScreenComponentView]) {
|
|
-
|
|
+ #if !os(tvOS)
|
|
if #available(iOS 26.0, *) {
|
|
let inspector = inspectors.first
|
|
if inspector != nil {
|
|
@@ -395,6 +395,7 @@ extension RNSSplitViewHostController: RNSSplitViewNavigationControllerViewFrameO
|
|
setViewController(inspectorViewController, for: .inspector)
|
|
}
|
|
}
|
|
+ #endif
|
|
}
|
|
|
|
///
|
|
@@ -404,9 +405,11 @@ extension RNSSplitViewHostController: RNSSplitViewNavigationControllerViewFrameO
|
|
/// Uses the UISplitViewController's new API introduced in iOS 26 to show the inspector column.
|
|
///
|
|
func maybeShowInspector() {
|
|
+ #if !os(tvOS)
|
|
if #available(iOS 26.0, *) {
|
|
show(.inspector)
|
|
}
|
|
+ #endif
|
|
}
|
|
|
|
///
|
|
@@ -416,9 +419,11 @@ extension RNSSplitViewHostController: RNSSplitViewNavigationControllerViewFrameO
|
|
/// Uses the UISplitViewController's new API introduced in iOS 26 to hide the inspector column.
|
|
///
|
|
func maybeHideInspector() {
|
|
+ #if !os(tvOS)
|
|
if #available(iOS 26.0, *) {
|
|
hide(.inspector)
|
|
}
|
|
+ #endif
|
|
}
|
|
}
|
|
#endif
|
|
@@ -444,6 +449,7 @@ extension RNSSplitViewHostController: UISplitViewControllerDelegate {
|
|
public func splitViewController(
|
|
_ svc: UISplitViewController, didHide column: UISplitViewController.Column
|
|
) {
|
|
+ #if !os(tvOS)
|
|
if #available(iOS 26.0, *) {
|
|
// TODO: we may consider removing this logic, because it could be handled by onViewDidDisappear on the column level
|
|
// On the other hand, maybe dedicated event related to the inspector would be a better approach.
|
|
@@ -461,6 +467,7 @@ extension RNSSplitViewHostController: UISplitViewControllerDelegate {
|
|
}
|
|
}
|
|
}
|
|
+ #endif
|
|
}
|
|
#endif
|
|
|