react-native-tvos 0.82.0-0rc4 → 0.82.1-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/Animated/nodes/AnimatedValue.js +0 -8
- package/Libraries/Components/Pressable/Pressable.d.ts +1 -1
- package/Libraries/Components/Pressable/Pressable.js +14 -12
- package/Libraries/Components/TV/TVFocusGuideView.js +5 -3
- package/Libraries/Components/TV/TVParallaxProperties.d.ts +42 -0
- package/Libraries/Components/TV/TVViewPropTypes.js +45 -8
- package/Libraries/Components/Touchable/TouchableHighlight.js +5 -29
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +5 -49
- package/Libraries/Components/Touchable/TouchableOpacity.js +5 -55
- package/Libraries/Components/View/View.js +12 -0
- package/Libraries/Components/View/ViewPropTypes.d.ts +59 -37
- package/Libraries/Components/View/ViewPropTypes.js +5 -86
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Interaction/PanResponder.js +6 -51
- package/React/Base/RCTBridge.mm +16 -0
- package/React/Base/RCTVersion.m +2 -2
- package/React/Fabric/Mounting/RCTComponentViewProtocol.h +6 -0
- package/React/Fabric/Mounting/RCTComponentViewRegistry.mm +1 -0
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +2 -0
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +5 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactAndroidHWInputDeviceHelper.kt +0 -20
- package/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +0 -33
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/ReactAndroidHWInputDeviceHelper.java +0 -20
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt +0 -9
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt +13 -26
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.kt +11 -13
- package/ReactAndroid/src/main/jni/react/jni/TransformHelper.cpp +3 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +3 -3
- package/ReactCommon/react/renderer/components/view/BaseViewProps.cpp +0 -3
- package/ReactCommon/react/renderer/components/view/tests/ResolveTransformTest.cpp +377 -0
- package/index.js +6 -0
- package/package.json +8 -8
- package/sdks/hermes-engine/version.properties +1 -1
- package/sdks/hermesc/osx-bin/hermes +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/third-party-podspecs/ReactNativeDependencies.podspec +1 -1
- package/types/public/ReactNativeTVTypes.d.ts +1 -43
|
@@ -283,20 +283,6 @@ export type ViewPropsAndroid = $ReadOnly<{
|
|
|
283
283
|
*/
|
|
284
284
|
renderToHardwareTextureAndroid?: ?boolean,
|
|
285
285
|
|
|
286
|
-
/**
|
|
287
|
-
* TV next focus forward (see documentation for the View component).
|
|
288
|
-
*
|
|
289
|
-
* @platform android
|
|
290
|
-
*/
|
|
291
|
-
nextFocusForward?: ?number,
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Whether this `View` should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard.
|
|
295
|
-
*
|
|
296
|
-
* @platform android
|
|
297
|
-
*/
|
|
298
|
-
focusable?: ?boolean,
|
|
299
|
-
|
|
300
286
|
/**
|
|
301
287
|
* Indicates whether this `View` should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard.
|
|
302
288
|
* See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
|
|
@@ -318,51 +304,6 @@ export type ViewPropsAndroid = $ReadOnly<{
|
|
|
318
304
|
onClick?: ?(event: GestureResponderEvent) => mixed,
|
|
319
305
|
}>;
|
|
320
306
|
|
|
321
|
-
export type TVViewPropsIOS = $ReadOnly<{
|
|
322
|
-
/**
|
|
323
|
-
* *(Apple TV only)* When set to true, this view will be focusable
|
|
324
|
-
* and navigable using the Apple TV remote.
|
|
325
|
-
*
|
|
326
|
-
* @platform ios
|
|
327
|
-
*/
|
|
328
|
-
isTVSelectable?: boolean,
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* *(Apple TV and Android TV)* May be set to true to force the Apple TV focus engine to move focus to this view.
|
|
332
|
-
*
|
|
333
|
-
* @platform ios
|
|
334
|
-
*/
|
|
335
|
-
hasTVPreferredFocus?: boolean,
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 2.0.
|
|
339
|
-
*
|
|
340
|
-
* @platform ios
|
|
341
|
-
*/
|
|
342
|
-
tvParallaxShiftDistanceX?: number,
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 2.0.
|
|
346
|
-
*
|
|
347
|
-
* @platform ios
|
|
348
|
-
*/
|
|
349
|
-
tvParallaxShiftDistanceY?: number,
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 0.05.
|
|
353
|
-
*
|
|
354
|
-
* @platform ios
|
|
355
|
-
*/
|
|
356
|
-
tvParallaxTiltAngle?: number,
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 1.0.
|
|
360
|
-
*
|
|
361
|
-
* @platform ios
|
|
362
|
-
*/
|
|
363
|
-
tvParallaxMagnification?: number,
|
|
364
|
-
}>;
|
|
365
|
-
|
|
366
307
|
export type ViewPropsIOS = $ReadOnly<{
|
|
367
308
|
/**
|
|
368
309
|
* Whether this `View` should be rendered as a bitmap before compositing.
|
|
@@ -374,32 +315,6 @@ export type ViewPropsIOS = $ReadOnly<{
|
|
|
374
315
|
shouldRasterizeIOS?: ?boolean,
|
|
375
316
|
}>;
|
|
376
317
|
|
|
377
|
-
type NextFocusProps = $ReadOnly<{
|
|
378
|
-
/**
|
|
379
|
-
* TV next focus down (see documentation for the View component).
|
|
380
|
-
*
|
|
381
|
-
*/
|
|
382
|
-
nextFocusDown?: ?number,
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* TV next focus left (see documentation for the View component).
|
|
386
|
-
*
|
|
387
|
-
*/
|
|
388
|
-
nextFocusLeft?: ?number,
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
* TV next focus right (see documentation for the View component).
|
|
392
|
-
*
|
|
393
|
-
*/
|
|
394
|
-
nextFocusRight?: ?number,
|
|
395
|
-
|
|
396
|
-
/**
|
|
397
|
-
* TV next focus up (see documentation for the View component).
|
|
398
|
-
*
|
|
399
|
-
*/
|
|
400
|
-
nextFocusUp?: ?number,
|
|
401
|
-
}>;
|
|
402
|
-
|
|
403
318
|
type ViewBaseProps = $ReadOnly<{
|
|
404
319
|
children?: React.Node,
|
|
405
320
|
style?: ?ViewStyleProp,
|
|
@@ -496,6 +411,11 @@ type ViewBaseProps = $ReadOnly<{
|
|
|
496
411
|
experimental_accessibilityOrder?: ?Array<string>,
|
|
497
412
|
}>;
|
|
498
413
|
|
|
414
|
+
// For compatibility with legacy types
|
|
415
|
+
export type TVViewPropsIOS = $ReadOnly<{|
|
|
416
|
+
...TVViewProps,
|
|
417
|
+
|}>;
|
|
418
|
+
|
|
499
419
|
export type ViewProps = $ReadOnly<{
|
|
500
420
|
...DirectEventProps,
|
|
501
421
|
...GestureResponderHandlers,
|
|
@@ -508,6 +428,5 @@ export type ViewProps = $ReadOnly<{
|
|
|
508
428
|
...AccessibilityProps,
|
|
509
429
|
...ViewBaseProps,
|
|
510
430
|
...TVViewProps,
|
|
511
|
-
...NextFocusProps,
|
|
512
431
|
...PressEventProps,
|
|
513
432
|
}>;
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
export default class ReactNativeVersion {
|
|
29
29
|
static major: number = 0;
|
|
30
30
|
static minor: number = 82;
|
|
31
|
-
static patch: number =
|
|
32
|
-
static prerelease: string | null = '
|
|
31
|
+
static patch: number = 1;
|
|
32
|
+
static prerelease: string | null = '0';
|
|
33
33
|
|
|
34
34
|
static getVersionString(): string {
|
|
35
35
|
return `${this.major}.${this.minor}.${this.patch}${this.prerelease != null ? `-${this.prerelease}` : ''}`;
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
import type {GestureResponderEvent} from '../Types/CoreEventTypes';
|
|
14
14
|
|
|
15
|
-
const InteractionManager = require('./InteractionManager').default;
|
|
16
15
|
const TouchHistoryMath = require('./TouchHistoryMath').default;
|
|
17
16
|
|
|
18
17
|
const currentCentroidXOfTouchesChangedAfter =
|
|
@@ -31,9 +30,6 @@ const currentCentroidY = TouchHistoryMath.currentCentroidY;
|
|
|
31
30
|
* single-touch gestures resilient to extra touches, and can be used to
|
|
32
31
|
* recognize simple multi-touch gestures.
|
|
33
32
|
*
|
|
34
|
-
* By default, `PanResponder` holds an `InteractionManager` handle to block
|
|
35
|
-
* long-running JS events from interrupting active gestures.
|
|
36
|
-
*
|
|
37
33
|
* It provides a predictable wrapper of the responder handlers provided by the
|
|
38
34
|
* [gesture responder system](docs/gesture-responder-system.html).
|
|
39
35
|
* For each handler, it provides a new `gestureState` object alongside the
|
|
@@ -405,9 +401,6 @@ const PanResponder = {
|
|
|
405
401
|
getInteractionHandle: () => ?number,
|
|
406
402
|
panHandlers: GestureResponderHandlerMethods,
|
|
407
403
|
} {
|
|
408
|
-
const interactionState = {
|
|
409
|
-
handle: (null: ?number),
|
|
410
|
-
};
|
|
411
404
|
const gestureState: PanResponderGestureState = {
|
|
412
405
|
// Useful for debugging
|
|
413
406
|
stateID: Math.random(),
|
|
@@ -464,10 +457,6 @@ const PanResponder = {
|
|
|
464
457
|
},
|
|
465
458
|
|
|
466
459
|
onResponderGrant(event: GestureResponderEvent): boolean {
|
|
467
|
-
if (!interactionState.handle) {
|
|
468
|
-
interactionState.handle =
|
|
469
|
-
InteractionManager.createInteractionHandle();
|
|
470
|
-
}
|
|
471
460
|
gestureState.x0 = currentCentroidX(event.touchHistory);
|
|
472
461
|
gestureState.y0 = currentCentroidY(event.touchHistory);
|
|
473
462
|
gestureState.dx = 0;
|
|
@@ -482,21 +471,11 @@ const PanResponder = {
|
|
|
482
471
|
},
|
|
483
472
|
|
|
484
473
|
onResponderReject(event: GestureResponderEvent): void {
|
|
485
|
-
|
|
486
|
-
interactionState,
|
|
487
|
-
config.onPanResponderReject,
|
|
488
|
-
event,
|
|
489
|
-
gestureState,
|
|
490
|
-
);
|
|
474
|
+
config.onPanResponderReject?.call(undefined, event, gestureState);
|
|
491
475
|
},
|
|
492
476
|
|
|
493
477
|
onResponderRelease(event: GestureResponderEvent): void {
|
|
494
|
-
|
|
495
|
-
interactionState,
|
|
496
|
-
config.onPanResponderRelease,
|
|
497
|
-
event,
|
|
498
|
-
gestureState,
|
|
499
|
-
);
|
|
478
|
+
config.onPanResponderRelease?.call(undefined, event, gestureState);
|
|
500
479
|
PanResponder._initializeGestureState(gestureState);
|
|
501
480
|
},
|
|
502
481
|
|
|
@@ -529,21 +508,11 @@ const PanResponder = {
|
|
|
529
508
|
onResponderEnd(event: GestureResponderEvent): void {
|
|
530
509
|
const touchHistory = event.touchHistory;
|
|
531
510
|
gestureState.numberActiveTouches = touchHistory.numberActiveTouches;
|
|
532
|
-
|
|
533
|
-
interactionState,
|
|
534
|
-
config.onPanResponderEnd,
|
|
535
|
-
event,
|
|
536
|
-
gestureState,
|
|
537
|
-
);
|
|
511
|
+
config.onPanResponderEnd?.call(undefined, event, gestureState);
|
|
538
512
|
},
|
|
539
513
|
|
|
540
514
|
onResponderTerminate(event: GestureResponderEvent): void {
|
|
541
|
-
|
|
542
|
-
interactionState,
|
|
543
|
-
config.onPanResponderTerminate,
|
|
544
|
-
event,
|
|
545
|
-
gestureState,
|
|
546
|
-
);
|
|
515
|
+
config.onPanResponderTerminate?.call(undefined, event, gestureState);
|
|
547
516
|
PanResponder._initializeGestureState(gestureState);
|
|
548
517
|
},
|
|
549
518
|
|
|
@@ -556,27 +525,13 @@ const PanResponder = {
|
|
|
556
525
|
return {
|
|
557
526
|
panHandlers,
|
|
558
527
|
getInteractionHandle(): ?number {
|
|
559
|
-
|
|
528
|
+
// TODO: Deprecate and delete this method.
|
|
529
|
+
return null;
|
|
560
530
|
},
|
|
561
531
|
};
|
|
562
532
|
},
|
|
563
533
|
};
|
|
564
534
|
|
|
565
|
-
function clearInteractionHandle(
|
|
566
|
-
interactionState: {handle: ?number, ...},
|
|
567
|
-
callback: ?(ActiveCallback | PassiveCallback),
|
|
568
|
-
event: GestureResponderEvent,
|
|
569
|
-
gestureState: PanResponderGestureState,
|
|
570
|
-
) {
|
|
571
|
-
if (interactionState.handle) {
|
|
572
|
-
InteractionManager.clearInteractionHandle(interactionState.handle);
|
|
573
|
-
interactionState.handle = null;
|
|
574
|
-
}
|
|
575
|
-
if (callback) {
|
|
576
|
-
callback(event, gestureState);
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
|
|
580
535
|
export type PanResponderInstance = ReturnType<(typeof PanResponder)['create']>;
|
|
581
536
|
|
|
582
537
|
export default PanResponder;
|
package/React/Base/RCTBridge.mm
CHANGED
|
@@ -380,6 +380,11 @@ static RCTBridge *RCTCurrentBridgeInstance = nil;
|
|
|
380
380
|
moduleProvider:(RCTBridgeModuleListProvider)block
|
|
381
381
|
launchOptions:(NSDictionary *)launchOptions
|
|
382
382
|
{
|
|
383
|
+
// Only enabld this assertion in OSS
|
|
384
|
+
#if COCOAPODS
|
|
385
|
+
[RCTBridge throwIfOnLegacyArch];
|
|
386
|
+
#endif
|
|
387
|
+
|
|
383
388
|
if (self = [super init]) {
|
|
384
389
|
RCTEnforceNewArchitectureValidation(RCTNotAllowedInBridgeless, self, nil);
|
|
385
390
|
_delegate = delegate;
|
|
@@ -393,6 +398,17 @@ static RCTBridge *RCTCurrentBridgeInstance = nil;
|
|
|
393
398
|
return self;
|
|
394
399
|
}
|
|
395
400
|
|
|
401
|
+
// Wrap the exception throwing in a static method to avoid the warning: "The code following the exception will never be
|
|
402
|
+
// executed". This might create build failures internally where we treat warnings as errors.
|
|
403
|
+
+ (void)throwIfOnLegacyArch
|
|
404
|
+
{
|
|
405
|
+
@throw [NSException
|
|
406
|
+
exceptionWithName:NSInternalInconsistencyException
|
|
407
|
+
reason:
|
|
408
|
+
@"You are trying to initialize the legacy architecture. This is not supported anymore and will be removed in the next version of React Native. Please use the New Architecture instead."
|
|
409
|
+
userInfo:nil];
|
|
410
|
+
}
|
|
411
|
+
|
|
396
412
|
RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
|
397
413
|
|
|
398
414
|
- (void)dealloc
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -23,8 +23,8 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
|
|
23
23
|
__rnVersion = @{
|
|
24
24
|
RCTVersionMajor: @(0),
|
|
25
25
|
RCTVersionMinor: @(82),
|
|
26
|
-
RCTVersionPatch: @(
|
|
27
|
-
RCTVersionPrerelease: @"
|
|
26
|
+
RCTVersionPatch: @(1),
|
|
27
|
+
RCTVersionPrerelease: @"0",
|
|
28
28
|
};
|
|
29
29
|
});
|
|
30
30
|
return __rnVersion;
|
|
@@ -111,6 +111,12 @@ typedef NS_OPTIONS(NSInteger, RNComponentViewUpdateMask) {
|
|
|
111
111
|
*/
|
|
112
112
|
- (void)prepareForRecycle;
|
|
113
113
|
|
|
114
|
+
/*
|
|
115
|
+
* Called for unmounted components that won't be moved to a recycle pool.
|
|
116
|
+
* Useful for releasing any associated resources.
|
|
117
|
+
*/
|
|
118
|
+
- (void)invalidate;
|
|
119
|
+
|
|
114
120
|
/*
|
|
115
121
|
* Read the last props used to update the view.
|
|
116
122
|
*/
|
|
@@ -108,6 +108,7 @@ const NSInteger RCTComponentViewRegistryRecyclePoolMaxSize = 1024;
|
|
|
108
108
|
auto &recycledViews = _recyclePool[componentHandle];
|
|
109
109
|
|
|
110
110
|
if (recycledViews.size() > RCTComponentViewRegistryRecyclePoolMaxSize || !componentViewDescriptor.shouldBeRecycled) {
|
|
111
|
+
[componentViewDescriptor.view invalidate];
|
|
111
112
|
return;
|
|
112
113
|
}
|
|
113
114
|
|
|
@@ -129,6 +129,11 @@ using namespace facebook::react;
|
|
|
129
129
|
// Default implementation does nothing.
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
- (void)invalidate
|
|
133
|
+
{
|
|
134
|
+
// Default implementation does nothing.
|
|
135
|
+
}
|
|
136
|
+
|
|
132
137
|
- (facebook::react::Props::Shared)props
|
|
133
138
|
{
|
|
134
139
|
RCTAssert(NO, @"props access should be implemented by RCTViewComponentView.");
|
|
@@ -33,26 +33,6 @@ internal class ReactAndroidHWInputDeviceHelper {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
/** Called from [ReactRootView] when focused view changes. */
|
|
37
|
-
fun onFocusChanged(newFocusedView: View, context: ReactContext) {
|
|
38
|
-
if (lastFocusedViewId == newFocusedView.id) {
|
|
39
|
-
return
|
|
40
|
-
}
|
|
41
|
-
if (lastFocusedViewId != View.NO_ID) {
|
|
42
|
-
dispatchEvent(context, "blur", lastFocusedViewId)
|
|
43
|
-
}
|
|
44
|
-
lastFocusedViewId = newFocusedView.id
|
|
45
|
-
dispatchEvent(context, "focus", newFocusedView.id)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/** Called from [ReactRootView] when the whole view hierarchy looses focus. */
|
|
49
|
-
fun clearFocus(context: ReactContext) {
|
|
50
|
-
if (lastFocusedViewId != View.NO_ID) {
|
|
51
|
-
dispatchEvent(context, "blur", lastFocusedViewId)
|
|
52
|
-
}
|
|
53
|
-
lastFocusedViewId = View.NO_ID
|
|
54
|
-
}
|
|
55
|
-
|
|
56
36
|
private fun dispatchEvent(
|
|
57
37
|
context: ReactContext,
|
|
58
38
|
eventType: String?,
|
|
@@ -341,39 +341,6 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
|
|
|
341
341
|
return super.dispatchKeyEvent(ev);
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
-
@Override
|
|
345
|
-
protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) {
|
|
346
|
-
if (!hasActiveReactContext() || !isViewAttachedToReactInstance()) {
|
|
347
|
-
FLog.w(
|
|
348
|
-
TAG,
|
|
349
|
-
"Unable to handle focus changed event as the catalyst instance has not been attached");
|
|
350
|
-
super.onFocusChanged(gainFocus, direction, previouslyFocusedRect);
|
|
351
|
-
return;
|
|
352
|
-
}
|
|
353
|
-
ReactContext context = getCurrentReactContext();
|
|
354
|
-
if (context != null) {
|
|
355
|
-
mAndroidHWInputDeviceHelper.clearFocus(context);
|
|
356
|
-
}
|
|
357
|
-
super.onFocusChanged(gainFocus, direction, previouslyFocusedRect);
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
@Override
|
|
361
|
-
public void requestChildFocus(View child, View focused) {
|
|
362
|
-
if (!hasActiveReactContext() || !isViewAttachedToReactInstance()) {
|
|
363
|
-
FLog.w(
|
|
364
|
-
TAG,
|
|
365
|
-
"Unable to handle child focus changed event as the catalyst instance has not been"
|
|
366
|
-
+ " attached");
|
|
367
|
-
super.requestChildFocus(child, focused);
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
ReactContext context = getCurrentReactContext();
|
|
371
|
-
if (context != null) {
|
|
372
|
-
mAndroidHWInputDeviceHelper.onFocusChanged(focused, context);
|
|
373
|
-
}
|
|
374
|
-
super.requestChildFocus(child, focused);
|
|
375
|
-
}
|
|
376
|
-
|
|
377
344
|
protected void dispatchJSPointerEvent(MotionEvent event, boolean isCapture) {
|
|
378
345
|
if (!hasActiveReactContext() || !isViewAttachedToReactInstance()) {
|
|
379
346
|
FLog.w(TAG, "Unable to dispatch touch to JS as the catalyst instance has not been attached");
|
|
@@ -192,26 +192,6 @@ public class ReactAndroidHWInputDeviceHelper {
|
|
|
192
192
|
);
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
/** Called from {@link com.facebook.react.ReactRootView} when focused view changes. */
|
|
196
|
-
public void onFocusChanged(View newFocusedView, ReactContext context) {
|
|
197
|
-
if (mLastFocusedViewId == newFocusedView.getId()) {
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
if (mLastFocusedViewId != View.NO_ID) {
|
|
201
|
-
dispatchEvent("blur", mLastFocusedViewId, context);
|
|
202
|
-
}
|
|
203
|
-
mLastFocusedViewId = newFocusedView.getId();
|
|
204
|
-
dispatchEvent("focus", newFocusedView.getId(), context);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/** Called from {@link com.facebook.react.ReactRootView} when the whole view hierarchy looses focus. */
|
|
208
|
-
public void clearFocus(ReactContext context) {
|
|
209
|
-
if (mLastFocusedViewId != View.NO_ID) {
|
|
210
|
-
dispatchEvent("blur", mLastFocusedViewId, context);
|
|
211
|
-
}
|
|
212
|
-
mLastFocusedViewId = View.NO_ID;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
195
|
private void dispatchEvent(String eventType, int targetViewId, ReactContext context) {
|
|
216
196
|
dispatchEvent(eventType, targetViewId, -1, context);
|
|
217
197
|
}
|
|
@@ -560,15 +560,6 @@ public class ReactModalHostView(context: ThemedReactContext) :
|
|
|
560
560
|
updateState(viewWidth, viewHeight)
|
|
561
561
|
}
|
|
562
562
|
|
|
563
|
-
protected override fun onFocusChanged(
|
|
564
|
-
gainFocus: Boolean,
|
|
565
|
-
direction: Int,
|
|
566
|
-
previouslyFocusedRect: Rect?
|
|
567
|
-
) {
|
|
568
|
-
androidHWInputDeviceHelper.clearFocus(reactContext)
|
|
569
|
-
super.onFocusChanged(gainFocus, direction, previouslyFocusedRect)
|
|
570
|
-
}
|
|
571
|
-
|
|
572
563
|
/*
|
|
573
564
|
public override fun requestChildFocus(child: View?, focused: View?) {
|
|
574
565
|
androidHWInputDeviceHelper.onFocusChanged(focused, reactContext)
|
|
@@ -425,7 +425,7 @@ public open class ReactEditText public constructor(context: Context) : AppCompat
|
|
|
425
425
|
// that. This method will eventually replace requestFocusInternal()
|
|
426
426
|
private fun requestFocusProgrammatically(): Boolean {
|
|
427
427
|
val focused = super.requestFocus(FOCUS_DOWN, null)
|
|
428
|
-
if (
|
|
428
|
+
if (showSoftInputOnFocus) {
|
|
429
429
|
showSoftKeyboard()
|
|
430
430
|
} else {
|
|
431
431
|
if (isKeyboardOpened) {
|
|
@@ -70,9 +70,7 @@ import com.facebook.react.uimanager.UIManagerHelper
|
|
|
70
70
|
import com.facebook.react.uimanager.ViewGroupDrawingOrderHelper
|
|
71
71
|
import com.facebook.react.uimanager.common.UIManagerType
|
|
72
72
|
import com.facebook.react.uimanager.common.ViewUtil.getUIManagerType
|
|
73
|
-
import com.facebook.react.uimanager.events.BlurEvent
|
|
74
73
|
import com.facebook.react.uimanager.events.EventDispatcher
|
|
75
|
-
import com.facebook.react.uimanager.events.FocusEvent
|
|
76
74
|
import com.facebook.react.uimanager.events.PressInEvent
|
|
77
75
|
import com.facebook.react.uimanager.events.PressOutEvent
|
|
78
76
|
import com.facebook.react.uimanager.style.BorderRadiusProp
|
|
@@ -747,6 +745,18 @@ public open class ReactViewGroup public constructor(context: Context?) :
|
|
|
747
745
|
}
|
|
748
746
|
super.onViewAdded(child)
|
|
749
747
|
}
|
|
748
|
+
|
|
749
|
+
override fun removeView(view: View?) {
|
|
750
|
+
if (view != null) {
|
|
751
|
+
recoverFocus(view);
|
|
752
|
+
}
|
|
753
|
+
super.removeView(view);
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
override fun removeViewAt(index: Int) {
|
|
757
|
+
recoverFocus(getChildAt(index));
|
|
758
|
+
super.removeViewAt(index);
|
|
759
|
+
}
|
|
750
760
|
|
|
751
761
|
override fun onViewRemoved(child: View) {
|
|
752
762
|
assertOnUiThread()
|
|
@@ -869,7 +879,7 @@ public open class ReactViewGroup public constructor(context: Context?) :
|
|
|
869
879
|
|
|
870
880
|
internal fun removeViewWithSubviewClippingEnabled(view: View) {
|
|
871
881
|
assertOnUiThread()
|
|
872
|
-
|
|
882
|
+
recoverFocus(view)
|
|
873
883
|
check(_removeClippedSubviews)
|
|
874
884
|
val allChildren = checkNotNull(allChildren)
|
|
875
885
|
view.removeOnLayoutChangeListener(childrenLayoutChangeListener)
|
|
@@ -1361,29 +1371,6 @@ public open class ReactViewGroup public constructor(context: Context?) :
|
|
|
1361
1371
|
|
|
1362
1372
|
override fun onFocusChanged(gainFocus: Boolean, direction: Int, previouslyFocusedRect: Rect?) {
|
|
1363
1373
|
super.onFocusChanged(gainFocus, direction, previouslyFocusedRect)
|
|
1364
|
-
|
|
1365
|
-
val mEventDispatcher: EventDispatcher? =
|
|
1366
|
-
UIManagerHelper.getEventDispatcherForReactTag(
|
|
1367
|
-
this.context as ReactContext, this.id
|
|
1368
|
-
)
|
|
1369
|
-
|
|
1370
|
-
if (mEventDispatcher == null) {
|
|
1371
|
-
return
|
|
1372
|
-
}
|
|
1373
|
-
|
|
1374
|
-
if (gainFocus) {
|
|
1375
|
-
mEventDispatcher.dispatchEvent(
|
|
1376
|
-
FocusEvent(
|
|
1377
|
-
UIManagerHelper.getSurfaceId(this.context), this.id
|
|
1378
|
-
)
|
|
1379
|
-
)
|
|
1380
|
-
} else {
|
|
1381
|
-
mEventDispatcher.dispatchEvent(
|
|
1382
|
-
BlurEvent(
|
|
1383
|
-
UIManagerHelper.getSurfaceId(this.context), this.id
|
|
1384
|
-
)
|
|
1385
|
-
)
|
|
1386
|
-
}
|
|
1387
1374
|
}
|
|
1388
1375
|
|
|
1389
1376
|
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
|
|
@@ -98,16 +98,7 @@ public open class ReactViewManager : ReactClippingViewManager<ReactViewGroup>()
|
|
|
98
98
|
|
|
99
99
|
@ReactProp(name = "accessible")
|
|
100
100
|
public open fun setAccessible(view: ReactViewGroup, accessible: Boolean) {
|
|
101
|
-
|
|
102
|
-
// This is required to handle Android TV/ Fire TV Devices that are Touch Enabled as well as LeanBack
|
|
103
|
-
// https://developer.android.com/reference/android/view/View#requestFocus(int,%20android.graphics.Rect)
|
|
104
|
-
// ** A view will not actually take focus if it is not focusable (isFocusable() returns false), **
|
|
105
|
-
// ** or if it is focusable and it is not focusable in touch mode (isFocusableInTouchMode()) **
|
|
106
|
-
// ** while the device is in touch mode. **
|
|
107
|
-
if (hasTouchScreen(view.context)) {
|
|
108
|
-
view.isFocusableInTouchMode = accessible
|
|
109
|
-
}
|
|
110
|
-
|
|
101
|
+
// TODO: determine if any AxOrder changes should be put here
|
|
111
102
|
}
|
|
112
103
|
|
|
113
104
|
@ReactProp(name = "tvFocusable")
|
|
@@ -117,7 +108,7 @@ public open class ReactViewManager : ReactClippingViewManager<ReactViewGroup>()
|
|
|
117
108
|
view.isFocusable = false
|
|
118
109
|
view.descendantFocusability = ViewGroup.FOCUS_BLOCK_DESCENDANTS
|
|
119
110
|
} else {
|
|
120
|
-
view.descendantFocusability = ViewGroup.
|
|
111
|
+
view.descendantFocusability = ViewGroup.FOCUS_AFTER_DESCENDANTS
|
|
121
112
|
}
|
|
122
113
|
}
|
|
123
114
|
|
|
@@ -416,8 +407,15 @@ public open class ReactViewManager : ReactClippingViewManager<ReactViewGroup>()
|
|
|
416
407
|
} else {
|
|
417
408
|
view.setOnClickListener(null)
|
|
418
409
|
view.isClickable = false
|
|
419
|
-
|
|
420
|
-
|
|
410
|
+
view.isFocusable = false
|
|
411
|
+
}
|
|
412
|
+
// This is required to handle Android TV/ Fire TV Devices that are Touch Enabled as well as LeanBack
|
|
413
|
+
// https://developer.android.com/reference/android/view/View#requestFocus(int,%20android.graphics.Rect)
|
|
414
|
+
// ** A view will not actually take focus if it is not focusable (isFocusable() returns false), **
|
|
415
|
+
// ** or if it is focusable and it is not focusable in touch mode (isFocusableInTouchMode()) **
|
|
416
|
+
// ** while the device is in touch mode. **
|
|
417
|
+
if (hasTouchScreen(view.context)) {
|
|
418
|
+
view.isFocusableInTouchMode = focusable
|
|
421
419
|
}
|
|
422
420
|
}
|
|
423
421
|
|
|
@@ -39,7 +39,9 @@ void processTransform(
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
auto result = BaseViewProps::resolveTransform(
|
|
42
|
-
Size
|
|
42
|
+
Size{.width = viewWidth, .height = viewHeight},
|
|
43
|
+
transform,
|
|
44
|
+
transformOrigin);
|
|
43
45
|
|
|
44
46
|
// Convert from matrix of floats to double matrix
|
|
45
47
|
constexpr size_t MatrixSize = std::tuple_size_v<decltype(result.matrix)>;
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
|
|
15
15
|
#define REACT_NATIVE_VERSION_MAJOR 0
|
|
16
16
|
#define REACT_NATIVE_VERSION_MINOR 82
|
|
17
|
-
#define REACT_NATIVE_VERSION_PATCH
|
|
17
|
+
#define REACT_NATIVE_VERSION_PATCH 1
|
|
18
18
|
|
|
19
19
|
namespace facebook::react {
|
|
20
20
|
|
|
21
21
|
constexpr struct {
|
|
22
22
|
int32_t Major = 0;
|
|
23
23
|
int32_t Minor = 82;
|
|
24
|
-
int32_t Patch =
|
|
25
|
-
std::string_view Prerelease = "
|
|
24
|
+
int32_t Patch = 1;
|
|
25
|
+
std::string_view Prerelease = "0";
|
|
26
26
|
} ReactNativeVersion;
|
|
27
27
|
|
|
28
28
|
} // namespace facebook::react
|
|
@@ -646,9 +646,6 @@ Transform BaseViewProps::resolveTransform(
|
|
|
646
646
|
const Transform& transform,
|
|
647
647
|
const TransformOrigin& transformOrigin) {
|
|
648
648
|
auto transformMatrix = Transform{};
|
|
649
|
-
if (frameSize.width == 0 && frameSize.height == 0) {
|
|
650
|
-
return transformMatrix;
|
|
651
|
-
}
|
|
652
649
|
|
|
653
650
|
// transform is matrix
|
|
654
651
|
if (transform.operations.size() == 1 &&
|