Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/react-native/React/CoreModules/RCTLogBoxView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ @implementation RCTLogBoxView {
- (instancetype)initWithFrame:(CGRect)frame
{
if ((self = [super initWithFrame:frame]) != nullptr) {
#if !TARGET_OS_TV
self.windowLevel = UIWindowLevelStatusBar - 1;
#endif
self.backgroundColor = [UIColor clearColor];
}
return self;
Expand All @@ -40,7 +42,9 @@ - (instancetype)initWithWindow:(UIWindow *)window bridge:(RCTBridge *)bridge
{
self = [super initWithWindowScene:window.windowScene];

#if !TARGET_OS_TV
self.windowLevel = UIWindowLevelStatusBar - 1;
#endif
self.backgroundColor = [UIColor clearColor];

_surface = [[RCTSurface alloc] initWithBridge:bridge moduleName:@"LogBox" initialProperties:@{}];
Expand Down
4 changes: 4 additions & 0 deletions packages/react-native/React/CoreModules/RCTRedBox.mm
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ - (void)viewDidLoad
_stackTraceTableView.delegate = self;
_stackTraceTableView.dataSource = self;
_stackTraceTableView.backgroundColor = [UIColor clearColor];
#if !TARGET_OS_TV
_stackTraceTableView.separatorColor = [UIColor colorWithWhite:1 alpha:0.3];
_stackTraceTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
#endif
_stackTraceTableView.indicatorStyle = UIScrollViewIndicatorStyleWhite;
[self.view addSubview:_stackTraceTableView];

Expand Down Expand Up @@ -308,8 +310,10 @@ - (void)copyStack
[fullStackTrace appendFormat:@" %@\n", [self formatFrameSource:stackFrame]];
}
}
#if !TARGET_OS_TV
UIPasteboard *pb = [UIPasteboard generalPasteboard];
[pb setString:fullStackTrace];
#endif
}

- (NSString *)formatFrameSource:(RCTJSStackFrame *)stackFrame
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
@implementation RCTInputAccessoryComponentView {
InputAccessoryShadowNode::ConcreteState::Shared _state;
RCTInputAccessoryContentView *_contentView;
#if !TARGET_OS_TV
RCTSurfaceTouchHandler *_touchHandler;
#endif
UIView<RCTBackedTextInputViewProtocol> __weak *_textInput;
}

Expand All @@ -52,8 +54,10 @@ - (instancetype)initWithFrame:(CGRect)frame
if (self = [super initWithFrame:frame]) {
_props = InputAccessoryShadowNode::defaultSharedProps();
_contentView = [RCTInputAccessoryContentView new];
#if !TARGET_OS_TV
_touchHandler = [RCTSurfaceTouchHandler new];
[_touchHandler attachToView:_contentView];
#endif
}

return self;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@

@implementation RCTFabricModalHostViewController {
CGRect _lastViewBounds;
#if !TARGET_OS_TV
RCTSurfaceTouchHandler *_touchHandler;
#endif
}

- (instancetype)init
{
if ((self = [super init]) == nullptr) {
return nil;
}
#if !TARGET_OS_TV
_touchHandler = [RCTSurfaceTouchHandler new];
#endif

return self;
}
Expand All @@ -37,7 +41,9 @@ - (void)viewDidLayoutSubviews
- (void)loadView
{
self.view = [UIView new];
#if !TARGET_OS_TV
[_touchHandler attachToView:self.view];
#endif
}

- (UIStatusBarStyle)preferredStatusBarStyle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#import "RCTConversions.h"
#import "RCTTouchableComponentViewProtocol.h"

#if !TARGET_OS_TV

using namespace facebook::react;

typedef NS_ENUM(NSInteger, RCTPointerEventType) {
Expand Down Expand Up @@ -771,3 +773,5 @@ - (void)hovering:(UIHoverGestureRecognizer *)recognizer
}

@end

#endif // !TARGET_OS_TV
4 changes: 4 additions & 0 deletions packages/react-native/React/Fabric/RCTSurfaceTouchHandler.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#import "RCTSurfacePointerHandler.h"
#import "RCTTouchableComponentViewProtocol.h"

#if !TARGET_OS_TV

using namespace facebook::react;

typedef NS_ENUM(NSInteger, RCTTouchEventType) {
Expand Down Expand Up @@ -414,3 +416,5 @@ - (void)_cancelTouches
}

@end

#endif // !TARGET_OS_TV
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ @implementation RCTFabricSurface {

// Can be accessed from the main thread only.
RCTSurfaceView *_Nullable _view;
#if !TARGET_OS_TV
RCTSurfaceTouchHandler *_Nullable _touchHandler;
#endif
}

@synthesize delegate = _delegate;
Expand Down Expand Up @@ -144,8 +146,10 @@ - (RCTSurfaceView *)view
if (!_view) {
_view = [[RCTSurfaceView alloc] initWithSurface:self];
[self _updateLayoutContext];
#if !TARGET_OS_TV
_touchHandler = [RCTSurfaceTouchHandler new];
[_touchHandler attachToView:_view];
#endif
}

return _view;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ - (void)viewDidLoad
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.backgroundColor = [UIColor colorWithRed:0.8 green:0 blue:0 alpha:1];
#if !TARGET_OS_TV
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
#endif
_tableView.indicatorStyle = UIScrollViewIndicatorStyleWhite;
_tableView.allowsSelection = NO;
[self.view addSubview:_tableView];
Expand Down
Loading