react-native-tvos 0.68.0-0 → 0.68.2-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/Components/AppleTV/{TVMenuControl.js → TVEventControl.js} +8 -0
- package/Libraries/Components/AppleTV/tagForComponentOrHandle.js +34 -0
- package/Libraries/Components/Touchable/TouchableHighlight.js +19 -5
- package/Libraries/Components/Touchable/TouchableOpacity.js +10 -7
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/README.md +5 -2
- package/React/Base/RCTRootView.m +2 -3
- package/React/Base/RCTRootViewInternal.h +1 -1
- package/React/Base/RCTTVRemoteHandler.h +26 -15
- package/React/Base/RCTTVRemoteHandler.m +128 -20
- package/React/Base/RCTVersion.m +1 -1
- package/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.mm +1 -1
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h +4 -0
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +83 -30
- package/React/Modules/RCTTVMenuBridge.m +12 -0
- package/React/Views/RCTTVView.h +9 -5
- package/React/Views/RCTTVView.m +98 -52
- package/ReactAndroid/build.gradle +12 -4
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/Android.mk +1 -0
- package/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/Android.mk +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/Android.mk +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Android.mk +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/Android.mk +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/Android.mk +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/reactperflogger/jni/Android.mk +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/Android.mk +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/Android.mk +1 -0
- package/ReactAndroid/src/main/jni/first-party/yogajni/Android.mk +1 -0
- package/ReactAndroid/src/main/jni/react/jni/Android.mk +2 -0
- package/ReactAndroid/src/main/jni/third-party/boost/Android.mk +1 -0
- package/ReactCommon/butter/Android.mk +1 -0
- package/ReactCommon/cxxreact/Android.mk +1 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/hermes/executor/Android.mk +2 -0
- package/ReactCommon/hermes/inspector/Android.mk +1 -0
- package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +6 -6
- package/ReactCommon/jsi/Android.mk +2 -0
- package/ReactCommon/jsiexecutor/Android.mk +1 -0
- package/ReactCommon/jsinspector/Android.mk +1 -0
- package/ReactCommon/logger/Android.mk +1 -0
- package/ReactCommon/react/config/Android.mk +1 -0
- package/ReactCommon/react/debug/Android.mk +1 -0
- package/ReactCommon/react/nativemodule/core/Android.mk +1 -0
- package/ReactCommon/react/nativemodule/samples/platform/android/Android.mk +1 -0
- package/ReactCommon/react/renderer/animations/Android.mk +1 -0
- package/ReactCommon/react/renderer/attributedstring/Android.mk +1 -0
- package/ReactCommon/react/renderer/componentregistry/Android.mk +1 -0
- package/ReactCommon/react/renderer/componentregistry/native/Android.mk +1 -0
- package/ReactCommon/react/renderer/components/image/Android.mk +1 -0
- package/ReactCommon/react/renderer/components/modal/Android.mk +1 -0
- package/ReactCommon/react/renderer/components/progressbar/Android.mk +1 -0
- package/ReactCommon/react/renderer/components/root/Android.mk +1 -0
- package/ReactCommon/react/renderer/components/scrollview/Android.mk +1 -0
- package/ReactCommon/react/renderer/components/slider/Android.mk +1 -0
- package/ReactCommon/react/renderer/components/switch/Android.mk +1 -0
- package/ReactCommon/react/renderer/components/text/Android.mk +1 -0
- package/ReactCommon/react/renderer/components/textinput/Android.mk +1 -0
- package/ReactCommon/react/renderer/components/unimplementedview/Android.mk +1 -0
- package/ReactCommon/react/renderer/components/view/Android.mk +1 -0
- package/ReactCommon/react/renderer/core/Android.mk +1 -0
- package/ReactCommon/react/renderer/debug/Android.mk +1 -0
- package/ReactCommon/react/renderer/graphics/Android.mk +1 -0
- package/ReactCommon/react/renderer/imagemanager/Android.mk +1 -0
- package/ReactCommon/react/renderer/leakchecker/Android.mk +1 -0
- package/ReactCommon/react/renderer/mapbuffer/Android.mk +1 -0
- package/ReactCommon/react/renderer/mounting/Android.mk +1 -0
- package/ReactCommon/react/renderer/runtimescheduler/Android.mk +1 -0
- package/ReactCommon/react/renderer/scheduler/Android.mk +1 -0
- package/ReactCommon/react/renderer/telemetry/Android.mk +1 -0
- package/ReactCommon/react/renderer/templateprocessor/Android.mk +1 -0
- package/ReactCommon/react/renderer/textlayoutmanager/Android.mk +1 -0
- package/ReactCommon/react/renderer/uimanager/Android.mk +1 -0
- package/ReactCommon/react/utils/Android.mk +1 -0
- package/ReactCommon/reactperflogger/Android.mk +1 -0
- package/ReactCommon/yoga/Android.mk +1 -0
- package/android/com/facebook/react/react-native/{0.68.0-0/react-native-0.68.0-0-sources.jar → 0.68.2-0/react-native-0.68.2-0-sources.jar} +0 -0
- package/android/com/facebook/react/react-native/0.68.2-0/react-native-0.68.2-0-sources.jar.md5 +1 -0
- package/android/com/facebook/react/react-native/0.68.2-0/react-native-0.68.2-0-sources.jar.sha1 +1 -0
- package/android/com/facebook/react/react-native/0.68.2-0/react-native-0.68.2-0-sources.jar.sha256 +1 -0
- package/android/com/facebook/react/react-native/0.68.2-0/react-native-0.68.2-0-sources.jar.sha512 +1 -0
- package/android/com/facebook/react/react-native/{0.68.0-0/react-native-0.68.0-0.aar → 0.68.2-0/react-native-0.68.2-0.aar} +0 -0
- package/android/com/facebook/react/react-native/0.68.2-0/react-native-0.68.2-0.aar.md5 +1 -0
- package/android/com/facebook/react/react-native/0.68.2-0/react-native-0.68.2-0.aar.sha1 +1 -0
- package/android/com/facebook/react/react-native/0.68.2-0/react-native-0.68.2-0.aar.sha256 +1 -0
- package/android/com/facebook/react/react-native/0.68.2-0/react-native-0.68.2-0.aar.sha512 +1 -0
- package/android/com/facebook/react/react-native/{0.68.0-0/react-native-0.68.0-0.module → 0.68.2-0/react-native-0.68.2-0.module} +15 -15
- package/android/com/facebook/react/react-native/0.68.2-0/react-native-0.68.2-0.module.md5 +1 -0
- package/android/com/facebook/react/react-native/0.68.2-0/react-native-0.68.2-0.module.sha1 +1 -0
- package/android/com/facebook/react/react-native/0.68.2-0/react-native-0.68.2-0.module.sha256 +1 -0
- package/android/com/facebook/react/react-native/0.68.2-0/react-native-0.68.2-0.module.sha512 +1 -0
- package/android/com/facebook/react/react-native/{0.68.0-0/react-native-0.68.0-0.pom → 0.68.2-0/react-native-0.68.2-0.pom} +1 -1
- package/android/com/facebook/react/react-native/0.68.2-0/react-native-0.68.2-0.pom.md5 +1 -0
- package/android/com/facebook/react/react-native/0.68.2-0/react-native-0.68.2-0.pom.sha1 +1 -0
- package/android/com/facebook/react/react-native/0.68.2-0/react-native-0.68.2-0.pom.sha256 +1 -0
- package/android/com/facebook/react/react-native/0.68.2-0/react-native-0.68.2-0.pom.sha512 +1 -0
- package/android/com/facebook/react/react-native/maven-metadata.xml +4 -4
- package/android/com/facebook/react/react-native/maven-metadata.xml.md5 +1 -1
- package/android/com/facebook/react/react-native/maven-metadata.xml.sha1 +1 -1
- package/android/com/facebook/react/react-native/maven-metadata.xml.sha256 +1 -1
- package/android/com/facebook/react/react-native/maven-metadata.xml.sha512 +1 -1
- package/index.js +9 -2
- package/package.json +5 -5
- package/template/Gemfile.lock +2 -2
- package/template/android/app/build.gradle +10 -0
- package/template/android/build.gradle +10 -1
- package/template/package.json +1 -1
- package/tvos-types.d.ts +23 -18
- package/android/com/facebook/react/react-native/0.68.0-0/react-native-0.68.0-0-sources.jar.md5 +0 -1
- package/android/com/facebook/react/react-native/0.68.0-0/react-native-0.68.0-0-sources.jar.sha1 +0 -1
- package/android/com/facebook/react/react-native/0.68.0-0/react-native-0.68.0-0-sources.jar.sha256 +0 -1
- package/android/com/facebook/react/react-native/0.68.0-0/react-native-0.68.0-0-sources.jar.sha512 +0 -1
- package/android/com/facebook/react/react-native/0.68.0-0/react-native-0.68.0-0.aar.md5 +0 -1
- package/android/com/facebook/react/react-native/0.68.0-0/react-native-0.68.0-0.aar.sha1 +0 -1
- package/android/com/facebook/react/react-native/0.68.0-0/react-native-0.68.0-0.aar.sha256 +0 -1
- package/android/com/facebook/react/react-native/0.68.0-0/react-native-0.68.0-0.aar.sha512 +0 -1
- package/android/com/facebook/react/react-native/0.68.0-0/react-native-0.68.0-0.module.md5 +0 -1
- package/android/com/facebook/react/react-native/0.68.0-0/react-native-0.68.0-0.module.sha1 +0 -1
- package/android/com/facebook/react/react-native/0.68.0-0/react-native-0.68.0-0.module.sha256 +0 -1
- package/android/com/facebook/react/react-native/0.68.0-0/react-native-0.68.0-0.module.sha512 +0 -1
- package/android/com/facebook/react/react-native/0.68.0-0/react-native-0.68.0-0.pom.md5 +0 -1
- package/android/com/facebook/react/react-native/0.68.0-0/react-native-0.68.0-0.pom.sha1 +0 -1
- package/android/com/facebook/react/react-native/0.68.0-0/react-native-0.68.0-0.pom.sha256 +0 -1
- package/android/com/facebook/react/react-native/0.68.0-0/react-native-0.68.0-0.pom.sha512 +0 -1
|
@@ -309,41 +309,92 @@ using namespace facebook::react;
|
|
|
309
309
|
return _props->isTVSelectable;
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
self
|
|
324
|
-
|
|
325
|
-
|
|
312
|
+
// In tvOS, to support directional focus APIs, we add a UIFocusGuide for each
|
|
313
|
+
// side of the view where a nextFocus has been set. Set layout constraints to
|
|
314
|
+
// make the guide 1 px thick, and set the destination to the nextFocus object.
|
|
315
|
+
//
|
|
316
|
+
// This is only done once the view is focused.
|
|
317
|
+
//
|
|
318
|
+
- (void)enableDirectionalFocusGuides
|
|
319
|
+
{
|
|
320
|
+
if (self->_nextFocusUp != nil) {
|
|
321
|
+
if (self.focusGuideUp == nil) {
|
|
322
|
+
self.focusGuideUp = [UIFocusGuide new];
|
|
323
|
+
[[self containingRootView] addLayoutGuide:self.focusGuideUp];
|
|
324
|
+
|
|
325
|
+
[self.focusGuideUp.bottomAnchor constraintEqualToAnchor:self.topAnchor].active = YES;
|
|
326
|
+
[self.focusGuideUp.widthAnchor constraintEqualToAnchor:self.widthAnchor].active = YES;
|
|
327
|
+
[self.focusGuideUp.heightAnchor constraintEqualToConstant:1.0].active = YES;
|
|
328
|
+
[self.focusGuideUp.leftAnchor constraintEqualToAnchor:self.leftAnchor].active = YES;
|
|
326
329
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
330
|
+
|
|
331
|
+
self.focusGuideUp.preferredFocusEnvironments = @[self->_nextFocusUp];
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
if (self->_nextFocusDown != nil) {
|
|
335
|
+
if (self.focusGuideDown == nil) {
|
|
336
|
+
self.focusGuideDown = [UIFocusGuide new];
|
|
337
|
+
[[self containingRootView] addLayoutGuide:self.focusGuideDown];
|
|
338
|
+
|
|
339
|
+
[self.focusGuideDown.topAnchor constraintEqualToAnchor:self.bottomAnchor].active = YES;
|
|
340
|
+
[self.focusGuideDown.widthAnchor constraintEqualToAnchor:self.widthAnchor].active = YES;
|
|
341
|
+
[self.focusGuideDown.heightAnchor constraintEqualToConstant:1.0].active = YES;
|
|
342
|
+
[self.focusGuideDown.leftAnchor constraintEqualToAnchor:self.leftAnchor].active = YES;
|
|
331
343
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
344
|
+
|
|
345
|
+
self.focusGuideDown.preferredFocusEnvironments = @[self->_nextFocusDown];
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
if (self->_nextFocusLeft != nil) {
|
|
349
|
+
if (self.focusGuideLeft == nil) {
|
|
350
|
+
self.focusGuideLeft = [UIFocusGuide new];
|
|
351
|
+
[[self containingRootView] addLayoutGuide:self.focusGuideLeft];
|
|
352
|
+
|
|
353
|
+
[self.focusGuideLeft.topAnchor constraintEqualToAnchor:self.topAnchor].active = YES;
|
|
354
|
+
[self.focusGuideLeft.widthAnchor constraintEqualToConstant:1.0].active = YES;
|
|
355
|
+
[self.focusGuideLeft.heightAnchor constraintEqualToAnchor:self.heightAnchor].active = YES;
|
|
356
|
+
[self.focusGuideLeft.rightAnchor constraintEqualToAnchor:self.leftAnchor].active = YES;
|
|
336
357
|
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
358
|
+
|
|
359
|
+
self.focusGuideLeft.preferredFocusEnvironments = @[self->_nextFocusLeft];
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
if (self->_nextFocusRight != nil) {
|
|
363
|
+
if (self.focusGuideRight == nil) {
|
|
364
|
+
self.focusGuideRight = [UIFocusGuide new];
|
|
365
|
+
[[self containingRootView] addLayoutGuide:self.focusGuideRight];
|
|
366
|
+
|
|
367
|
+
[self.focusGuideRight.topAnchor constraintEqualToAnchor:self.topAnchor].active = YES;
|
|
368
|
+
[self.focusGuideRight.widthAnchor constraintEqualToConstant:1.0].active = YES;
|
|
369
|
+
[self.focusGuideRight.heightAnchor constraintEqualToAnchor:self.heightAnchor].active = YES;
|
|
370
|
+
[self.focusGuideRight.leftAnchor constraintEqualToAnchor:self.rightAnchor].active = YES;
|
|
341
371
|
}
|
|
342
|
-
|
|
343
|
-
|
|
372
|
+
|
|
373
|
+
self.focusGuideRight.preferredFocusEnvironments = @[self->_nextFocusRight];
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
// Called when focus leaves this view -- disable the directional focus guides
|
|
377
|
+
// (if they exist) so that they don't interfere with focus navigation from
|
|
378
|
+
// other views
|
|
379
|
+
//
|
|
380
|
+
- (void)disableDirectionalFocusGuides
|
|
381
|
+
{
|
|
382
|
+
if (self.focusGuideUp != nil) {
|
|
383
|
+
[[self containingRootView] removeLayoutGuide:self.focusGuideUp];
|
|
384
|
+
self.focusGuideUp = nil;
|
|
385
|
+
}
|
|
386
|
+
if (self.focusGuideDown != nil) {
|
|
387
|
+
[[self containingRootView] removeLayoutGuide:self.focusGuideDown];
|
|
388
|
+
self.focusGuideDown = nil;
|
|
389
|
+
}
|
|
390
|
+
if (self.focusGuideLeft != nil) {
|
|
391
|
+
[[self containingRootView] removeLayoutGuide:self.focusGuideLeft];
|
|
392
|
+
self.focusGuideLeft = nil;
|
|
393
|
+
}
|
|
394
|
+
if (self.focusGuideRight != nil) {
|
|
395
|
+
[[self containingRootView] removeLayoutGuide:self.focusGuideRight];
|
|
396
|
+
self.focusGuideRight = nil;
|
|
344
397
|
}
|
|
345
|
-
self->_nextFocusActiveTarget = nil;
|
|
346
|
-
return true;
|
|
347
398
|
}
|
|
348
399
|
|
|
349
400
|
- (void)didUpdateFocusInContext:(UIFocusUpdateContext *)context withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator
|
|
@@ -353,11 +404,13 @@ using namespace facebook::react;
|
|
|
353
404
|
}
|
|
354
405
|
if (context.nextFocusedView == self && self.isUserInteractionEnabled ) {
|
|
355
406
|
[self becomeFirstResponder];
|
|
407
|
+
[self enableDirectionalFocusGuides];
|
|
356
408
|
[coordinator addCoordinatedAnimations:^(void){
|
|
357
409
|
[self addParallaxMotionEffects];
|
|
358
410
|
[self sendFocusNotification:context];
|
|
359
411
|
} completion:^(void){}];
|
|
360
412
|
} else {
|
|
413
|
+
[self disableDirectionalFocusGuides];
|
|
361
414
|
[coordinator addCoordinatedAnimations:^(void){
|
|
362
415
|
[self removeParallaxMotionEffects];
|
|
363
416
|
[self sendBlurNotification:context];
|
|
@@ -24,4 +24,16 @@ RCT_EXPORT_METHOD(disableTVMenuKey)
|
|
|
24
24
|
[[NSNotificationCenter defaultCenter] postNotificationName:RCTTVDisableMenuKeyNotification object:nil];
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
RCT_EXPORT_METHOD(enableTVPanGesture)
|
|
28
|
+
{
|
|
29
|
+
[RCTTVRemoteHandler setUsePanGesture:YES];
|
|
30
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:RCTTVEnablePanGestureNotification object:nil];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
RCT_EXPORT_METHOD(disableTVPanGesture)
|
|
34
|
+
{
|
|
35
|
+
[RCTTVRemoteHandler setUsePanGesture:NO];
|
|
36
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:RCTTVDisablePanGestureNotification object:nil];
|
|
37
|
+
}
|
|
38
|
+
|
|
27
39
|
@end
|
package/React/Views/RCTTVView.h
CHANGED
|
@@ -32,11 +32,15 @@
|
|
|
32
32
|
/**
|
|
33
33
|
* Focus direction tags
|
|
34
34
|
*/
|
|
35
|
-
@property (nonatomic,
|
|
36
|
-
@property (nonatomic,
|
|
37
|
-
@property (nonatomic,
|
|
38
|
-
@property (nonatomic,
|
|
39
|
-
|
|
35
|
+
@property (nonatomic, weak) RCTTVView * nextFocusUp;
|
|
36
|
+
@property (nonatomic, weak) RCTTVView * nextFocusDown;
|
|
37
|
+
@property (nonatomic, weak) RCTTVView * nextFocusLeft;
|
|
38
|
+
@property (nonatomic, weak) RCTTVView * nextFocusRight;
|
|
39
|
+
|
|
40
|
+
@property (nonatomic, strong) UIFocusGuide * focusGuideUp;
|
|
41
|
+
@property (nonatomic, strong) UIFocusGuide * focusGuideDown;
|
|
42
|
+
@property (nonatomic, strong) UIFocusGuide * focusGuideLeft;
|
|
43
|
+
@property (nonatomic, strong) UIFocusGuide * focusGuideRight;
|
|
40
44
|
|
|
41
45
|
- (instancetype)initWithBridge:(RCTBridge *)bridge;
|
|
42
46
|
|
package/React/Views/RCTTVView.m
CHANGED
|
@@ -127,6 +127,18 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
|
|
|
127
127
|
return (self.isTVSelectable);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
+
- (RCTRootView *)rootView
|
|
131
|
+
{
|
|
132
|
+
UIView *rootview = self;
|
|
133
|
+
while (![rootview isReactRootView] && rootview != nil) {
|
|
134
|
+
rootview = [rootview superview];
|
|
135
|
+
}
|
|
136
|
+
if (rootview == nil) return nil;
|
|
137
|
+
|
|
138
|
+
rootview = [rootview superview];
|
|
139
|
+
return (RCTRootView *)rootview;
|
|
140
|
+
}
|
|
141
|
+
|
|
130
142
|
- (void)addParallaxMotionEffects
|
|
131
143
|
{
|
|
132
144
|
if(![self.tvParallaxProperties[@"enabled"] boolValue]) {
|
|
@@ -237,11 +249,13 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
|
|
|
237
249
|
}
|
|
238
250
|
if (context.nextFocusedView == self && self.isTVSelectable ) {
|
|
239
251
|
[self becomeFirstResponder];
|
|
252
|
+
[self enableDirectionalFocusGuides];
|
|
240
253
|
[coordinator addCoordinatedAnimations:^(void){
|
|
241
254
|
[self addParallaxMotionEffects];
|
|
242
255
|
[self sendFocusNotification:context];
|
|
243
256
|
} completion:^(void){}];
|
|
244
257
|
} else {
|
|
258
|
+
[self disableDirectionalFocusGuides];
|
|
245
259
|
[coordinator addCoordinatedAnimations:^(void){
|
|
246
260
|
[self sendBlurNotification:context];
|
|
247
261
|
[self removeParallaxMotionEffects];
|
|
@@ -250,41 +264,93 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
|
|
|
250
264
|
}
|
|
251
265
|
}
|
|
252
266
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
267
|
+
// In tvOS, to support directional focus APIs, we add a UIFocusGuide for each
|
|
268
|
+
// side of the view where a nextFocus has been set. Set layout constraints to
|
|
269
|
+
// make the guide 1 px thick, and set the destination to the nextFocus object.
|
|
270
|
+
//
|
|
271
|
+
// This is only done once the view is focused.
|
|
272
|
+
//
|
|
273
|
+
- (void)enableDirectionalFocusGuides
|
|
274
|
+
{
|
|
275
|
+
if (self->_nextFocusUp != nil) {
|
|
276
|
+
if (self.focusGuideUp == nil) {
|
|
277
|
+
self.focusGuideUp = [UIFocusGuide new];
|
|
278
|
+
[[self rootView] addLayoutGuide:self.focusGuideUp];
|
|
279
|
+
|
|
280
|
+
[self.focusGuideUp.bottomAnchor constraintEqualToAnchor:self.topAnchor].active = YES;
|
|
281
|
+
[self.focusGuideUp.widthAnchor constraintEqualToAnchor:self.widthAnchor].active = YES;
|
|
282
|
+
[self.focusGuideUp.heightAnchor constraintEqualToConstant:1.0].active = YES;
|
|
283
|
+
[self.focusGuideUp.leftAnchor constraintEqualToAnchor:self.leftAnchor].active = YES;
|
|
259
284
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
285
|
+
|
|
286
|
+
self.focusGuideUp.preferredFocusEnvironments = @[self->_nextFocusUp];
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if (self->_nextFocusDown != nil) {
|
|
290
|
+
if (self.focusGuideDown == nil) {
|
|
291
|
+
self.focusGuideDown = [UIFocusGuide new];
|
|
292
|
+
[[self rootView] addLayoutGuide:self.focusGuideDown];
|
|
293
|
+
|
|
294
|
+
[self.focusGuideDown.topAnchor constraintEqualToAnchor:self.bottomAnchor].active = YES;
|
|
295
|
+
[self.focusGuideDown.widthAnchor constraintEqualToAnchor:self.widthAnchor].active = YES;
|
|
296
|
+
[self.focusGuideDown.heightAnchor constraintEqualToConstant:1.0].active = YES;
|
|
297
|
+
[self.focusGuideDown.leftAnchor constraintEqualToAnchor:self.leftAnchor].active = YES;
|
|
264
298
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
299
|
+
|
|
300
|
+
self.focusGuideDown.preferredFocusEnvironments = @[self->_nextFocusDown];
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
if (self->_nextFocusLeft != nil) {
|
|
304
|
+
if (self.focusGuideLeft == nil) {
|
|
305
|
+
self.focusGuideLeft = [UIFocusGuide new];
|
|
306
|
+
[[self rootView] addLayoutGuide:self.focusGuideLeft];
|
|
307
|
+
|
|
308
|
+
[self.focusGuideLeft.topAnchor constraintEqualToAnchor:self.topAnchor].active = YES;
|
|
309
|
+
[self.focusGuideLeft.widthAnchor constraintEqualToConstant:1.0].active = YES;
|
|
310
|
+
[self.focusGuideLeft.heightAnchor constraintEqualToAnchor:self.heightAnchor].active = YES;
|
|
311
|
+
[self.focusGuideLeft.rightAnchor constraintEqualToAnchor:self.leftAnchor].active = YES;
|
|
269
312
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
313
|
+
|
|
314
|
+
self.focusGuideLeft.preferredFocusEnvironments = @[self->_nextFocusLeft];
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
if (self->_nextFocusRight != nil) {
|
|
318
|
+
if (self.focusGuideRight == nil) {
|
|
319
|
+
self.focusGuideRight = [UIFocusGuide new];
|
|
320
|
+
[[self rootView] addLayoutGuide:self.focusGuideRight];
|
|
321
|
+
|
|
322
|
+
[self.focusGuideRight.topAnchor constraintEqualToAnchor:self.topAnchor].active = YES;
|
|
323
|
+
[self.focusGuideRight.widthAnchor constraintEqualToConstant:1.0].active = YES;
|
|
324
|
+
[self.focusGuideRight.heightAnchor constraintEqualToAnchor:self.heightAnchor].active = YES;
|
|
325
|
+
[self.focusGuideRight.leftAnchor constraintEqualToAnchor:self.rightAnchor].active = YES;
|
|
274
326
|
}
|
|
275
|
-
|
|
276
|
-
|
|
327
|
+
|
|
328
|
+
self.focusGuideRight.preferredFocusEnvironments = @[self->_nextFocusRight];
|
|
277
329
|
}
|
|
278
|
-
self->_nextFocusActiveTarget = nil;
|
|
279
|
-
return true;
|
|
280
330
|
}
|
|
281
331
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
332
|
+
// Called when focus leaves this view -- disable the directional focus guides
|
|
333
|
+
// (if they exist) so that they don't interfere with focus navigation from
|
|
334
|
+
// other views
|
|
335
|
+
//
|
|
336
|
+
- (void)disableDirectionalFocusGuides
|
|
337
|
+
{
|
|
338
|
+
if (self.focusGuideUp != nil) {
|
|
339
|
+
[[self rootView] removeLayoutGuide:self.focusGuideUp];
|
|
340
|
+
self.focusGuideUp = nil;
|
|
341
|
+
}
|
|
342
|
+
if (self.focusGuideDown != nil) {
|
|
343
|
+
[[self rootView] removeLayoutGuide:self.focusGuideDown];
|
|
344
|
+
self.focusGuideDown = nil;
|
|
345
|
+
}
|
|
346
|
+
if (self.focusGuideLeft != nil) {
|
|
347
|
+
[[self rootView] removeLayoutGuide:self.focusGuideLeft];
|
|
348
|
+
self.focusGuideLeft = nil;
|
|
349
|
+
}
|
|
350
|
+
if (self.focusGuideRight != nil) {
|
|
351
|
+
[[self rootView] removeLayoutGuide:self.focusGuideRight];
|
|
352
|
+
self.focusGuideRight = nil;
|
|
353
|
+
}
|
|
288
354
|
}
|
|
289
355
|
|
|
290
356
|
- (void)sendFocusNotification:(__unused UIFocusUpdateContext *)context
|
|
@@ -339,15 +405,11 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
|
|
|
339
405
|
_hasTVPreferredFocus = hasTVPreferredFocus;
|
|
340
406
|
if (hasTVPreferredFocus) {
|
|
341
407
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
342
|
-
|
|
343
|
-
while (![rootview isReactRootView] && rootview != nil) {
|
|
344
|
-
rootview = [rootview superview];
|
|
345
|
-
}
|
|
346
|
-
if (rootview == nil) return;
|
|
408
|
+
RCTRootView *rootview = [self rootView];
|
|
347
409
|
|
|
348
|
-
rootview
|
|
410
|
+
if (rootview == nil) return;
|
|
349
411
|
|
|
350
|
-
[
|
|
412
|
+
[rootview setReactPreferredFocusedView:self];
|
|
351
413
|
[rootview setNeedsFocusUpdate];
|
|
352
414
|
[rootview updateFocusIfNeeded];
|
|
353
415
|
});
|
|
@@ -356,23 +418,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
|
|
|
356
418
|
|
|
357
419
|
- (void)setHasTVPreferredFocus:(BOOL)hasTVPreferredFocus
|
|
358
420
|
{
|
|
359
|
-
|
|
360
|
-
if (hasTVPreferredFocus) {
|
|
361
|
-
dispatch_async(dispatch_get_main_queue(), ^{
|
|
362
|
-
UIView *rootview = self;
|
|
363
|
-
while (![rootview isReactRootView] && rootview != nil) {
|
|
364
|
-
rootview = [rootview superview];
|
|
365
|
-
}
|
|
366
|
-
if (rootview == nil)
|
|
367
|
-
return;
|
|
368
|
-
|
|
369
|
-
rootview = [rootview superview];
|
|
370
|
-
|
|
371
|
-
[(RCTRootView *)rootview setReactPreferredFocusedView:self];
|
|
372
|
-
[rootview setNeedsFocusUpdate];
|
|
373
|
-
[rootview updateFocusIfNeeded];
|
|
374
|
-
});
|
|
375
|
-
}
|
|
421
|
+
[self setPreferredFocus:hasTVPreferredFocus];
|
|
376
422
|
}
|
|
377
423
|
|
|
378
424
|
- (void)addFocusGuide:(NSArray*)destinations {
|
|
@@ -292,10 +292,13 @@ task androidSourcesJar(type: Jar) {
|
|
|
292
292
|
android {
|
|
293
293
|
compileSdkVersion 31
|
|
294
294
|
|
|
295
|
-
// Used to override the NDK path
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
295
|
+
// Used to override the NDK path/version on internal CI or by allowing
|
|
296
|
+
// users to customize the NDK path/version from their root project (e.g. for M1 support)
|
|
297
|
+
if (rootProject.hasProperty("ndkPath")) {
|
|
298
|
+
ndkPath rootProject.ext.ndkPath
|
|
299
|
+
}
|
|
300
|
+
if (rootProject.hasProperty("ndkVersion")) {
|
|
301
|
+
ndkVersion rootProject.ext.ndkVersion
|
|
299
302
|
}
|
|
300
303
|
|
|
301
304
|
defaultConfig {
|
|
@@ -329,6 +332,11 @@ android {
|
|
|
329
332
|
// This flag will suppress "fcntl(): Bad file descriptor" warnings on local builds.
|
|
330
333
|
arguments "--output-sync=none"
|
|
331
334
|
}
|
|
335
|
+
|
|
336
|
+
// Fix for windows limit on number of character in file paths and in command lines
|
|
337
|
+
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
|
338
|
+
arguments "NDK_APP_SHORT_COMMANDS=true"
|
|
339
|
+
}
|
|
332
340
|
}
|
|
333
341
|
}
|
|
334
342
|
ndk {
|
|
@@ -13,6 +13,7 @@ include $(CLEAR_VARS)
|
|
|
13
13
|
LOCAL_MODULE := jsijniprofiler
|
|
14
14
|
|
|
15
15
|
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
|
|
16
|
+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
|
|
16
17
|
|
|
17
18
|
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi $(call find-node-module,$(LOCAL_PATH),hermes-engine)/android/include
|
|
18
19
|
|
|
@@ -12,6 +12,7 @@ include $(CLEAR_VARS)
|
|
|
12
12
|
LOCAL_MODULE := hermes-executor-release
|
|
13
13
|
|
|
14
14
|
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
|
|
15
|
+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
|
|
15
16
|
|
|
16
17
|
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi $(call find-node-module,$(LOCAL_PATH),hermes-engine)/android/include
|
|
17
18
|
|
|
@@ -35,6 +36,7 @@ LOCAL_MODULE := hermes-executor-debug
|
|
|
35
36
|
LOCAL_CFLAGS := -DHERMES_ENABLE_DEBUGGER=1
|
|
36
37
|
|
|
37
38
|
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
|
|
39
|
+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
|
|
38
40
|
|
|
39
41
|
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi $(call find-node-module,$(LOCAL_PATH),hermes-engine)/android/include
|
|
40
42
|
|
|
@@ -26,6 +26,7 @@ LOCAL_MODULE := reactperfloggerjni
|
|
|
26
26
|
|
|
27
27
|
# Compile all local c++ files
|
|
28
28
|
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/reactperflogger/*.cpp)
|
|
29
|
+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
|
|
29
30
|
|
|
30
31
|
# Build the files in this directory as a shared library
|
|
31
32
|
include $(BUILD_SHARED_LIBRARY)
|
|
@@ -28,6 +28,7 @@ LOCAL_MODULE := callinvokerholder
|
|
|
28
28
|
|
|
29
29
|
# Compile all local c++ files
|
|
30
30
|
LOCAL_SRC_FILES := $(LOCAL_PATH)/ReactCommon/CallInvokerHolder.cpp
|
|
31
|
+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
|
|
31
32
|
|
|
32
33
|
# Build the files in this directory as a shared library
|
|
33
34
|
include $(BUILD_STATIC_LIBRARY)
|
|
@@ -56,6 +57,7 @@ LOCAL_STATIC_LIBRARIES = libcallinvokerholder libreactperfloggerjni
|
|
|
56
57
|
|
|
57
58
|
# Compile all local c++ files
|
|
58
59
|
LOCAL_SRC_FILES := $(LOCAL_PATH)/ReactCommon/TurboModuleManager.cpp $(LOCAL_PATH)/ReactCommon/OnLoad.cpp
|
|
60
|
+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
|
|
59
61
|
|
|
60
62
|
# Build the files in this directory as a shared library
|
|
61
63
|
include $(BUILD_SHARED_LIBRARY)
|
|
@@ -47,6 +47,7 @@ LOCAL_MODULE := reactnativeutilsjni
|
|
|
47
47
|
|
|
48
48
|
# Compile all local c++ files.
|
|
49
49
|
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
|
|
50
|
+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
|
|
50
51
|
|
|
51
52
|
ifeq ($(APP_OPTIM),debug)
|
|
52
53
|
# Keep symbols by overriding the strip command invoked by ndk-build.
|
|
@@ -106,6 +107,7 @@ LOCAL_MODULE := reactnativejni
|
|
|
106
107
|
|
|
107
108
|
# Compile all local c++ files.
|
|
108
109
|
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
|
|
110
|
+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
|
|
109
111
|
|
|
110
112
|
ifeq ($(APP_OPTIM),debug)
|
|
111
113
|
# Keep symbols by overriding the strip command invoked by ndk-build.
|
|
@@ -5,6 +5,7 @@ include $(CLEAR_VARS)
|
|
|
5
5
|
# because the react native version does not include anything outside of headers.
|
|
6
6
|
# They are required for Folly futures to compile successfully.
|
|
7
7
|
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/asm/$(TARGET_ARCH)/*.S)
|
|
8
|
+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
|
|
8
9
|
|
|
9
10
|
LOCAL_C_INCLUDES := $(LOCAL_PATH)/boost_1_63_0
|
|
10
11
|
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/boost_1_63_0
|
|
@@ -10,6 +10,7 @@ include $(CLEAR_VARS)
|
|
|
10
10
|
LOCAL_MODULE := reactnative
|
|
11
11
|
|
|
12
12
|
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
|
|
13
|
+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
|
|
13
14
|
|
|
14
15
|
LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
|
|
15
16
|
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
|
|
@@ -12,6 +12,7 @@ include $(CLEAR_VARS)
|
|
|
12
12
|
LOCAL_MODULE := hermes-executor-common-release
|
|
13
13
|
|
|
14
14
|
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
|
|
15
|
+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
|
|
15
16
|
|
|
16
17
|
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi $(call find-node-module,$(LOCAL_PATH),hermes-engine)/android/include
|
|
17
18
|
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
|
|
@@ -27,6 +28,7 @@ LOCAL_MODULE := hermes-executor-common-debug
|
|
|
27
28
|
LOCAL_CFLAGS := -DHERMES_ENABLE_DEBUGGER=1
|
|
28
29
|
|
|
29
30
|
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
|
|
31
|
+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
|
|
30
32
|
|
|
31
33
|
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi $(call find-node-module,$(LOCAL_PATH),hermes-engine)/android/include
|
|
32
34
|
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
|
|
@@ -12,6 +12,7 @@ include $(CLEAR_VARS)
|
|
|
12
12
|
LOCAL_MODULE := hermes-inspector
|
|
13
13
|
|
|
14
14
|
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp $(LOCAL_PATH)/detail/*.cpp $(LOCAL_PATH)/chrome/*.cpp)
|
|
15
|
+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
|
|
15
16
|
|
|
16
17
|
LOCAL_C_ROOT := $(LOCAL_PATH)/../..
|
|
17
18
|
|
|
@@ -1502,9 +1502,9 @@ ansi-escapes@^4.2.1:
|
|
|
1502
1502
|
type-fest "^0.21.3"
|
|
1503
1503
|
|
|
1504
1504
|
ansi-regex@^4.1.0:
|
|
1505
|
-
version "4.1.
|
|
1506
|
-
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.
|
|
1507
|
-
integrity sha512-
|
|
1505
|
+
version "4.1.1"
|
|
1506
|
+
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed"
|
|
1507
|
+
integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==
|
|
1508
1508
|
|
|
1509
1509
|
ansi-regex@^5.0.0:
|
|
1510
1510
|
version "5.0.0"
|
|
@@ -4152,9 +4152,9 @@ minimatch@^3.0.4:
|
|
|
4152
4152
|
brace-expansion "^1.1.7"
|
|
4153
4153
|
|
|
4154
4154
|
minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.5:
|
|
4155
|
-
version "1.2.
|
|
4156
|
-
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.
|
|
4157
|
-
integrity sha512-
|
|
4155
|
+
version "1.2.6"
|
|
4156
|
+
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44"
|
|
4157
|
+
integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==
|
|
4158
4158
|
|
|
4159
4159
|
mississippi@^3.0.0:
|
|
4160
4160
|
version "3.0.0"
|
|
@@ -10,6 +10,7 @@ include $(CLEAR_VARS)
|
|
|
10
10
|
LOCAL_MODULE := jsi
|
|
11
11
|
|
|
12
12
|
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/jsi/*.cpp)
|
|
13
|
+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
|
|
13
14
|
|
|
14
15
|
LOCAL_C_INCLUDES := $(LOCAL_PATH)
|
|
15
16
|
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
|
|
@@ -25,6 +26,7 @@ include $(CLEAR_VARS)
|
|
|
25
26
|
LOCAL_MODULE := jscruntime
|
|
26
27
|
|
|
27
28
|
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
|
|
29
|
+
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
|
|
28
30
|
|
|
29
31
|
LOCAL_C_INCLUDES := $(LOCAL_PATH)
|
|
30
32
|
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
|