@depup/react-native 0.86.2-depup.0 → 0.87.0-depup.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/ActionSheetIOS/ActionSheetIOS.js +19 -24
- package/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec +1 -1
- package/Libraries/Alert/Alert.js +38 -1
- package/Libraries/Animated/AnimatedExports.js +22 -0
- package/Libraries/Animated/AnimatedExports.js.flow +1 -1
- package/Libraries/Animated/AnimatedImplementation.js +120 -3
- package/Libraries/Animated/Easing.js +4 -3
- package/Libraries/Animated/NativeAnimatedAllowlist.js +37 -0
- package/Libraries/Animated/animations/Animation.js +14 -5
- package/Libraries/Animated/animations/DecayAnimation.js +1 -0
- package/Libraries/Animated/animations/SpringAnimation.js +1 -0
- package/Libraries/Animated/animations/TimingAnimation.js +9 -0
- package/Libraries/Animated/components/AnimatedScrollView.js +1 -1
- package/Libraries/Animated/createAnimatedComponent.js +3 -3
- package/Libraries/Animated/nodes/AnimatedColor.js +8 -8
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +106 -0
- package/Libraries/Animated/nodes/AnimatedProps.js +27 -3
- package/Libraries/Animated/nodes/AnimatedValue.js +8 -0
- package/Libraries/Animated/nodes/AnimatedValueXY.js +2 -2
- package/Libraries/AppDelegate/RCTAppDelegate.h +5 -9
- package/Libraries/AppDelegate/RCTAppDelegate.mm +0 -20
- package/Libraries/AppDelegate/RCTAppSetupUtils.h +0 -18
- package/Libraries/AppDelegate/RCTAppSetupUtils.mm +0 -78
- package/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm +18 -21
- package/Libraries/AppDelegate/RCTReactNativeFactory.h +5 -41
- package/Libraries/AppDelegate/RCTReactNativeFactory.mm +0 -82
- package/Libraries/AppDelegate/RCTRootViewFactory.h +4 -1
- package/Libraries/AppDelegate/RCTRootViewFactory.mm +3 -101
- package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +2 -1
- package/Libraries/AppState/AppState.d.ts +4 -1
- package/Libraries/AppState/AppState.js +32 -17
- package/Libraries/BatchedBridge/MessageQueue.js +42 -51
- package/Libraries/BatchedBridge/NativeModules.js +7 -0
- package/Libraries/Blob/Blob.js +7 -1
- package/Libraries/Blob/FileReader.js +6 -0
- package/Libraries/Blob/React-RCTBlob.podspec +1 -1
- package/Libraries/Blob/URLSearchParams.js.flow +1 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +20 -9
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +30 -43
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +59 -49
- package/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js +2 -2
- package/Libraries/Components/Button.js +98 -183
- package/Libraries/Components/Clipboard/Clipboard.js +5 -0
- package/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js +2 -2
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +8 -69
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +10 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js +2 -0
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.js +26 -31
- package/Libraries/Components/Keyboard/Keyboard.js +23 -60
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +15 -7
- package/Libraries/Components/Pressable/Pressable.js +39 -17
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +5 -6
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +4 -4
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js +2 -2
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +17 -0
- package/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js +2 -2
- package/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js +2 -2
- package/Libraries/Components/RefreshControl/RefreshControl.js +40 -50
- package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +2 -2
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +8 -8
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js +2 -2
- package/Libraries/Components/ScrollView/ScrollView.d.ts +55 -43
- package/Libraries/Components/ScrollView/ScrollView.js +205 -118
- package/Libraries/Components/ScrollView/ScrollViewCommands.js +4 -4
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
- package/Libraries/Components/StatusBar/StatusBar.d.ts +7 -54
- package/Libraries/Components/StatusBar/StatusBar.js +84 -160
- package/Libraries/Components/Switch/AndroidSwitchNativeComponent.js +2 -2
- package/Libraries/Components/Switch/Switch.js +76 -75
- package/Libraries/Components/Switch/SwitchNativeComponent.js +2 -2
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +1 -1
- package/Libraries/Components/TextInput/InputAccessoryView.js +13 -61
- package/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js +2 -2
- package/Libraries/Components/TextInput/TextInput.d.ts +9 -2
- package/Libraries/Components/TextInput/TextInput.flow.js +20 -3
- package/Libraries/Components/TextInput/TextInput.js +116 -111
- package/Libraries/Components/TextInput/TextInputNativeCommands.js +3 -3
- package/Libraries/Components/ToastAndroid/ToastAndroid.android.js +25 -19
- package/Libraries/Components/Touchable/Touchable.d.ts +1 -1
- package/Libraries/Components/Touchable/Touchable.js +94 -95
- package/Libraries/Components/Touchable/TouchableHighlight.js +45 -112
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +13 -25
- package/Libraries/Components/Touchable/TouchableOpacity.js +14 -84
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +4 -3
- package/Libraries/Components/UnimplementedViews/UnimplementedNativeViewNativeComponent.js +2 -2
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -0
- package/Libraries/Components/View/View.js +83 -86
- package/Libraries/Components/View/ViewAccessibility.d.ts +12 -2
- package/Libraries/Components/View/ViewAccessibility.js +17 -6
- package/Libraries/Components/View/ViewNativeComponent.js +4 -6
- package/Libraries/Components/View/ViewPropTypes.js +65 -13
- package/Libraries/Core/InitializeCore.js +9 -1
- package/Libraries/Core/ReactFiberErrorDialog.js +3 -3
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Core/Timers/JSTimers.js +53 -52
- package/Libraries/Core/setUpGlobals.js +9 -4
- package/Libraries/Core/setUpNavigator.js +7 -2
- package/Libraries/Core/setUpReactDevTools.js +0 -118
- package/Libraries/Core/setUpXHR.js +6 -2
- package/Libraries/Debugging/DebuggingOverlay.js +2 -2
- package/Libraries/Debugging/DebuggingOverlayNativeComponent.js +2 -2
- package/Libraries/EventEmitter/NativeEventEmitter.js +29 -0
- package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +7 -7
- package/Libraries/EventEmitter/RCTNativeAppEventEmitter.d.ts +1 -1
- package/Libraries/EventEmitter/RCTNativeAppEventEmitter.js +3 -0
- package/Libraries/FBLazyVector/FBLazyVector.podspec +1 -1
- package/Libraries/Image/AssetSourceResolver.js +18 -27
- package/Libraries/Image/Image.android.js +13 -2
- package/Libraries/Image/Image.ios.js +3 -1
- package/Libraries/Image/ImageBackground.js +30 -18
- package/Libraries/Image/ImageProps.js +116 -117
- package/Libraries/Image/ImageSource.d.ts +1 -1
- package/Libraries/Image/ImageSource.js +9 -9
- package/Libraries/Image/ImageSourceUtils.js +10 -7
- package/Libraries/Image/ImageTypes.flow.js +2 -0
- package/Libraries/Image/ImageViewNativeComponent.js +1 -1
- package/Libraries/Image/RCTImageLoader.mm +61 -64
- package/Libraries/Image/RCTImageStoreManager.h +0 -2
- package/Libraries/Image/React-RCTImage.podspec +1 -1
- package/Libraries/Image/RelativeImageStub.js +1 -1
- package/Libraries/Image/resolveAssetSource.js +1 -1
- package/Libraries/Interaction/PanResponder.js +102 -97
- package/Libraries/LayoutAnimation/LayoutAnimation.js +22 -6
- package/Libraries/Linking/Linking.js +24 -23
- package/Libraries/LinkingIOS/React-RCTLinking.podspec +1 -1
- package/Libraries/Lists/FlatList.d.ts +6 -17
- package/Libraries/Lists/FlatList.js +7 -8
- package/Libraries/Lists/SectionList.js +7 -0
- package/Libraries/Lists/VirtualizedList.js +3 -0
- package/Libraries/Lists/VirtualizedSectionList.js +4 -0
- package/Libraries/LogBox/LogBox.js +3 -3
- package/Libraries/LogBox/UI/AnsiHighlight.js +2 -1
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +2 -2
- package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +4 -1
- package/Libraries/LogBox/UI/LogBoxInspectorFooterButton.js +3 -1
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +8 -2
- package/Libraries/LogBox/UI/LogBoxInspectorMessageHeader.js +9 -2
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +17 -4
- package/Libraries/LogBox/UI/LogBoxInspectorSection.js +3 -1
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +3 -1
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js +2 -0
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +4 -2
- package/Libraries/LogBox/UI/LogBoxMessage.js +18 -5
- package/Libraries/LogBox/UI/LogBoxNotificationCountBadge.js +4 -1
- package/Libraries/LogBox/UI/LogBoxNotificationMessage.js +1 -0
- package/Libraries/LogBox/UI/LogBoxStyle.js +0 -4
- package/Libraries/Modal/Modal.d.ts +5 -4
- package/Libraries/Modal/Modal.js +71 -37
- package/Libraries/Modal/RCTModalHostViewNativeComponent.js +2 -2
- package/Libraries/NativeAnimation/React-RCTAnimation.podspec +1 -1
- package/Libraries/NativeComponent/BaseViewConfig.android.js +17 -0
- package/Libraries/NativeComponent/ViewConfig.js +3 -3
- package/Libraries/NativeComponent/ViewConfigIgnore.js +1 -1
- package/Libraries/Network/RCTHTTPRequestHandler.h +1 -1
- package/Libraries/Network/React-RCTNetwork.podspec +1 -1
- package/Libraries/Performance/Systrace.js +36 -0
- package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +4 -2
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +29 -17
- package/Libraries/Pressability/Pressability.js +1 -1
- package/Libraries/PushNotificationIOS/PushNotificationIOS.js +4 -0
- package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +1 -1
- package/Libraries/ReactNative/AppContainer-dev.js +3 -1
- package/Libraries/ReactNative/AppRegistry.flow.js +1 -0
- package/Libraries/ReactNative/AppRegistry.js +15 -11
- package/Libraries/ReactNative/AppRegistryImpl.js +57 -11
- package/Libraries/ReactNative/DisplayMode.js +1 -1
- package/Libraries/ReactNative/FabricUIManager.js +29 -26
- package/Libraries/ReactNative/I18nManager.js +20 -0
- package/Libraries/ReactNative/UIManager.js +53 -0
- package/Libraries/ReactNative/renderApplication.js +1 -1
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +5 -126
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js.flow +5 -41
- package/Libraries/Renderer/README.md +2 -2
- package/Libraries/Renderer/shims/ReactNativeTypes.js +36 -36
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +4 -4
- package/Libraries/Required/RCTRequired.podspec +1 -1
- package/Libraries/Settings/React-RCTSettings.podspec +1 -1
- package/Libraries/Settings/Settings.ios.js +22 -0
- package/Libraries/Share/Share.js +25 -28
- package/Libraries/StyleSheet/PlatformColorValueTypes.js.flow +6 -0
- package/Libraries/StyleSheet/StyleSheet.js +42 -2
- package/Libraries/StyleSheet/StyleSheet.js.flow +1 -1
- package/Libraries/StyleSheet/StyleSheetExports.js +7 -5
- package/Libraries/StyleSheet/StyleSheetExports.js.flow +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +24 -3
- package/Libraries/StyleSheet/StyleSheetTypes.js +34 -6
- package/Libraries/StyleSheet/flattenStyle.js +28 -13
- package/Libraries/StyleSheet/private/_TransformStyle.js +16 -14
- package/Libraries/Text/React-RCTText.podspec +1 -1
- package/Libraries/Text/Text.js +12 -9
- package/Libraries/Text/TextEffectNativeComponent.js +31 -0
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.mm +0 -1
- package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +0 -1
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.mm +0 -1
- package/Libraries/Text/TextProps.js +59 -93
- package/Libraries/Text/requireNativeTextEffect.js +28 -0
- package/Libraries/TurboModule/RCTExport.js +1 -1
- package/Libraries/TypeSafety/RCTTypeSafety.podspec +1 -1
- package/Libraries/Types/CoreEventTypes.d.ts +8 -0
- package/Libraries/Types/CoreEventTypes.js +32 -29
- package/Libraries/Types/UIManagerJSInterface.js +2 -2
- package/Libraries/Utilities/Appearance.d.ts +32 -17
- package/Libraries/Utilities/Appearance.js +35 -18
- package/Libraries/Utilities/BackHandler.android.js +13 -28
- package/Libraries/Utilities/BackHandler.js.flow +18 -2
- package/Libraries/Utilities/DevSettings.js +8 -1
- package/Libraries/Utilities/Dimensions.js +18 -12
- package/Libraries/Utilities/PixelRatio.js +5 -2
- package/Libraries/Utilities/Platform.js.flow +4 -0
- package/Libraries/Utilities/PlatformTypes.js +77 -0
- package/Libraries/Utilities/PolyfillFunctions.js +1 -1
- package/Libraries/Utilities/differ/deepDiffer.js +5 -2
- package/Libraries/Utilities/useColorScheme.js +11 -1
- package/Libraries/Utilities/useWindowDimensions.js +6 -0
- package/Libraries/Vibration/React-RCTVibration.podspec +1 -1
- package/Libraries/Vibration/Vibration.js +14 -11
- package/Libraries/vendor/emitter/EventEmitter.js +3 -3
- package/README.md +6 -8
- package/React/Base/RCTBridge+Private.h +0 -22
- package/React/Base/RCTBridge.h +10 -8
- package/React/Base/RCTBridge.mm +5 -447
- package/React/Base/RCTBridgeDelegate.h +1 -56
- package/React/Base/RCTBridgeModule.h +0 -9
- package/React/Base/RCTBridgeProxy.h +8 -0
- package/React/Base/RCTBridgeProxy.mm +3 -20
- package/React/Base/RCTBundleManager.h +0 -3
- package/React/Base/RCTBundleManager.m +0 -31
- package/React/Base/RCTBundleURLProvider.mm +4 -4
- package/React/Base/RCTCallableJSModules.m +0 -18
- package/React/Base/RCTConstants.h +1 -0
- package/React/Base/RCTConstants.m +1 -0
- package/React/Base/RCTConvert.mm +3 -0
- package/React/Base/RCTDisplayLink.h +3 -1
- package/React/Base/RCTJavaScriptExecutor.h +0 -69
- package/React/Base/RCTModuleData.mm +2 -483
- package/React/Base/RCTModuleRegistry.m +0 -25
- package/React/Base/RCTRootView.m +3 -374
- package/React/Base/RCTUtils.h +0 -3
- package/React/Base/RCTUtils.mm +17 -27
- package/React/Base/RCTVersion.m +2 -2
- package/React/Base/RCTViewRegistry.m +1 -29
- package/React/Base/Surface/RCTSurface.mm +1 -582
- package/React/Base/Surface/RCTSurfaceRootShadowView.m +0 -89
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +0 -1
- package/React/CoreModules/PlatformStubs/RCTStatusBarManager.mm +0 -2
- package/React/CoreModules/RCTAlertController.mm +1 -0
- package/React/CoreModules/RCTAlertManager.mm +0 -5
- package/React/CoreModules/RCTLogBox.mm +0 -11
- package/React/CoreModules/RCTLogBoxView.h +0 -3
- package/React/CoreModules/RCTLogBoxView.mm +0 -31
- package/React/CoreModules/RCTPerfMonitor.mm +0 -2
- package/React/CoreModules/RCTStatusBarManager.mm +0 -11
- package/React/CoreModules/React-CoreModules.podspec +1 -1
- package/React/CxxModule/RCTCxxUtils.h +0 -8
- package/React/CxxModule/RCTCxxUtils.mm +0 -17
- package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +179 -7
- package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +100 -2
- package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +373 -119
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ComponentDescriptors.cpp +1 -1
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ComponentDescriptors.h +1 -1
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/EventEmitters.cpp +71 -71
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/EventEmitters.h +96 -96
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/Props.cpp +357 -363
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/Props.h +211 -212
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/RCTComponentViewHelpers.h +107 -107
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ShadowNodes.cpp +1 -1
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ShadowNodes.h +11 -11
- package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/States.h +2 -2
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h +4 -0
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +4 -0
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.h +4 -0
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.mm +5 -0
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +0 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +14 -0
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +13 -4
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTVirtualViewContainerState.mm +12 -26
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +39 -4
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +1 -1
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +5 -5
- package/React/Fabric/Mounting/ComponentViews/VirtualView/RCTVirtualViewComponentView.mm +0 -18
- package/React/Fabric/Mounting/RCTComponentViewFactory.mm +9 -5
- package/React/Fabric/RCTSurfacePresenter.mm +86 -5
- package/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +2 -0
- package/React/I18n/RCTLocalizedString.mm +38 -2
- package/React/Modules/RCTEventEmitter.m +30 -10
- package/React/Modules/RCTI18nUtil.m +3 -1
- package/React/Modules/RCTUIManager.mm +0 -1501
- package/React/React-RCTFBReactNativeSpec.podspec +2 -2
- package/React/React-RCTFabric.podspec +1 -1
- package/React/Runtime/React-RCTRuntime.podspec +1 -1
- package/React/Tests/Text/RCTAttributedTextUtilsTest.mm +27 -0
- package/React/Views/RCTModalHostViewController.h +0 -15
- package/React/Views/RCTModalHostViewManager.h +0 -24
- package/React/Views/RCTShadowView.h +0 -2
- package/React/Views/RCTShadowView.m +0 -723
- package/React/Views/ScrollView/RCTScrollView.h +0 -81
- package/React/Views/ScrollView/RCTScrollableProtocol.h +0 -4
- package/React-Core-prebuilt.podspec +45 -17
- package/React-Core.podspec +10 -3
- package/React.podspec +1 -1
- package/ReactAndroid/api/ReactAndroid.api +128 -142
- package/ReactAndroid/build.gradle.kts +27 -22
- package/ReactAndroid/external-artifacts/build.gradle.kts +49 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/hermes-engine/build.gradle.kts +14 -14
- package/ReactAndroid/publish.gradle +5 -5
- package/ReactAndroid/src/debug/AndroidManifest.xml +6 -0
- package/ReactAndroid/src/debugOptimized/AndroidManifest.xml +22 -0
- package/ReactAndroid/src/main/java/com/facebook/react/BaseReactPackage.kt +3 -7
- package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +4 -2
- package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.kt +4 -6
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +0 -3
- package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.kt +212 -0
- package/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +0 -16
- package/ReactAndroid/src/main/java/com/facebook/react/animated/PropsAnimatedNode.kt +6 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/Arguments.kt +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/BridgeReactContext.kt +287 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ColorPropConverter.kt +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +15 -2
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/interop/InteropModuleRegistry.kt +1 -3
- package/ReactAndroid/src/main/java/com/facebook/react/common/build/ReactBuildConfig.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/MapBuffer.kt +50 -2
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/ReadableMapBuffer.kt +63 -22
- package/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/WritableMapBuffer.kt +33 -0
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultNewArchitectureEntryPoint.kt +4 -12
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactActivityDelegate.kt +14 -10
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactNativeHost.kt +6 -6
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/BundleDownloader.kt +50 -47
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/CxxInspectorPackagerConnection.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.kt +0 -4
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerFactory.kt +10 -10
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/LocalNetworkPermissionUtil.kt +49 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/MultipartStreamReader.kt +101 -26
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +40 -38
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManagerBinding.kt +1 -10
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManagerProviderImpl.kt +0 -3
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/ViewTransitionSnapshotManager.kt +15 -11
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.kt +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.kt +7 -13
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.kt +160 -187
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/SynchronousMountItem.kt +12 -8
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +30 -66
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +51 -111
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +11 -23
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +12 -24
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +57 -123
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Canary_Android.kt +7 -5
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Experimental_Android.kt +3 -5
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +11 -23
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeNewArchitectureFeatureFlags.kt +0 -24
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeNewArchitectureFeatureFlagsDefaults.kt +0 -4
- package/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.kt +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/TimingModule.kt +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.kt +50 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkEventUtil.kt +53 -3
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.kt +2 -77
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessCatalystInstance.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessReactContext.kt +9 -4
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt +4 -19
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactInstance.kt +2 -6
- package/ReactAndroid/src/main/java/com/facebook/react/touch/ReactInterceptingViewGroup.kt +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +47 -10
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/DisplayMetricsHolder.kt +1 -49
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/HasChildPressedStateDelay.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.kt +796 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.kt +2 -4
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/LayoutShadowNode.kt +27 -27
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.kt +184 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.kt +486 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java +8 -8
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ShadowNodeRegistry.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/SkewMatrixHelper.kt +200 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ThemedReactContext.kt +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.kt +6 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/TransformHelper.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIBlock.kt +7 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.kt +645 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.kt +2 -3
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.kt +142 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupManager.kt +0 -10
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManager.java +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.kt +527 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewProps.kt +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BorderRadiusStyle.kt +6 -6
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/ColorStop.kt +6 -0
- package/ReactAndroid/src/main/java/com/facebook/react/util/AndroidVersion.kt +7 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/drawer/ReactDrawerLayout.kt +8 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.kt +0 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ReactProgressBarViewManager.kt +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/safeareaview/ReactSafeAreaView.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.kt +1640 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.kt +6 -6
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.kt +1317 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollViewManager.kt +8 -8
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.kt +1309 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.kt +7 -7
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainer.kt +19 -33
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateClassic.kt +8 -6
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateExperimental.kt +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/generate-nested-scroll-view.js +13 -20
- package/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout.kt +7 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/MutableSpannableLayout.kt +107 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/PreparedLayoutTextView.kt +122 -10
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +92 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.kt +3 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTypefaceUtils.kt +41 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.kt +48 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextDecorationStyle.kt +200 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextEffectRegistry.kt +45 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextEffectSpanFactory.kt +17 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt +361 -15
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/AnimatedEffectSpan.kt +37 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/{DrawCommandSpan.kt → CanvasEffectSpan.kt} +3 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/CustomStyleSpan.kt +23 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/ReactStrikethroughSpan.kt +30 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/ReactUnderlineSpan.kt +25 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/SetSpanOperation.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/StatefulSpan.kt +21 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/TextEffectSpan.kt +19 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/span/TouchableSpan.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.kt +83 -11
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.kt +6 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextSelectionWatcher.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt +3 -17
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.kt +8 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/WindowUtil.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/VirtualViewRenderState.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualView.kt +7 -8
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.kt +45 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaBoxSizing.kt +27 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfig.kt +15 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfigJNIBase.kt +6 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDimension.kt +27 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.kt +31 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaEdge.kt +41 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaErrata.kt +37 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.kt +27 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaFlexDirection.kt +31 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGridTrackType.kt +33 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGutter.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.kt +43 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaLogLevel.kt +39 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaMeasureMode.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNative.kt +16 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.kt +12 -2
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.kt +762 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIFinalizer.kt +4 -4
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeType.kt +27 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaOverflow.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaPositionType.kt +29 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaProps.kt +24 -2
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaUnit.kt +37 -0
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaWrap.kt +29 -0
- package/ReactAndroid/src/main/jni/CMakeLists.txt +1 -2
- package/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNIVanilla.cpp +94 -0
- package/ReactAndroid/src/main/jni/react/devsupport/JCxxInspectorPackagerConnectionDelegateImpl.cpp +3 -0
- package/ReactAndroid/src/main/jni/react/fabric/AndroidAnimationChoreographer.h +10 -10
- package/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp +3 -0
- package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp +12 -15
- package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.h +1 -3
- package/ReactAndroid/src/main/jni/react/fabric/test/FabricMountingManagerTest.cpp +159 -0
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +69 -153
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +15 -33
- package/ReactAndroid/src/main/jni/react/jni/JReactMarker.cpp +10 -24
- package/ReactAndroid/src/main/jni/react/jni/JReactMarker.h +0 -2
- package/ReactAndroid/src/main/jni/react/mapbuffer/react/common/mapbuffer/JWritableMapBuffer.cpp +13 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactInstance.cpp +4 -1
- package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.cpp +8 -0
- package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.h +4 -0
- package/ReactAndroid/src/main/res/views/uimanager/values/ids.xml +5 -0
- package/ReactAndroid/src/main/res/views/uimanager/values-zu/strings.xml +3 -0
- package/ReactApple/Libraries/RCTFoundation/RCTDeprecation/RCTDeprecation.podspec +1 -1
- package/ReactApple/RCTAnimatedModuleProvider/React-RCTAnimatedModuleProvider.podspec +63 -0
- package/ReactApple/RCTSwiftUI/RCTSwiftUI.podspec +1 -1
- package/ReactApple/RCTSwiftUIWrapper/RCTSwiftUIWrapper.podspec +1 -1
- package/ReactCommon/React-Fabric.podspec +3 -1
- package/ReactCommon/React-FabricComponents.podspec +1 -1
- package/ReactCommon/React-FabricImage.podspec +1 -1
- package/ReactCommon/React-Mapbuffer.podspec +1 -1
- package/ReactCommon/ReactCommon.podspec +3 -13
- package/ReactCommon/callinvoker/React-callinvoker.podspec +1 -1
- package/ReactCommon/cmake-utils/react-native-flags.cmake +1 -3
- package/ReactCommon/cxxreact/CMakeLists.txt +1 -0
- package/ReactCommon/cxxreact/ErrorUtils.h +2 -32
- package/ReactCommon/cxxreact/Instance.cpp +1 -26
- package/ReactCommon/cxxreact/Instance.h +0 -2
- package/ReactCommon/cxxreact/NativeToJsBridge.cpp +3 -2
- package/ReactCommon/cxxreact/RAMBundleRegistry.cpp +0 -12
- package/ReactCommon/cxxreact/RAMBundleRegistry.h +0 -5
- package/ReactCommon/cxxreact/React-cxxreact.podspec +3 -2
- package/ReactCommon/cxxreact/ReactMarker.cpp +4 -30
- package/ReactCommon/cxxreact/ReactMarker.h +38 -21
- package/ReactCommon/cxxreact/ReactNativeVersion.h +4 -4
- package/ReactCommon/cxxreact/TraceSection.h +1 -1
- package/ReactCommon/cxxreact/tests/methodcall.cpp +4 -0
- package/ReactCommon/hermes/React-hermes.podspec +1 -1
- package/ReactCommon/hermes/executor/HermesExecutorFactory.cpp +6 -79
- package/ReactCommon/hermes/executor/React-jsitracing.podspec +1 -1
- package/ReactCommon/jserrorhandler/ErrorUtils.cpp +42 -0
- package/{React/CxxLogUtils/RCTDefaultCxxLogFunction.h → ReactCommon/jserrorhandler/ErrorUtils.h} +2 -2
- package/ReactCommon/jserrorhandler/JsErrorHandler.cpp +1 -1
- package/ReactCommon/jserrorhandler/React-jserrorhandler.podspec +3 -4
- package/ReactCommon/jsi/React-jsi.podspec +1 -1
- package/ReactCommon/jsi/jsi/hermes-interfaces.h +53 -0
- package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +3 -2
- package/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp +3 -14
- package/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp +4 -13
- package/ReactCommon/jsinspector-modern/HostAgent.cpp +54 -0
- package/ReactCommon/jsinspector-modern/HostTarget.h +0 -7
- package/ReactCommon/jsinspector-modern/HostTargetTraceRecording.cpp +10 -7
- package/ReactCommon/jsinspector-modern/InspectorPackagerConnection.cpp +4 -1
- package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +1 -1
- package/ReactCommon/jsinspector-modern/RuntimeAgent.cpp +7 -0
- package/ReactCommon/jsinspector-modern/RuntimeTarget.cpp +20 -0
- package/ReactCommon/jsinspector-modern/RuntimeTarget.h +16 -0
- package/ReactCommon/jsinspector-modern/SessionState.h +31 -0
- package/ReactCommon/jsinspector-modern/cdp/React-jsinspectorcdp.podspec +1 -1
- package/ReactCommon/jsinspector-modern/network/React-jsinspectornetwork.podspec +1 -1
- package/ReactCommon/jsinspector-modern/tests/HostTargetTest.cpp +53 -0
- package/ReactCommon/jsinspector-modern/tracing/HostTracingProfile.h +14 -1
- package/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec +1 -1
- package/ReactCommon/jsinspector-modern/tracing/TraceRecordingState.h +11 -0
- package/ReactCommon/jsitooling/React-jsitooling.podspec +1 -1
- package/ReactCommon/logger/React-logger.podspec +1 -1
- package/ReactCommon/oscompat/React-oscompat.podspec +1 -1
- package/ReactCommon/react/bridging/ArrayBuffer.h +180 -0
- package/ReactCommon/react/bridging/Bridging.h +1 -0
- package/ReactCommon/react/bridging/Convert.h +12 -0
- package/ReactCommon/react/bridging/React-bridging.podspec +44 -0
- package/ReactCommon/react/bridging/tests/BridgingTest.cpp +185 -11
- package/ReactCommon/react/bridging/tests/ClassTest.cpp +22 -0
- package/ReactCommon/react/cxxstableapi/CMakeLists.txt +18 -0
- package/ReactCommon/react/cxxstableapi/FrameworksGuard.h +35 -0
- package/ReactCommon/react/cxxstableapi/PrivateGuard.h +34 -0
- package/ReactCommon/react/cxxstableapi/React-cxxstableapi.podspec +34 -0
- package/ReactCommon/react/cxxstableapi/UmbrellaGuard.h +53 -0
- package/ReactCommon/react/debug/React-debug.podspec +1 -1
- package/ReactCommon/react/debug/redbox/JscSafeUrl.h +1 -1
- package/ReactCommon/react/featureflags/React-featureflags.podspec +1 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +21 -45
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +26 -56
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +134 -242
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +14 -26
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +20 -44
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +43 -97
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSCanary.h +10 -6
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSExperimental.h +3 -7
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSStable.h +0 -8
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +7 -13
- package/ReactCommon/react/nativemodule/core/ReactCommon/TurboModule.h +1 -0
- package/ReactCommon/react/nativemodule/core/iostests/RCTTurboModuleTests.mm +49 -0
- package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaInteropTurboModule.cpp +4 -0
- package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaInteropTurboModule.h +4 -0
- package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp +2 -2
- package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +2 -2
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.h +4 -0
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.mm +5 -1
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +61 -4
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.h +0 -9
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm +37 -139
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleWithJSIBindings.h +0 -3
- package/ReactCommon/react/nativemodule/defaults/DefaultTurboModules.cpp +6 -0
- package/ReactCommon/react/nativemodule/defaults/React-defaultsnativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/dom/NativeDOM.cpp +10 -4
- package/ReactCommon/react/nativemodule/dom/React-domnativemodule.podspec +2 -1
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +25 -55
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +11 -23
- package/ReactCommon/react/nativemodule/featureflags/React-featureflagsnativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/idlecallbacks/React-idlecallbacksnativemodule.podspec +2 -1
- package/ReactCommon/react/nativemodule/intersectionobserver/React-intersectionobservernativemodule.podspec +2 -1
- package/ReactCommon/react/nativemodule/microtasks/React-microtasksnativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/mutationobserver/NativeMutationObserver.cpp +4 -0
- package/ReactCommon/react/nativemodule/mutationobserver/React-mutationobservernativemodule.podspec +2 -1
- package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +1 -1
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.h +1 -1
- package/ReactCommon/react/nativemodule/viewtransition/React-viewtransitionnativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/webperformance/React-webperformancenativemodule.podspec +2 -1
- package/ReactCommon/react/networking/React-networking.podspec +1 -1
- package/ReactCommon/react/performance/cdpmetrics/React-performancecdpmetrics.podspec +1 -1
- package/ReactCommon/react/performance/timeline/React-performancetimeline.podspec +1 -1
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp +95 -63
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.h +20 -1
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManagerProvider.cpp +7 -10
- package/ReactCommon/react/renderer/animated/drivers/FrameAnimationDriver.cpp +20 -1
- package/ReactCommon/react/renderer/animated/drivers/FrameAnimationDriver.h +1 -0
- package/ReactCommon/react/renderer/animated/internal/primitives.h +1 -1
- package/ReactCommon/react/renderer/animated/nodes/InterpolationAnimatedNode.cpp +67 -6
- package/ReactCommon/react/renderer/animated/nodes/InterpolationAnimatedNode.h +12 -0
- package/ReactCommon/react/renderer/animated/nodes/PropsAnimatedNode.cpp +25 -13
- package/ReactCommon/react/renderer/animated/nodes/PropsAnimatedNode.h +7 -0
- package/ReactCommon/react/renderer/animated/tests/AnimationDriverTests.cpp +48 -0
- package/ReactCommon/react/renderer/animated/tests/DecayAnimationDriverTest.cpp +245 -0
- package/ReactCommon/react/renderer/animated/tests/ManagedPropsMountingOverrideTests.cpp +204 -0
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.cpp +10 -1
- package/ReactCommon/react/renderer/animationbackend/AnimatedPropsRegistry.h +1 -0
- package/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp +17 -0
- package/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +0 -2
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +6 -2
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +25 -1
- package/ReactCommon/react/renderer/attributedstring/conversions.h +29 -1
- package/ReactCommon/react/renderer/attributedstring/primitives.h +4 -2
- package/ReactCommon/react/renderer/attributedstring/tests/ParagraphAttributesTest.cpp +73 -0
- package/ReactCommon/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +6 -0
- package/ReactCommon/react/renderer/components/image/ImageProps.cpp +79 -126
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropShadowNode.cpp +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropShadowNode.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropState.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewProps.cpp +5 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewProps.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticComponentDescriptor.cpp +5 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticComponentDescriptor.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticShadowNode.cpp +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticShadowNode.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerInteropComponentDescriptor.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +5 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +4 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/platform/ios/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +5 -0
- package/ReactCommon/react/renderer/components/scrollview/BaseScrollViewProps.cpp +235 -352
- package/ReactCommon/react/renderer/components/scrollview/platform/android/react/renderer/components/scrollview/HostPlatformScrollViewProps.cpp +30 -46
- package/ReactCommon/react/renderer/components/text/BaseParagraphProps.cpp +17 -27
- package/ReactCommon/react/renderer/components/text/BaseTextProps.cpp +8 -10
- package/ReactCommon/react/renderer/components/text/BaseTextShadowNode.cpp +19 -0
- package/ReactCommon/react/renderer/components/text/TextEffectComponentDescriptor.h +17 -0
- package/ReactCommon/react/renderer/components/text/TextEffectProps.cpp +59 -0
- package/ReactCommon/react/renderer/components/text/TextEffectProps.h +30 -0
- package/{Libraries/Text/VirtualText/RCTVirtualTextView.mm → ReactCommon/react/renderer/components/text/TextEffectShadowNode.cpp} +4 -6
- package/ReactCommon/react/renderer/components/text/TextEffectShadowNode.h +26 -0
- package/ReactCommon/react/renderer/components/text/platform/android/react/renderer/components/text/HostPlatformParagraphProps.cpp +18 -28
- package/ReactCommon/react/renderer/components/text/tests/BaseTextShadowNodeTest.cpp +15 -0
- package/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput/AndroidTextInputProps.cpp +42 -50
- package/ReactCommon/react/renderer/components/view/AccessibilityProps.cpp +168 -754
- package/ReactCommon/react/renderer/components/view/AccessibilityProps.h +0 -9
- package/ReactCommon/react/renderer/components/view/BaseViewProps.cpp +248 -312
- package/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp +0 -6
- package/ReactCommon/react/renderer/components/view/ViewShadowNode.h +2 -12
- package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +73 -27
- package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.h +7 -9
- package/ReactCommon/react/renderer/components/view/YogaStylableProps.cpp +3 -11
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp +82 -162
- package/ReactCommon/react/renderer/components/view/primitives.h +5 -0
- package/ReactCommon/react/renderer/components/view/propsConversions.h +74 -42
- package/ReactCommon/react/renderer/components/view/tests/LayoutTest.cpp +5 -5
- package/ReactCommon/react/renderer/components/view/tests/ViewTest.cpp +353 -6
- package/ReactCommon/react/renderer/consistency/React-rendererconsistency.podspec +1 -1
- package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +41 -16
- package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +19 -0
- package/ReactCommon/react/renderer/core/EventEmitter.cpp +20 -4
- package/ReactCommon/react/renderer/core/LayoutMetrics.h +3 -0
- package/ReactCommon/react/renderer/core/Props.cpp +8 -39
- package/ReactCommon/react/renderer/core/Props.h +63 -13
- package/ReactCommon/react/renderer/core/RawProps.cpp +20 -3
- package/ReactCommon/react/renderer/core/RawProps.h +44 -0
- package/ReactCommon/react/renderer/core/RawPropsKeyMap.cpp +11 -27
- package/ReactCommon/react/renderer/core/RawPropsKeyMap.h +3 -3
- package/ReactCommon/react/renderer/core/RawPropsParser.cpp +4 -6
- package/ReactCommon/react/renderer/core/RawPropsParser.h +3 -3
- package/ReactCommon/react/renderer/core/StateData.h +4 -4
- package/ReactCommon/react/renderer/core/propsConversions.h +3 -7
- package/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp +8 -0
- package/ReactCommon/react/renderer/core/tests/FindNodeAtPointTest.cpp +7 -7
- package/ReactCommon/react/renderer/core/tests/LayoutableShadowNodeTest.cpp +19 -19
- package/ReactCommon/react/renderer/core/tests/PropsConceptsTest.cpp +135 -0
- package/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp +43 -53
- package/ReactCommon/react/renderer/css/React-renderercss.podspec +1 -1
- package/ReactCommon/react/renderer/debug/React-rendererdebug.podspec +1 -1
- package/ReactCommon/react/renderer/element/tests/ElementTest.cpp +3 -3
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/android/react/renderer/imagemanager/conversions.h +17 -0
- package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTSyncImageManager.mm +1 -1
- package/ReactCommon/react/renderer/mapbuffer/MapBuffer.cpp +123 -33
- package/ReactCommon/react/renderer/mapbuffer/MapBuffer.h +26 -14
- package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.cpp +96 -53
- package/ReactCommon/react/renderer/mapbuffer/MapBufferBuilder.h +4 -0
- package/ReactCommon/react/renderer/mapbuffer/tests/MapBufferTest.cpp +96 -1
- package/ReactCommon/react/renderer/mounting/Differentiator.cpp +29 -318
- package/ReactCommon/react/renderer/mounting/ShadowTree.cpp +105 -33
- package/ReactCommon/react/renderer/mounting/ShadowTree.h +2 -0
- package/ReactCommon/react/renderer/mounting/internal/CullingContext.cpp +1 -1
- package/ReactCommon/react/renderer/mounting/tests/DifferentiatorUnflattenTest.cpp +11 -3
- package/ReactCommon/react/renderer/mounting/tests/OrderIndexTest.cpp +1 -1
- package/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp +15 -250
- package/ReactCommon/react/renderer/mounting/tests/ShadowTreeReactBranchingTest.cpp +141 -0
- package/ReactCommon/react/renderer/mounting/tests/StackingContextTest.cpp +1 -1
- package/ReactCommon/react/renderer/runtimescheduler/CMakeLists.txt +1 -0
- package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +2 -1
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +22 -2
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +13 -2
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Legacy.cpp +13 -0
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Legacy.h +9 -0
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.cpp +43 -5
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.h +17 -1
- package/ReactCommon/react/renderer/runtimescheduler/Task.h +4 -0
- package/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +113 -8
- package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +14 -6
- package/ReactCommon/react/renderer/scheduler/Scheduler.h +3 -2
- package/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp +1 -85
- package/ReactCommon/react/renderer/scheduler/SurfaceHandler.h +0 -6
- package/ReactCommon/react/renderer/scheduler/tests/SchedulerDelegateInvalidationTest.cpp +671 -0
- package/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h +22 -5
- package/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp +4 -2
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h +11 -0
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +65 -26
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +193 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextPrimitivesConversions.h +14 -2
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/TextLayoutManager.mm +2 -1
- package/ReactCommon/react/renderer/textlayoutmanager/tests/TextLayoutManagerTest.cpp +86 -5
- package/ReactCommon/react/renderer/uimanager/UIManager.cpp +31 -41
- package/ReactCommon/react/renderer/uimanager/UIManager.h +2 -2
- package/ReactCommon/react/renderer/uimanager/UIManagerDelegate.h +1 -1
- package/ReactCommon/react/renderer/uimanager/tests/FindShadowNodeByTagTest.cpp +1 -52
- package/ReactCommon/react/renderer/uimanager/tests/PointerEventsProcessorTest.cpp +4 -4
- package/ReactCommon/react/renderer/viewtransition/ViewTransitionModule.cpp +88 -39
- package/ReactCommon/react/renderer/viewtransition/ViewTransitionModule.h +12 -2
- package/ReactCommon/react/runtime/PlatformTimerRegistry.h +10 -0
- package/ReactCommon/react/runtime/React-RuntimeCore.podspec +1 -1
- package/ReactCommon/react/runtime/React-RuntimeHermes.podspec +1 -1
- package/ReactCommon/react/runtime/ReactInstance.cpp +79 -64
- package/ReactCommon/react/runtime/hermes/HermesInstance.cpp +0 -89
- package/ReactCommon/react/runtime/iostests/MainQueueCoordinatorTests.mm +99 -0
- package/ReactCommon/react/runtime/iostests/RCTInstanceTests.mm +244 -0
- package/ReactCommon/react/runtime/platform/ios/React-RuntimeApple.podspec +1 -1
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/ObjCTimerRegistry.h +1 -1
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +47 -30
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTJscInstance.mm +3 -2
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTPerformanceLoggerUtils.mm +3 -2
- package/ReactCommon/react/runtime/tests/cxx/ReactInstanceTest.cpp +27 -3
- package/ReactCommon/react/runtime/tests/cxx/RuntimeExecutorShutdownTest.cpp +155 -0
- package/ReactCommon/react/timing/React-timing.podspec +1 -1
- package/ReactCommon/react/utils/React-utils.podspec +1 -1
- package/ReactCommon/react/utils/Telemetry.h +0 -13
- package/ReactCommon/react/utils/tests/Base64Tests.cpp +36 -0
- package/ReactCommon/reactperflogger/React-perflogger.podspec +1 -1
- package/ReactCommon/reactperflogger/reactperflogger/ReactPerfettoLogger.cpp +0 -1
- package/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec +1 -1
- package/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.mm +21 -38
- package/ReactCommon/yoga/Yoga.podspec +2 -2
- package/ReactCommon/yoga/yoga/YGEnums.cpp +2 -0
- package/ReactCommon/yoga/yoga/YGEnums.h +1 -0
- package/ReactCommon/yoga/yoga/YGNode.cpp +27 -0
- package/ReactCommon/yoga/yoga/YGNode.h +69 -0
- package/ReactCommon/yoga/yoga/YGNodeLayout.h +0 -2
- package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp +283 -10
- package/ReactCommon/yoga/yoga/config/Config.h +1 -1
- package/ReactCommon/yoga/yoga/enums/Errata.h +1 -0
- package/ReactCommon/yoga/yoga/node/LayoutResults.h +8 -0
- package/ReactCommon/yoga/yoga/node/Node.cpp +32 -0
- package/ReactCommon/yoga/yoga/node/Node.h +33 -0
- package/changes.json +5 -13
- package/cli.js +3 -182
- package/flow/bom.js.flow +42 -42
- package/flow/cssom.js.flow +21 -21
- package/flow/dom.js.flow +128 -128
- package/flow/global.js +6 -0
- package/gradle/libs.versions.toml +7 -5
- package/index.js +53 -86
- package/index.js.flow +53 -23
- package/package.json +44 -63
- package/react-native.config.js +82 -1
- package/scripts/cocoapods/fabric.rb +1 -1
- package/scripts/cocoapods/jsengine.rb +1 -1
- package/scripts/cocoapods/new_architecture.rb +1 -1
- package/scripts/cocoapods/rncore.rb +36 -78
- package/scripts/cocoapods/rncore_facades.rb +232 -0
- package/scripts/cocoapods/rndependencies.rb +64 -3
- package/scripts/cocoapods/rndeps_facades.rb +193 -0
- package/scripts/cocoapods/spm.rb +79 -12
- package/scripts/cocoapods/utils.rb +7 -9
- package/scripts/codegen/generate-artifacts-executor/generateSchemaInfos.js +0 -1
- package/scripts/codegen/templates/Package.swift.spm-template +97 -0
- package/scripts/codegen/templates/ReactAppDependencyProvider.podspec.template +1 -1
- package/scripts/codegen/templates/ReactCodegen.podspec.template +2 -2
- package/scripts/hermes/hermes-utils.js +27 -58
- package/scripts/ios-configure-glog.sh +1 -1
- package/scripts/react-native-xcode.sh +20 -0
- package/scripts/react_native_pods.rb +71 -21
- package/scripts/react_native_pods_utils/script_phases.sh +4 -3
- package/scripts/replace-rncore-version.js +57 -86
- package/scripts/setup-apple-spm.js +1267 -0
- package/scripts/spm/__doc__/rfc-spm-xcframework.md +707 -0
- package/scripts/spm/__doc__/spm-autolinking-plugins.md +244 -0
- package/scripts/spm/__doc__/spm-header-paths-contract.md +97 -0
- package/scripts/spm/__doc__/spm-plugins-assessment.md +128 -0
- package/scripts/spm/__doc__/spm-scripts.md +486 -0
- package/scripts/spm/autolinking-plugins.js +331 -0
- package/scripts/spm/download-spm-artifacts.js +1409 -0
- package/scripts/spm/expand-spm-dependencies.js +216 -0
- package/scripts/spm/flavored-frameworks.js +1008 -0
- package/scripts/spm/generate-spm-autolinking-config.js +221 -0
- package/scripts/spm/generate-spm-autolinking.js +1888 -0
- package/scripts/spm/generate-spm-package.js +302 -0
- package/scripts/spm/generate-spm-xcodeproj.js +2266 -0
- package/scripts/spm/read-podspec.js +695 -0
- package/scripts/spm/scaffold-package-swift.js +1206 -0
- package/scripts/spm/spm-pbxproj.js +654 -0
- package/scripts/spm/spm-types.js +520 -0
- package/scripts/spm/spm-utils.js +645 -0
- package/scripts/spm/sync-spm-autolinking.js +160 -0
- package/sdks/.hermesv1version +1 -1
- package/sdks/hermes-engine/hermes-engine.podspec +9 -39
- package/sdks/hermes-engine/hermes-utils.rb +19 -73
- package/sdks/hermes-engine/utils/replace_hermes_version.js +18 -4
- package/sdks/hermes-engine/version.properties +1 -2
- package/settings.gradle.kts +0 -43
- package/src/asset-registry.js +29 -0
- package/src/private/animated/NativeAnimatedHelper.js +45 -21
- package/src/private/assets/AssetRegistry.js +52 -0
- package/src/private/{specs_DEPRECATED/components → components/activityindicator/specs}/ActivityIndicatorViewNativeComponent.js +5 -5
- package/src/private/{specs_DEPRECATED/components → components/debuggingoverlay/specs}/DebuggingOverlayNativeComponent.js +8 -8
- package/src/private/{specs_DEPRECATED/components → components/drawerlayoutandroid/specs}/AndroidDrawerLayoutNativeComponent.js +8 -8
- package/src/private/{specs_DEPRECATED/components → components/inputaccessoryview/specs}/RCTInputAccessoryViewNativeComponent.js +4 -4
- package/src/private/{specs_DEPRECATED/components → components/modal/specs}/RCTModalHostViewNativeComponent.js +4 -9
- package/src/private/{specs_DEPRECATED/components → components/progressbarandroid/specs}/ProgressBarAndroidNativeComponent.js +5 -5
- package/src/private/{specs_DEPRECATED/components → components/refreshcontrol/specs}/AndroidSwipeRefreshLayoutNativeComponent.js +7 -7
- package/src/private/{specs_DEPRECATED/components → components/refreshcontrol/specs}/PullToRefreshViewNativeComponent.js +7 -7
- package/src/private/components/safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE.js +2 -2
- package/src/private/{specs_DEPRECATED/components → components/safeareaview/specs}/RCTSafeAreaViewNativeComponent.js +3 -3
- package/src/private/components/scrollview/HScrollViewNativeComponents.js +1 -1
- package/src/private/{specs_DEPRECATED/components → components/scrollview/specs}/AndroidHorizontalScrollContentViewNativeComponent.js +3 -3
- package/src/private/{specs_DEPRECATED/components → components/switch/specs}/AndroidSwitchNativeComponent.js +7 -7
- package/src/private/{specs_DEPRECATED/components → components/switch/specs}/SwitchNativeComponent.js +10 -7
- package/src/private/{specs_DEPRECATED/components → components/unimplementedview/specs}/UnimplementedNativeViewNativeComponent.js +4 -4
- package/src/private/components/virtualcollection/Virtual.js +5 -5
- package/src/private/components/virtualcollection/VirtualCollectionView.js +2 -6
- package/src/private/components/virtualcollection/column/VirtualColumn.js +1 -1
- package/src/private/components/virtualcollection/row/VirtualRow.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/Inspector.js +3 -1
- package/src/private/devsupport/devmenu/specs/NativeDevMenu.js +4 -4
- package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsRuntimeSettingsModule.js +4 -2
- package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsSettingsManager.js +2 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +46 -70
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +88 -94
- package/src/private/renderer/errorhandling/ErrorHandlers.js +2 -2
- package/src/private/renderer/events/ReactNativeResponder.js +49 -4
- package/src/private/renderer/events/ResponderTouchHistoryStore.js +11 -2
- package/src/private/renderer/events/dispatchNativeEvent.js +71 -36
- package/src/private/setup/setUpDOM.js +19 -9
- package/src/private/setup/setUpIntersectionObserver.js +7 -0
- package/src/private/setup/setUpMutationObserver.js +3 -1
- package/src/private/specs_DEPRECATED/modules/NativeAccessibilityInfo.js +9 -9
- package/src/private/specs_DEPRECATED/modules/NativeAccessibilityManager.js +24 -24
- package/src/private/specs_DEPRECATED/modules/NativeActionSheetManager.js +28 -28
- package/src/private/specs_DEPRECATED/modules/NativeAlertManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeAnimatedModule.js +45 -25
- package/src/private/specs_DEPRECATED/modules/NativeAnimatedTurboModule.js +44 -24
- package/src/private/specs_DEPRECATED/modules/NativeAppState.js +4 -4
- package/src/private/specs_DEPRECATED/modules/NativeAppearance.js +8 -6
- package/src/private/specs_DEPRECATED/modules/NativeBlobModule.js +7 -7
- package/src/private/specs_DEPRECATED/modules/NativeClipboard.js +3 -3
- package/src/private/specs_DEPRECATED/modules/NativeDevLoadingView.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeDevSettings.js +11 -11
- package/src/private/specs_DEPRECATED/modules/NativeDeviceEventManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeDeviceInfo.js +4 -4
- package/src/private/specs_DEPRECATED/modules/NativeDialogManagerAndroid.js +7 -7
- package/src/private/specs_DEPRECATED/modules/NativeExceptionsManager.js +4 -4
- package/src/private/specs_DEPRECATED/modules/NativeFileReaderModule.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeFrameRateLogger.js +4 -4
- package/src/private/specs_DEPRECATED/modules/NativeHeadlessJsTaskSupport.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeI18nManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeImageEditor.js +13 -13
- package/src/private/specs_DEPRECATED/modules/NativeImageLoaderAndroid.js +9 -6
- package/src/private/specs_DEPRECATED/modules/NativeImageLoaderIOS.js +6 -6
- package/src/private/specs_DEPRECATED/modules/NativeImageStoreAndroid.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeImageStoreIOS.js +8 -5
- package/src/private/specs_DEPRECATED/modules/NativeIntentAndroid.js +5 -5
- package/src/private/specs_DEPRECATED/modules/NativeJSCHeapCapture.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeKeyboardObserver.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeLinkingManager.js +6 -6
- package/src/private/specs_DEPRECATED/modules/NativeLogBox.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeModalManager.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeNetworkingAndroid.js +5 -5
- package/src/private/specs_DEPRECATED/modules/NativeNetworkingIOS.js +6 -6
- package/src/private/specs_DEPRECATED/modules/NativePermissionsAndroid.js +6 -4
- package/src/private/specs_DEPRECATED/modules/NativePlatformConstantsAndroid.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativePlatformConstantsIOS.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativePushNotificationManagerIOS.js +35 -31
- package/src/private/specs_DEPRECATED/modules/NativeRedBox.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeSampleTurboModule.js +24 -24
- package/src/private/specs_DEPRECATED/modules/NativeSegmentFetcher.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeSettingsManager.js +3 -3
- package/src/private/specs_DEPRECATED/modules/NativeShareModule.js +2 -2
- package/src/private/specs_DEPRECATED/modules/NativeSoundManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeSourceCode.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeStatusBarManagerAndroid.js +5 -17
- package/src/private/specs_DEPRECATED/modules/NativeStatusBarManagerIOS.js +10 -15
- package/src/private/specs_DEPRECATED/modules/NativeTiming.js +3 -3
- package/src/private/specs_DEPRECATED/modules/NativeToastAndroid.js +4 -4
- package/src/private/specs_DEPRECATED/modules/NativeUIManager.js +35 -22
- package/src/private/specs_DEPRECATED/modules/NativeVibration.js +4 -4
- package/src/private/specs_DEPRECATED/modules/NativeWebSocketModule.js +7 -7
- package/src/private/types/HostInstance.js +38 -80
- package/src/private/viewtransition/specs/NativeViewTransition.js +6 -4
- package/src/private/webapis/dom/abort-api/AbortController.js +92 -0
- package/src/private/webapis/dom/abort-api/AbortSignal.js +243 -0
- package/src/private/webapis/dom/events/CustomEvent.js +1 -1
- package/src/private/webapis/dom/events/Event.js +12 -12
- package/src/private/webapis/dom/events/EventTarget.js +146 -37
- package/src/private/webapis/dom/events/internals/EventInternals.js +36 -0
- package/src/private/webapis/dom/events/internals/EventTargetInternals.js +38 -3
- package/src/private/webapis/dom/nodes/ReactNativeDocument.js +11 -0
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +105 -4
- package/src/private/webapis/dom/nodes/ReadOnlyCharacterData.js +11 -0
- package/src/private/webapis/dom/nodes/ReadOnlyElement.js +9 -0
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +34 -7
- package/src/private/webapis/dom/nodes/ReadOnlyText.js +33 -0
- package/src/private/webapis/dom/nodes/specs/NativeDOM.js +46 -42
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +12 -0
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js.flow +4 -2
- package/src/private/webapis/dom/oldstylecollections/NodeList.js +10 -0
- package/src/private/webapis/dom/oldstylecollections/NodeList.js.flow +4 -3
- package/src/private/webapis/errors/DOMException.js +50 -50
- package/src/private/webapis/geometry/DOMRectList.js +12 -0
- package/src/private/webapis/geometry/DOMRectList.js.flow +3 -1
- package/src/private/webapis/html/events/MessageEvent.js +3 -3
- package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +2 -2
- package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +13 -0
- package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +3 -7
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +5 -5
- package/src/private/webapis/microtasks/specs/NativeMicrotasks.js +1 -1
- package/src/private/webapis/mutationobserver/MutationObserver.js +7 -7
- package/src/private/webapis/mutationobserver/MutationRecord.js +12 -0
- package/src/private/webapis/mutationobserver/internals/MutationObserverManager.js +5 -7
- package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +5 -5
- package/src/private/webapis/performance/EventTiming.js +3 -3
- package/src/private/webapis/performance/PerformanceEntry.js +3 -3
- package/src/private/webapis/performance/PerformanceObserver.js +4 -4
- package/src/private/webapis/performance/ResourceTiming.js +13 -13
- package/src/private/webapis/performance/UserTiming.js +3 -3
- package/src/private/webapis/performance/internals/Utilities.js +1 -1
- package/src/private/webapis/performance/specs/NativePerformance.js +26 -20
- package/src/private/webapis/utils/ArrayLikeUtils.js +1 -1
- package/src/private/webapis/websockets/events/CloseEvent.js +3 -3
- package/src/private/webapis/xhr/events/ProgressEvent.js +3 -3
- package/src/react-private-interface.js +145 -0
- package/src/react-private-interface.js.flow +48 -0
- package/src/setup-env.js +22 -0
- package/src/types/globals.d.ts +35 -3
- package/src/unstable-internals-do-not-use.d.ts +214 -0
- package/src/unstable-internals-do-not-use.js +76 -0
- package/third-party-podspecs/RCT-Folly.podspec +1 -1
- package/third-party-podspecs/ReactNativeDependencies.podspec +3 -3
- package/third-party-podspecs/glog.podspec +1 -1
- package/types/index.d.ts +0 -1
- package/types/public/DeprecatedPropertiesAlias.d.ts +0 -4
- package/types/public/ReactNativeTypes.d.ts +6 -4
- package/types_generated/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +26 -31
- package/types_generated/Libraries/Alert/Alert.d.ts +44 -7
- package/types_generated/Libraries/Animated/AnimatedEvent.d.ts +2 -2
- package/types_generated/Libraries/Animated/AnimatedExports.d.ts +2 -2
- package/types_generated/Libraries/Animated/AnimatedImplementation.d.ts +107 -3
- package/types_generated/Libraries/Animated/Easing.d.ts +5 -4
- package/types_generated/Libraries/Animated/animations/Animation.d.ts +7 -7
- package/types_generated/Libraries/Animated/animations/DecayAnimation.d.ts +5 -5
- package/types_generated/Libraries/Animated/animations/SpringAnimation.d.ts +49 -49
- package/types_generated/Libraries/Animated/animations/TimingAnimation.d.ts +13 -13
- package/types_generated/Libraries/Animated/components/AnimatedFlatList.d.ts +3 -3
- package/types_generated/Libraries/Animated/components/AnimatedScrollView.d.ts +2 -2
- package/types_generated/Libraries/Animated/components/AnimatedSectionList.d.ts +3 -3
- package/types_generated/Libraries/Animated/createAnimatedComponent.d.ts +4 -4
- package/types_generated/Libraries/Animated/nodes/AnimatedColor.d.ts +2 -2
- package/types_generated/Libraries/Animated/nodes/AnimatedInterpolation.d.ts +9 -9
- package/types_generated/Libraries/Animated/nodes/AnimatedNode.d.ts +3 -3
- package/types_generated/Libraries/AppState/AppState.d.ts +41 -22
- package/types_generated/Libraries/BatchedBridge/NativeModules.d.ts +8 -1
- package/types_generated/Libraries/Blob/BlobTypes.d.ts +4 -4
- package/types_generated/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +37 -46
- package/types_generated/Libraries/Components/ActivityIndicator/ActivityIndicator.d.ts +92 -43
- package/types_generated/Libraries/Components/Button.d.ts +118 -197
- package/types_generated/Libraries/Components/Clipboard/Clipboard.d.ts +6 -1
- package/types_generated/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.d.ts +44 -63
- package/types_generated/Libraries/Components/Keyboard/Keyboard.d.ts +30 -61
- package/types_generated/Libraries/Components/Keyboard/KeyboardAvoidingView.d.ts +30 -21
- package/types_generated/Libraries/Components/Pressable/Pressable.d.ts +41 -17
- package/types_generated/Libraries/Components/Pressable/useAndroidRippleForView.d.ts +6 -6
- package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts +5 -5
- package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.d.ts +18 -1
- package/types_generated/Libraries/Components/RefreshControl/RefreshControl.d.ts +35 -52
- package/types_generated/Libraries/Components/SafeAreaView/SafeAreaView.d.ts +9 -11
- package/types_generated/Libraries/Components/ScrollView/ScrollView.d.ts +212 -88
- package/types_generated/Libraries/Components/ScrollView/ScrollViewStickyHeader.d.ts +4 -4
- package/types_generated/Libraries/Components/StatusBar/StatusBar.d.ts +29 -62
- package/types_generated/Libraries/Components/Switch/Switch.d.ts +75 -70
- package/types_generated/Libraries/Components/TextInput/InputAccessoryView.d.ts +16 -65
- package/types_generated/Libraries/Components/TextInput/TextInput.d.ts +118 -3
- package/types_generated/Libraries/Components/TextInput/TextInput.flow.d.ts +24 -9
- package/types_generated/Libraries/Components/ToastAndroid/ToastAndroid.d.ts +18 -18
- package/types_generated/Libraries/Components/Touchable/TouchableHighlight.d.ts +24 -13
- package/types_generated/Libraries/Components/Touchable/TouchableNativeFeedback.d.ts +27 -64
- package/types_generated/Libraries/Components/Touchable/TouchableOpacity.d.ts +18 -6
- package/types_generated/Libraries/Components/Touchable/TouchableWithoutFeedback.d.ts +28 -28
- package/types_generated/Libraries/Components/View/View.d.ts +13 -9
- package/types_generated/Libraries/Components/View/ViewAccessibility.d.ts +31 -20
- package/types_generated/Libraries/Components/View/ViewNativeComponent.d.ts +1 -2
- package/types_generated/Libraries/Components/View/ViewPropTypes.d.ts +75 -24
- package/types_generated/Libraries/Core/ExtendedError.d.ts +10 -10
- package/types_generated/Libraries/EventEmitter/NativeEventEmitter.d.ts +34 -1
- package/types_generated/Libraries/EventEmitter/RCTNativeAppEventEmitter.d.ts +4 -1
- package/types_generated/Libraries/Image/AssetSourceResolver.d.ts +2 -13
- package/types_generated/Libraries/Image/ImageBackground.d.ts +33 -22
- package/types_generated/Libraries/Image/ImageProps.d.ts +201 -251
- package/types_generated/Libraries/Image/ImageTypes.flow.d.ts +6 -5
- package/types_generated/Libraries/Interaction/PanResponder.d.ts +103 -97
- package/types_generated/Libraries/LayoutAnimation/LayoutAnimation.d.ts +18 -7
- package/types_generated/Libraries/Linking/Linking.d.ts +28 -20
- package/types_generated/Libraries/Lists/FlatList.d.ts +17 -18
- package/types_generated/Libraries/Lists/SectionList.d.ts +10 -5
- package/types_generated/Libraries/Lists/VirtualizedList.d.ts +3 -1
- package/types_generated/Libraries/Lists/VirtualizedSectionList.d.ts +3 -1
- package/types_generated/Libraries/LogBox/Data/LogBoxData.d.ts +2 -2
- package/types_generated/Libraries/LogBox/Data/LogBoxLog.d.ts +2 -2
- package/types_generated/Libraries/LogBox/Data/parseLogBoxLog.d.ts +2 -2
- package/types_generated/Libraries/LogBox/LogBox.d.ts +4 -1
- package/types_generated/Libraries/Modal/Modal.d.ts +70 -35
- package/types_generated/Libraries/Network/FormData.d.ts +5 -5
- package/types_generated/Libraries/Performance/Systrace.d.ts +11 -1
- package/types_generated/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +31 -21
- package/types_generated/Libraries/Pressability/Pressability.d.ts +5 -5
- package/types_generated/Libraries/PushNotificationIOS/PushNotificationIOS.d.ts +15 -11
- package/types_generated/Libraries/ReactNative/AppRegistry.flow.d.ts +5 -5
- package/types_generated/Libraries/ReactNative/AppRegistryImpl.d.ts +56 -9
- package/types_generated/Libraries/ReactNative/I18nManager.d.ts +20 -1
- package/types_generated/Libraries/ReactNative/IPerformanceLogger.flow.d.ts +5 -5
- package/types_generated/Libraries/ReactPrivate/ReactNativePrivateInterface.d.ts +6 -22
- package/types_generated/Libraries/Renderer/shims/ReactNativeTypes.d.ts +34 -34
- package/types_generated/Libraries/Share/Share.d.ts +36 -39
- package/types_generated/Libraries/StyleSheet/PlatformColorValueTypes.d.ts +7 -1
- package/types_generated/Libraries/StyleSheet/PlatformColorValueTypesIOS.d.ts +3 -3
- package/types_generated/Libraries/StyleSheet/StyleSheetTypes.d.ts +202 -181
- package/types_generated/Libraries/StyleSheet/private/_TransformStyle.d.ts +3 -3
- package/types_generated/Libraries/Text/Text.d.ts +10 -6
- package/types_generated/Libraries/Text/TextProps.d.ts +57 -102
- package/types_generated/Libraries/TurboModule/RCTExport.d.ts +2 -2
- package/types_generated/Libraries/Types/CoreEventTypes.d.ts +14 -8
- package/types_generated/Libraries/Utilities/Appearance.d.ts +25 -13
- package/types_generated/Libraries/Utilities/BackHandler.d.ts +17 -1
- package/types_generated/Libraries/Utilities/DevSettings.d.ts +9 -2
- package/types_generated/Libraries/Utilities/Dimensions.d.ts +19 -13
- package/types_generated/Libraries/Utilities/PixelRatio.d.ts +6 -3
- package/types_generated/Libraries/Utilities/Platform.d.ts +5 -1
- package/types_generated/Libraries/Utilities/PlatformTypes.d.ts +65 -6
- package/types_generated/Libraries/Utilities/codegenNativeComponent.d.ts +5 -5
- package/types_generated/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.d.ts +2 -2
- package/types_generated/Libraries/Utilities/differ/deepDiffer.d.ts +2 -2
- package/types_generated/Libraries/Utilities/useColorScheme.d.ts +12 -2
- package/types_generated/Libraries/Utilities/useWindowDimensions.d.ts +7 -1
- package/types_generated/Libraries/Vibration/Vibration.d.ts +14 -6
- package/types_generated/index.d.ts +31 -25
- package/types_generated/src/private/assets/AssetRegistry.d.ts +42 -0
- package/types_generated/src/private/components/virtualcollection/VirtualCollectionView.d.ts +5 -5
- package/types_generated/src/private/components/virtualcollection/column/VirtualColumn.d.ts +3 -3
- package/types_generated/src/private/components/virtualcollection/row/VirtualRow.d.ts +3 -3
- package/types_generated/src/private/components/virtualview/VirtualView.d.ts +7 -7
- package/types_generated/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.d.ts +5 -5
- package/types_generated/src/private/components/virtualview/VirtualViewNativeComponent.d.ts +5 -5
- package/types_generated/src/private/renderer/events/dispatchNativeEvent.d.ts +26 -0
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeAppearance.d.ts +6 -5
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeDeviceInfo.d.ts +7 -7
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeExceptionsManager.d.ts +5 -5
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeUIManager.d.ts +8 -8
- package/types_generated/src/private/types/HostComponent.d.ts +3 -3
- package/types_generated/src/private/types/HostInstance.d.ts +39 -74
- package/types_generated/src/private/webapis/dom/events/CustomEvent.d.ts +2 -2
- package/types_generated/src/private/webapis/dom/events/Event.d.ts +4 -4
- package/types_generated/src/private/webapis/dom/events/EventTarget.d.ts +8 -8
- package/types_generated/src/private/webapis/dom/nodes/ReactNativeDocument.d.ts +3 -1
- package/types_generated/src/private/webapis/dom/nodes/ReactNativeElement.d.ts +57 -4
- package/types_generated/src/private/webapis/dom/nodes/ReadOnlyCharacterData.d.ts +3 -1
- package/types_generated/src/private/webapis/dom/nodes/ReadOnlyElement.d.ts +3 -1
- package/types_generated/src/private/webapis/dom/nodes/ReadOnlyNode.d.ts +4 -2
- package/types_generated/src/private/webapis/dom/nodes/ReadOnlyText.d.ts +3 -1
- package/types_generated/src/private/webapis/dom/nodes/specs/NativeDOM.d.ts +3 -3
- package/types_generated/src/private/webapis/dom/oldstylecollections/HTMLCollection.d.ts +3 -1
- package/types_generated/src/private/webapis/dom/oldstylecollections/NodeList.d.ts +3 -1
- package/types_generated/src/react-private-interface.d.ts +33 -0
- package/Libraries/AppDelegate/RCTArchConfiguratorProtocol.h +0 -38
- package/Libraries/Image/AssetRegistry.js +0 -14
- package/Libraries/Image/RCTImageShadowView.h +0 -17
- package/Libraries/Image/RCTImageShadowView.mm +0 -28
- package/Libraries/Image/RCTImageView.h +0 -32
- package/Libraries/Image/RCTImageView.mm +0 -508
- package/Libraries/Image/RCTImageViewManager.h +0 -17
- package/Libraries/Image/RCTImageViewManager.mm +0 -115
- package/Libraries/Interaction/InteractionManager.d.ts +0 -87
- package/Libraries/Interaction/InteractionManager.js +0 -189
- package/Libraries/Text/BaseText/RCTBaseTextShadowView.h +0 -35
- package/Libraries/Text/BaseText/RCTBaseTextShadowView.mm +0 -162
- package/Libraries/Text/BaseText/RCTBaseTextViewManager.h +0 -21
- package/Libraries/Text/BaseText/RCTBaseTextViewManager.mm +0 -64
- package/Libraries/Text/RCTTextAttributes.h +0 -107
- package/Libraries/Text/RCTTextAttributes.mm +0 -358
- package/Libraries/Text/RawText/RCTRawTextShadowView.h +0 -23
- package/Libraries/Text/RawText/RCTRawTextShadowView.mm +0 -38
- package/Libraries/Text/RawText/RCTRawTextViewManager.h +0 -21
- package/Libraries/Text/RawText/RCTRawTextViewManager.mm +0 -32
- package/Libraries/Text/Text/RCTTextShadowView.h +0 -33
- package/Libraries/Text/Text/RCTTextShadowView.mm +0 -469
- package/Libraries/Text/Text/RCTTextView.h +0 -34
- package/Libraries/Text/Text/RCTTextView.mm +0 -298
- package/Libraries/Text/Text/RCTTextViewManager.h +0 -19
- package/Libraries/Text/Text/RCTTextViewManager.mm +0 -97
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.h +0 -21
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.mm +0 -67
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.h +0 -21
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.mm +0 -28
- package/Libraries/Text/TextInput/RCTBaseTextInputShadowView.h +0 -30
- package/Libraries/Text/TextInput/RCTBaseTextInputShadowView.mm +0 -367
- package/Libraries/Text/TextInput/RCTBaseTextInputView.h +0 -68
- package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +0 -849
- package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.h +0 -17
- package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm +0 -181
- package/Libraries/Text/TextInput/RCTInputAccessoryShadowView.h +0 -17
- package/Libraries/Text/TextInput/RCTInputAccessoryShadowView.mm +0 -24
- package/Libraries/Text/TextInput/RCTInputAccessoryView.h +0 -22
- package/Libraries/Text/TextInput/RCTInputAccessoryView.mm +0 -82
- package/Libraries/Text/TextInput/RCTInputAccessoryViewContent.h +0 -17
- package/Libraries/Text/TextInput/RCTInputAccessoryViewContent.mm +0 -78
- package/Libraries/Text/TextInput/RCTInputAccessoryViewManager.h +0 -17
- package/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm +0 -33
- package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputView.h +0 -21
- package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputView.mm +0 -43
- package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.h +0 -21
- package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.mm +0 -35
- package/Libraries/Text/VirtualText/RCTVirtualTextShadowView.h +0 -17
- package/Libraries/Text/VirtualText/RCTVirtualTextShadowView.mm +0 -42
- package/Libraries/Text/VirtualText/RCTVirtualTextView.h +0 -28
- package/Libraries/Text/VirtualText/RCTVirtualTextViewManager.h +0 -17
- package/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm +0 -30
- package/Libraries/Utilities/SceneTracker.js +0 -42
- package/Libraries/Wrapper/Example/RCTWrapperExampleView.h +0 -21
- package/Libraries/Wrapper/Example/RCTWrapperExampleView.m +0 -57
- package/Libraries/Wrapper/Example/RCTWrapperExampleViewController.h +0 -21
- package/Libraries/Wrapper/Example/RCTWrapperExampleViewController.m +0 -27
- package/Libraries/Wrapper/Example/RCTWrapperReactRootViewController.h +0 -25
- package/Libraries/Wrapper/Example/RCTWrapperReactRootViewController.m +0 -50
- package/Libraries/Wrapper/Example/RCTWrapperReactRootViewManager.h +0 -23
- package/Libraries/Wrapper/Example/RCTWrapperReactRootViewManager.m +0 -35
- package/Libraries/Wrapper/RCTWrapper.h +0 -73
- package/Libraries/Wrapper/RCTWrapperShadowView.h +0 -27
- package/Libraries/Wrapper/RCTWrapperShadowView.m +0 -138
- package/Libraries/Wrapper/RCTWrapperView.h +0 -42
- package/Libraries/Wrapper/RCTWrapperView.m +0 -99
- package/Libraries/Wrapper/RCTWrapperViewControllerHostingView.h +0 -30
- package/Libraries/Wrapper/RCTWrapperViewControllerHostingView.m +0 -137
- package/Libraries/Wrapper/RCTWrapperViewManager.h +0 -25
- package/Libraries/Wrapper/RCTWrapperViewManager.m +0 -31
- package/React/Base/RCTRootContentView.h +0 -43
- package/React/Base/RCTRootContentView.m +0 -111
- package/React/Base/RCTRootViewInternal.h +0 -28
- package/React/CxxBridge/RCTCxxBridge.mm +0 -1572
- package/React/CxxBridge/RCTJSIExecutorRuntimeInstaller.h +0 -25
- package/React/CxxBridge/RCTJSIExecutorRuntimeInstaller.mm +0 -34
- package/React/CxxBridge/RCTObjcExecutor.h +0 -34
- package/React/CxxBridge/RCTObjcExecutor.mm +0 -150
- package/React/CxxLogUtils/RCTDefaultCxxLogFunction.mm +0 -34
- package/React/CxxModule/DispatchMessageQueueThread.h +0 -50
- package/React/CxxModule/RCTCxxMethod.h +0 -17
- package/React/CxxModule/RCTCxxMethod.mm +0 -147
- package/React/CxxModule/RCTNativeModule.h +0 -34
- package/React/CxxModule/RCTNativeModule.mm +0 -241
- package/React/Fabric/RCTSurfacePresenterBridgeAdapter.mm +0 -205
- package/React/Tests/Text/RCTTextAttributesTest.mm +0 -49
- package/React/Views/RCTActivityIndicatorView.h +0 -16
- package/React/Views/RCTActivityIndicatorView.m +0 -26
- package/React/Views/RCTActivityIndicatorViewManager.h +0 -23
- package/React/Views/RCTActivityIndicatorViewManager.m +0 -65
- package/React/Views/RCTDebuggingOverlayManager.h +0 -17
- package/React/Views/RCTDebuggingOverlayManager.m +0 -68
- package/React/Views/RCTModalHostView.h +0 -64
- package/React/Views/RCTModalHostView.m +0 -264
- package/React/Views/RCTModalHostViewController.m +0 -74
- package/React/Views/RCTModalHostViewManager.m +0 -131
- package/React/Views/RCTModalManager.h +0 -22
- package/React/Views/RCTModalManager.m +0 -46
- package/React/Views/RCTRootShadowView.h +0 -35
- package/React/Views/RCTRootShadowView.m +0 -53
- package/React/Views/RCTShadowView+Internal.h +0 -18
- package/React/Views/RCTShadowView+Internal.m +0 -23
- package/React/Views/RCTSwitch.h +0 -22
- package/React/Views/RCTSwitch.m +0 -24
- package/React/Views/RCTSwitchManager.h +0 -17
- package/React/Views/RCTSwitchManager.m +0 -70
- package/React/Views/RefreshControl/RCTRefreshControl.h +0 -24
- package/React/Views/RefreshControl/RCTRefreshControl.m +0 -230
- package/React/Views/RefreshControl/RCTRefreshControlManager.h +0 -17
- package/React/Views/RefreshControl/RCTRefreshControlManager.m +0 -47
- package/React/Views/SafeAreaView/RCTSafeAreaShadowView.h +0 -21
- package/React/Views/SafeAreaView/RCTSafeAreaShadowView.m +0 -57
- package/React/Views/SafeAreaView/RCTSafeAreaView.h +0 -27
- package/React/Views/SafeAreaView/RCTSafeAreaView.m +0 -79
- package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h +0 -25
- package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.m +0 -25
- package/React/Views/SafeAreaView/RCTSafeAreaViewManager.h +0 -21
- package/React/Views/SafeAreaView/RCTSafeAreaViewManager.m +0 -32
- package/React/Views/ScrollView/RCTScrollContentShadowView.h +0 -19
- package/React/Views/ScrollView/RCTScrollContentShadowView.m +0 -35
- package/React/Views/ScrollView/RCTScrollContentView.h +0 -19
- package/React/Views/ScrollView/RCTScrollContentView.m +0 -36
- package/React/Views/ScrollView/RCTScrollContentViewManager.h +0 -17
- package/React/Views/ScrollView/RCTScrollContentViewManager.m +0 -31
- package/React/Views/ScrollView/RCTScrollView.m +0 -1168
- package/React/Views/ScrollView/RCTScrollViewManager.h +0 -25
- package/React/Views/ScrollView/RCTScrollViewManager.m +0 -202
- package/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java +0 -251
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/BridgeReactContext.java +0 -315
- package/ReactAndroid/src/main/java/com/facebook/react/common/ClearableSynchronizedPool.kt +0 -51
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/AnimationBackendChoreographer.kt +0 -89
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.java +0 -736
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +0 -221
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java +0 -399
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactZIndexedViewGroup.kt +0 -35
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +0 -346
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +0 -666
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java +0 -147
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupDrawingOrderHelper.kt +0 -113
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java +0 -614
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +0 -1838
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.java +0 -1646
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +0 -1638
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaAlign.java +0 -51
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaBoxSizing.java +0 -33
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDimension.java +0 -33
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaDisplay.java +0 -37
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaEdge.java +0 -47
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaErrata.java +0 -41
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.java +0 -33
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaFlexDirection.java +0 -37
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGridTrackType.java +0 -39
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaGutter.java +0 -35
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaJustify.java +0 -49
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaLogLevel.java +0 -45
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaMeasureMode.java +0 -35
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeJNIBase.java +0 -928
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeType.java +0 -33
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaOverflow.java +0 -35
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaPositionType.java +0 -35
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaUnit.java +0 -43
- package/ReactAndroid/src/main/java/com/facebook/yoga/YogaWrap.java +0 -35
- package/ReactAndroid/src/main/jni/react/fabric/JAnimationBackendChoreographer.cpp +0 -23
- package/ReactAndroid/src/main/jni/react/fabric/JAnimationBackendChoreographer.h +0 -37
- package/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp +0 -135
- package/ReactCommon/cxxreact/JSIndexedRAMBundle.h +0 -72
- package/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.cpp +0 -143
- package/ReactCommon/hermes/inspector-modern/chrome/ConnectionDemux.h +0 -55
- package/ReactCommon/hermes/inspector-modern/chrome/Registration.cpp +0 -78
- package/ReactCommon/hermes/inspector-modern/chrome/Registration.h +0 -39
- package/ReactCommon/hermes/inspector-modern/chrome/tests/ConnectionDemuxTests.cpp +0 -148
- package/ReactCommon/react/nativemodule/samples/platform/android/NativeSampleTurboModuleSpec.java +0 -168
- package/ReactCommon/react/nativemodule/samples/platform/android/ReactCommon/SampleTurboModuleSpec.cpp +0 -416
- package/ReactCommon/react/nativemodule/samples/platform/android/ReactCommon/SampleTurboModuleSpec.h +0 -31
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTNativeSampleTurboModuleSpec.h +0 -134
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTNativeSampleTurboModuleSpec.mm +0 -290
- package/ReactCommon/react/renderer/core/RawPropsKey.cpp +0 -62
- package/ReactCommon/react/renderer/core/RawPropsKey.h +0 -39
- package/ReactCommon/react/renderer/mounting/internal/DiffMap.h +0 -170
- package/ReactCommon/react/renderer/mounting/internal/LongestIncreasingSubsequence.h +0 -95
- package/ReactCommon/react/renderer/mounting/internal/TinyMap.h +0 -147
- package/ReactCommon/react/renderer/mounting/tests/LongestIncreasingSubsequenceTest.cpp +0 -154
- package/interface.js +0 -21
- package/jest-preset.js +0 -26
- package/rn-get-polyfills.js +0 -13
- package/sdks/.hermesversion +0 -1
- package/src/private/components/virtualcollection/debug/FlingItemOverlay.js +0 -13
- package/types/tsconfig.json +0 -15
- package/types_generated/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.d.ts +0 -14
- package/types_generated/Libraries/Components/ScrollView/ScrollViewNativeComponent.d.ts +0 -21
- package/types_generated/Libraries/Components/ScrollView/ScrollViewNativeComponentType.d.ts +0 -134
- package/types_generated/Libraries/Components/Switch/AndroidSwitchNativeComponent.d.ts +0 -14
- package/types_generated/Libraries/Components/Switch/SwitchNativeComponent.d.ts +0 -14
- package/types_generated/Libraries/Components/Touchable/Touchable.d.ts +0 -262
- package/types_generated/Libraries/Interaction/InteractionManager.d.ts +0 -117
- package/types_generated/Libraries/NativeModules/specs/NativeDialogManagerAndroid.d.ts +0 -17
- package/types_generated/src/private/specs_DEPRECATED/components/AndroidSwitchNativeComponent.d.ts +0 -53
- package/types_generated/src/private/specs_DEPRECATED/components/ProgressBarAndroidNativeComponent.d.ts +0 -36
- package/types_generated/src/private/specs_DEPRECATED/components/SwitchNativeComponent.d.ts +0 -51
- package/types_generated/src/private/specs_DEPRECATED/modules/NativeDialogManagerAndroid.d.ts +0 -37
- package/types_generated/tsconfig.test.json +0 -16
- /package/ReactCommon/{cxxreact → react/utils}/MoveWrapper.h +0 -0
package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java
DELETED
|
@@ -1,1838 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
package com.facebook.react.views.scroll;
|
|
9
|
-
|
|
10
|
-
import static com.facebook.react.views.scroll.ReactScrollViewHelper.SNAP_ALIGNMENT_CENTER;
|
|
11
|
-
import static com.facebook.react.views.scroll.ReactScrollViewHelper.SNAP_ALIGNMENT_DISABLED;
|
|
12
|
-
import static com.facebook.react.views.scroll.ReactScrollViewHelper.SNAP_ALIGNMENT_END;
|
|
13
|
-
import static com.facebook.react.views.scroll.ReactScrollViewHelper.SNAP_ALIGNMENT_START;
|
|
14
|
-
import static com.facebook.react.views.scroll.ReactScrollViewHelper.findNextFocusableView;
|
|
15
|
-
|
|
16
|
-
import android.animation.ObjectAnimator;
|
|
17
|
-
import android.animation.ValueAnimator;
|
|
18
|
-
import android.content.Context;
|
|
19
|
-
import android.graphics.Canvas;
|
|
20
|
-
import android.graphics.Color;
|
|
21
|
-
import android.graphics.Point;
|
|
22
|
-
import android.graphics.Rect;
|
|
23
|
-
import android.graphics.drawable.ColorDrawable;
|
|
24
|
-
import android.graphics.drawable.Drawable;
|
|
25
|
-
import android.os.Build;
|
|
26
|
-
import android.view.FocusFinder;
|
|
27
|
-
import android.view.KeyEvent;
|
|
28
|
-
import android.view.MotionEvent;
|
|
29
|
-
import android.view.View;
|
|
30
|
-
import android.view.ViewGroup;
|
|
31
|
-
import android.view.ViewParent;
|
|
32
|
-
import android.view.accessibility.AccessibilityNodeInfo;
|
|
33
|
-
import android.widget.HorizontalScrollView;
|
|
34
|
-
import android.widget.OverScroller;
|
|
35
|
-
import androidx.annotation.Nullable;
|
|
36
|
-
import androidx.core.view.ViewCompat;
|
|
37
|
-
import androidx.core.view.ViewCompat.FocusDirection;
|
|
38
|
-
import com.facebook.common.logging.FLog;
|
|
39
|
-
import com.facebook.infer.annotation.Assertions;
|
|
40
|
-
import com.facebook.infer.annotation.Nullsafe;
|
|
41
|
-
import com.facebook.react.R;
|
|
42
|
-
import com.facebook.react.common.ReactConstants;
|
|
43
|
-
import com.facebook.react.common.build.ReactBuildConfig;
|
|
44
|
-
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags;
|
|
45
|
-
import com.facebook.react.uimanager.BackgroundStyleApplicator;
|
|
46
|
-
import com.facebook.react.uimanager.LengthPercentage;
|
|
47
|
-
import com.facebook.react.uimanager.LengthPercentageType;
|
|
48
|
-
import com.facebook.react.uimanager.MeasureSpecAssertions;
|
|
49
|
-
import com.facebook.react.uimanager.PixelUtil;
|
|
50
|
-
import com.facebook.react.uimanager.PointerEvents;
|
|
51
|
-
import com.facebook.react.uimanager.ReactClippingViewGroup;
|
|
52
|
-
import com.facebook.react.uimanager.ReactClippingViewGroupHelper;
|
|
53
|
-
import com.facebook.react.uimanager.ReactOverflowViewWithInset;
|
|
54
|
-
import com.facebook.react.uimanager.StateWrapper;
|
|
55
|
-
import com.facebook.react.uimanager.events.NativeGestureUtil;
|
|
56
|
-
import com.facebook.react.uimanager.style.BorderRadiusProp;
|
|
57
|
-
import com.facebook.react.uimanager.style.BorderStyle;
|
|
58
|
-
import com.facebook.react.uimanager.style.LogicalEdge;
|
|
59
|
-
import com.facebook.react.uimanager.style.Overflow;
|
|
60
|
-
import com.facebook.react.views.scroll.ReactScrollViewHelper.HasFlingAnimator;
|
|
61
|
-
import com.facebook.react.views.scroll.ReactScrollViewHelper.HasScrollEventThrottle;
|
|
62
|
-
import com.facebook.react.views.scroll.ReactScrollViewHelper.HasScrollState;
|
|
63
|
-
import com.facebook.react.views.scroll.ReactScrollViewHelper.HasSmoothScroll;
|
|
64
|
-
import com.facebook.react.views.scroll.ReactScrollViewHelper.HasStateWrapper;
|
|
65
|
-
import com.facebook.react.views.scroll.ReactScrollViewHelper.ReactScrollViewScrollState;
|
|
66
|
-
import com.facebook.systrace.Systrace;
|
|
67
|
-
import java.lang.reflect.Field;
|
|
68
|
-
import java.util.ArrayList;
|
|
69
|
-
import java.util.List;
|
|
70
|
-
import java.util.Set;
|
|
71
|
-
|
|
72
|
-
/** Similar to {@link ReactScrollView} but only supports horizontal scrolling. */
|
|
73
|
-
@Nullsafe(Nullsafe.Mode.LOCAL)
|
|
74
|
-
public class ReactHorizontalScrollView extends HorizontalScrollView
|
|
75
|
-
implements ReactClippingViewGroup,
|
|
76
|
-
ViewGroup.OnHierarchyChangeListener,
|
|
77
|
-
View.OnLayoutChangeListener,
|
|
78
|
-
ReactAccessibleScrollView,
|
|
79
|
-
ReactOverflowViewWithInset,
|
|
80
|
-
HasScrollState,
|
|
81
|
-
HasStateWrapper,
|
|
82
|
-
HasFlingAnimator,
|
|
83
|
-
HasScrollEventThrottle,
|
|
84
|
-
HasSmoothScroll,
|
|
85
|
-
VirtualViewContainer {
|
|
86
|
-
|
|
87
|
-
private static final boolean DEBUG_MODE = false && ReactBuildConfig.DEBUG;
|
|
88
|
-
private static final String TAG = ReactHorizontalScrollView.class.getSimpleName();
|
|
89
|
-
|
|
90
|
-
private static final int NO_SCROLL_POSITION = Integer.MIN_VALUE;
|
|
91
|
-
|
|
92
|
-
private static @Nullable Field sScrollerField;
|
|
93
|
-
private static boolean sTriedToGetScrollerField = false;
|
|
94
|
-
|
|
95
|
-
private int mScrollXAfterMeasure = NO_SCROLL_POSITION;
|
|
96
|
-
|
|
97
|
-
private static final int UNSET_CONTENT_OFFSET = -1;
|
|
98
|
-
|
|
99
|
-
private final OnScrollDispatchHelper mOnScrollDispatchHelper = new OnScrollDispatchHelper();
|
|
100
|
-
private final @Nullable OverScroller mScroller;
|
|
101
|
-
private final VelocityHelper mVelocityHelper = new VelocityHelper();
|
|
102
|
-
private final Rect mTempRect = new Rect();
|
|
103
|
-
private final ValueAnimator DEFAULT_FLING_ANIMATOR = ObjectAnimator.ofInt(this, "scrollX", 0, 0);
|
|
104
|
-
private final @Nullable FpsListener mFpsListener;
|
|
105
|
-
|
|
106
|
-
private Rect mOverflowInset = new Rect();
|
|
107
|
-
private @Nullable VirtualViewContainerState mVirtualViewContainerState;
|
|
108
|
-
private boolean mActivelyScrolling;
|
|
109
|
-
private @Nullable Rect mClippingRect;
|
|
110
|
-
private Overflow mOverflow = Overflow.SCROLL;
|
|
111
|
-
private boolean mDragging;
|
|
112
|
-
private boolean mPagingEnabled = false;
|
|
113
|
-
private @Nullable Runnable mPostTouchRunnable;
|
|
114
|
-
private boolean mRemoveClippedSubviews;
|
|
115
|
-
private boolean mScrollEnabled = true;
|
|
116
|
-
private boolean mSendMomentumEvents;
|
|
117
|
-
private @Nullable String mScrollPerfTag;
|
|
118
|
-
private @Nullable Drawable mEndBackground;
|
|
119
|
-
private int mEndFillColor = Color.TRANSPARENT;
|
|
120
|
-
private boolean mDisableIntervalMomentum = false;
|
|
121
|
-
private int mSnapInterval = 0;
|
|
122
|
-
private @Nullable List<Integer> mSnapOffsets;
|
|
123
|
-
private boolean mSnapToStart = true;
|
|
124
|
-
private boolean mSnapToEnd = true;
|
|
125
|
-
private int mSnapToAlignment = SNAP_ALIGNMENT_DISABLED;
|
|
126
|
-
private boolean mPagedArrowScrolling = false;
|
|
127
|
-
private int mPendingContentOffsetX = UNSET_CONTENT_OFFSET;
|
|
128
|
-
private int mPendingContentOffsetY = UNSET_CONTENT_OFFSET;
|
|
129
|
-
private @Nullable StateWrapper mStateWrapper = null;
|
|
130
|
-
private ReactScrollViewScrollState mReactScrollViewScrollState;
|
|
131
|
-
private PointerEvents mPointerEvents = PointerEvents.AUTO;
|
|
132
|
-
private long mLastScrollDispatchTime = 0;
|
|
133
|
-
private int mScrollEventThrottle = 0;
|
|
134
|
-
private @Nullable View mContentView;
|
|
135
|
-
private @Nullable MaintainVisibleScrollPositionHelper mMaintainVisibleContentPositionHelper;
|
|
136
|
-
private int mFadingEdgeLengthStart = 0;
|
|
137
|
-
private int mFadingEdgeLengthEnd = 0;
|
|
138
|
-
private boolean mEmittedOverScrollSinceScrollBegin = false;
|
|
139
|
-
private boolean mScrollsChildToFocus = true;
|
|
140
|
-
|
|
141
|
-
public ReactHorizontalScrollView(Context context) {
|
|
142
|
-
this(context, null);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
public ReactHorizontalScrollView(Context context, @Nullable FpsListener fpsListener) {
|
|
146
|
-
super(context);
|
|
147
|
-
mFpsListener = fpsListener;
|
|
148
|
-
|
|
149
|
-
ViewCompat.setAccessibilityDelegate(this, new ReactScrollViewAccessibilityDelegate());
|
|
150
|
-
|
|
151
|
-
mScroller = getOverScrollerFromParent();
|
|
152
|
-
|
|
153
|
-
setOnHierarchyChangeListener(this);
|
|
154
|
-
setClipChildren(false);
|
|
155
|
-
initView();
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Set all default values here as opposed to in the constructor or field defaults. It is important
|
|
160
|
-
* that these properties are set during the constructor, but also on-demand whenever an existing
|
|
161
|
-
* ReactHorizontalScrollView is recycled.
|
|
162
|
-
*/
|
|
163
|
-
private void initView() {
|
|
164
|
-
mOverflowInset = new Rect();
|
|
165
|
-
mVirtualViewContainerState = null;
|
|
166
|
-
mActivelyScrolling = false;
|
|
167
|
-
mClippingRect = null;
|
|
168
|
-
// The default value for `overflow` is set to `Visible` in the Yoga style props.
|
|
169
|
-
mOverflow =
|
|
170
|
-
ReactNativeFeatureFlags.enablePropsUpdateReconciliationAndroid()
|
|
171
|
-
? Overflow.VISIBLE
|
|
172
|
-
: Overflow.SCROLL;
|
|
173
|
-
|
|
174
|
-
mDragging = false;
|
|
175
|
-
mPagingEnabled = false;
|
|
176
|
-
mPostTouchRunnable = null;
|
|
177
|
-
mRemoveClippedSubviews = false;
|
|
178
|
-
mScrollEnabled = true;
|
|
179
|
-
mSendMomentumEvents = false;
|
|
180
|
-
mScrollPerfTag = null;
|
|
181
|
-
mEndBackground = null;
|
|
182
|
-
mEndFillColor = Color.TRANSPARENT;
|
|
183
|
-
mDisableIntervalMomentum = false;
|
|
184
|
-
mSnapInterval = 0;
|
|
185
|
-
mSnapOffsets = null;
|
|
186
|
-
mSnapToStart = true;
|
|
187
|
-
mSnapToEnd = true;
|
|
188
|
-
mSnapToAlignment = SNAP_ALIGNMENT_DISABLED;
|
|
189
|
-
mPagedArrowScrolling = false;
|
|
190
|
-
mPendingContentOffsetX = UNSET_CONTENT_OFFSET;
|
|
191
|
-
mPendingContentOffsetY = UNSET_CONTENT_OFFSET;
|
|
192
|
-
mStateWrapper = null;
|
|
193
|
-
mReactScrollViewScrollState = new ReactScrollViewScrollState();
|
|
194
|
-
|
|
195
|
-
mPointerEvents = PointerEvents.AUTO;
|
|
196
|
-
mLastScrollDispatchTime = 0;
|
|
197
|
-
mScrollEventThrottle = 0;
|
|
198
|
-
mContentView = null;
|
|
199
|
-
mMaintainVisibleContentPositionHelper = null;
|
|
200
|
-
mFadingEdgeLengthStart = 0;
|
|
201
|
-
mFadingEdgeLengthEnd = 0;
|
|
202
|
-
mScrollsChildToFocus = true;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/* package */ void recycleView() {
|
|
206
|
-
// Set default field values
|
|
207
|
-
initView();
|
|
208
|
-
|
|
209
|
-
// If the view is still attached to a parent, we need to remove it from the parent
|
|
210
|
-
// before we can recycle it.
|
|
211
|
-
if (getParent() != null) {
|
|
212
|
-
((ViewGroup) getParent()).removeView(this);
|
|
213
|
-
}
|
|
214
|
-
updateView();
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
private void updateView() {}
|
|
218
|
-
|
|
219
|
-
@Override
|
|
220
|
-
public VirtualViewContainerState getVirtualViewContainerState() {
|
|
221
|
-
if (mVirtualViewContainerState == null) {
|
|
222
|
-
mVirtualViewContainerState = VirtualViewContainerState.create(this);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
return mVirtualViewContainerState;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
@Override
|
|
229
|
-
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
|
|
230
|
-
super.onInitializeAccessibilityNodeInfo(info);
|
|
231
|
-
|
|
232
|
-
// Expose the testID prop as the resource-id name of the view. Black-box E2E/UI testing
|
|
233
|
-
// frameworks, which interact with the UI through the accessibility framework, do not have
|
|
234
|
-
// access to view tags. This allows developers/testers to avoid polluting the
|
|
235
|
-
// content-description with test identifiers.
|
|
236
|
-
final String testId = (String) this.getTag(R.id.react_test_id);
|
|
237
|
-
if (testId != null) {
|
|
238
|
-
info.setViewIdResourceName(testId);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
@Override
|
|
243
|
-
public boolean getScrollEnabled() {
|
|
244
|
-
return mScrollEnabled;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
@Override
|
|
248
|
-
public boolean canScrollHorizontally(int direction) {
|
|
249
|
-
return mScrollEnabled && super.canScrollHorizontally(direction);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
@Nullable
|
|
253
|
-
private OverScroller getOverScrollerFromParent() {
|
|
254
|
-
OverScroller scroller;
|
|
255
|
-
|
|
256
|
-
if (!sTriedToGetScrollerField) {
|
|
257
|
-
sTriedToGetScrollerField = true;
|
|
258
|
-
try {
|
|
259
|
-
sScrollerField = HorizontalScrollView.class.getDeclaredField("mScroller");
|
|
260
|
-
sScrollerField.setAccessible(true);
|
|
261
|
-
} catch (NoSuchFieldException e) {
|
|
262
|
-
FLog.w(
|
|
263
|
-
TAG,
|
|
264
|
-
"Failed to get mScroller field for HorizontalScrollView! "
|
|
265
|
-
+ "This app will exhibit the bounce-back scrolling bug :(");
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
if (sScrollerField != null) {
|
|
270
|
-
try {
|
|
271
|
-
Object scrollerValue = sScrollerField.get(this);
|
|
272
|
-
if (scrollerValue instanceof OverScroller) {
|
|
273
|
-
scroller = (OverScroller) scrollerValue;
|
|
274
|
-
} else {
|
|
275
|
-
FLog.w(
|
|
276
|
-
TAG,
|
|
277
|
-
"Failed to cast mScroller field in HorizontalScrollView (probably due to OEM changes"
|
|
278
|
-
+ " to AOSP)! This app will exhibit the bounce-back scrolling bug :(");
|
|
279
|
-
scroller = null;
|
|
280
|
-
}
|
|
281
|
-
} catch (IllegalAccessException e) {
|
|
282
|
-
throw new RuntimeException("Failed to get mScroller from HorizontalScrollView!", e);
|
|
283
|
-
}
|
|
284
|
-
} else {
|
|
285
|
-
scroller = null;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
return scroller;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
public void setScrollPerfTag(@Nullable String scrollPerfTag) {
|
|
292
|
-
mScrollPerfTag = scrollPerfTag;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
@Override
|
|
296
|
-
public void setRemoveClippedSubviews(boolean removeClippedSubviews) {
|
|
297
|
-
if (ReactNativeFeatureFlags.disableSubviewClippingAndroid()) {
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
if (removeClippedSubviews && mClippingRect == null) {
|
|
302
|
-
mClippingRect = new Rect();
|
|
303
|
-
}
|
|
304
|
-
mRemoveClippedSubviews = removeClippedSubviews;
|
|
305
|
-
updateClippingRect();
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
@Override
|
|
309
|
-
public boolean getRemoveClippedSubviews() {
|
|
310
|
-
return mRemoveClippedSubviews;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
public void setDisableIntervalMomentum(boolean disableIntervalMomentum) {
|
|
314
|
-
mDisableIntervalMomentum = disableIntervalMomentum;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
public void setSendMomentumEvents(boolean sendMomentumEvents) {
|
|
318
|
-
mSendMomentumEvents = sendMomentumEvents;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
public void setScrollEnabled(boolean scrollEnabled) {
|
|
322
|
-
mScrollEnabled = scrollEnabled;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
public void setPagingEnabled(boolean pagingEnabled) {
|
|
326
|
-
mPagingEnabled = pagingEnabled;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
public void setScrollsChildToFocus(boolean scrollsChildToFocus) {
|
|
330
|
-
mScrollsChildToFocus = scrollsChildToFocus;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
public void setDecelerationRate(float decelerationRate) {
|
|
334
|
-
getReactScrollViewScrollState().setDecelerationRate(decelerationRate);
|
|
335
|
-
|
|
336
|
-
if (mScroller != null) {
|
|
337
|
-
mScroller.setFriction(1.0f - decelerationRate);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
public void abortAnimation() {
|
|
342
|
-
if (mScroller != null && !mScroller.isFinished()) {
|
|
343
|
-
mScroller.abortAnimation();
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
public void setSnapInterval(int snapInterval) {
|
|
348
|
-
mSnapInterval = snapInterval;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
public void setSnapOffsets(@Nullable List<Integer> snapOffsets) {
|
|
352
|
-
mSnapOffsets = snapOffsets;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
public void setSnapToStart(boolean snapToStart) {
|
|
356
|
-
mSnapToStart = snapToStart;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
public void setSnapToEnd(boolean snapToEnd) {
|
|
360
|
-
mSnapToEnd = snapToEnd;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
public void setSnapToAlignment(int snapToAlignment) {
|
|
364
|
-
mSnapToAlignment = snapToAlignment;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
public void flashScrollIndicators() {
|
|
368
|
-
awakenScrollBars();
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
public int getFadingEdgeLengthStart() {
|
|
372
|
-
return mFadingEdgeLengthStart;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
public int getFadingEdgeLengthEnd() {
|
|
376
|
-
return mFadingEdgeLengthEnd;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
public void setFadingEdgeLengthStart(int start) {
|
|
380
|
-
mFadingEdgeLengthStart = start;
|
|
381
|
-
invalidate();
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
public void setFadingEdgeLengthEnd(int end) {
|
|
385
|
-
mFadingEdgeLengthEnd = end;
|
|
386
|
-
invalidate();
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
@Override
|
|
390
|
-
protected float getLeftFadingEdgeStrength() {
|
|
391
|
-
float max = Math.max(mFadingEdgeLengthStart, mFadingEdgeLengthEnd);
|
|
392
|
-
int value =
|
|
393
|
-
getLayoutDirection() == LAYOUT_DIRECTION_RTL
|
|
394
|
-
? mFadingEdgeLengthEnd
|
|
395
|
-
: mFadingEdgeLengthStart;
|
|
396
|
-
return (value / max);
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
@Override
|
|
400
|
-
protected float getRightFadingEdgeStrength() {
|
|
401
|
-
float max = Math.max(mFadingEdgeLengthStart, mFadingEdgeLengthEnd);
|
|
402
|
-
int value =
|
|
403
|
-
getLayoutDirection() == LAYOUT_DIRECTION_RTL
|
|
404
|
-
? mFadingEdgeLengthStart
|
|
405
|
-
: mFadingEdgeLengthEnd;
|
|
406
|
-
return (value / max);
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
public void setOverflow(@Nullable String overflow) {
|
|
410
|
-
if (overflow == null) {
|
|
411
|
-
mOverflow = Overflow.SCROLL;
|
|
412
|
-
} else {
|
|
413
|
-
@Nullable Overflow parsedOverflow = Overflow.fromString(overflow);
|
|
414
|
-
mOverflow =
|
|
415
|
-
parsedOverflow == null
|
|
416
|
-
? (ReactNativeFeatureFlags.enablePropsUpdateReconciliationAndroid()
|
|
417
|
-
? Overflow.VISIBLE
|
|
418
|
-
: Overflow.SCROLL)
|
|
419
|
-
: parsedOverflow;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
invalidate();
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
public void setMaintainVisibleContentPosition(
|
|
426
|
-
@Nullable MaintainVisibleScrollPositionHelper.Config config) {
|
|
427
|
-
if (config != null && mMaintainVisibleContentPositionHelper == null) {
|
|
428
|
-
mMaintainVisibleContentPositionHelper = new MaintainVisibleScrollPositionHelper(this, true);
|
|
429
|
-
mMaintainVisibleContentPositionHelper.start();
|
|
430
|
-
} else if (config == null && mMaintainVisibleContentPositionHelper != null) {
|
|
431
|
-
mMaintainVisibleContentPositionHelper.stop();
|
|
432
|
-
mMaintainVisibleContentPositionHelper = null;
|
|
433
|
-
}
|
|
434
|
-
if (mMaintainVisibleContentPositionHelper != null) {
|
|
435
|
-
mMaintainVisibleContentPositionHelper.setConfig(config);
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
@Override
|
|
440
|
-
public @Nullable String getOverflow() {
|
|
441
|
-
switch (mOverflow) {
|
|
442
|
-
case HIDDEN:
|
|
443
|
-
return "hidden";
|
|
444
|
-
case SCROLL:
|
|
445
|
-
return "scroll";
|
|
446
|
-
case VISIBLE:
|
|
447
|
-
return "visible";
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
return null;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
@Override
|
|
454
|
-
public void setOverflowInset(int left, int top, int right, int bottom) {
|
|
455
|
-
mOverflowInset.set(left, top, right, bottom);
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
@Override
|
|
459
|
-
public Rect getOverflowInset() {
|
|
460
|
-
return mOverflowInset;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
@Override
|
|
464
|
-
public void onDraw(Canvas canvas) {
|
|
465
|
-
if (mOverflow != Overflow.VISIBLE) {
|
|
466
|
-
BackgroundStyleApplicator.clipToPaddingBox(this, canvas);
|
|
467
|
-
}
|
|
468
|
-
super.onDraw(canvas);
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
@Override
|
|
472
|
-
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
|
473
|
-
MeasureSpecAssertions.assertExplicitMeasureSpec(widthMeasureSpec, heightMeasureSpec);
|
|
474
|
-
|
|
475
|
-
int measuredWidth = MeasureSpec.getSize(widthMeasureSpec);
|
|
476
|
-
int measuredHeight = MeasureSpec.getSize(heightMeasureSpec);
|
|
477
|
-
|
|
478
|
-
if (DEBUG_MODE) {
|
|
479
|
-
FLog.i(
|
|
480
|
-
TAG,
|
|
481
|
-
"onMeasure[%d] measured width: %d measured height: %d",
|
|
482
|
-
getId(),
|
|
483
|
-
measuredWidth,
|
|
484
|
-
measuredHeight);
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
boolean measuredHeightChanged = getMeasuredHeight() != measuredHeight;
|
|
488
|
-
|
|
489
|
-
setMeasuredDimension(measuredWidth, measuredHeight);
|
|
490
|
-
|
|
491
|
-
// See how `mScrollXAfterMeasure` is used in `onLayout`, and why we only enable the
|
|
492
|
-
// hack if the height has changed.
|
|
493
|
-
if (measuredHeightChanged && mScroller != null) {
|
|
494
|
-
mScrollXAfterMeasure = mScroller.getCurrX();
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
@Override
|
|
499
|
-
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
|
500
|
-
if (DEBUG_MODE) {
|
|
501
|
-
FLog.i(TAG, "onLayout[%d] l %d t %d r %d b %d", getId(), l, t, r, b);
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
// Has the scrollX changed between the last onMeasure and this layout?
|
|
505
|
-
// If so, cancel the animation.
|
|
506
|
-
// Essentially, if the height changes (due to keyboard popping up, for instance) the
|
|
507
|
-
// underlying View.layout method will in some cases scroll to an incorrect X position -
|
|
508
|
-
// see also the hacks in `fling`. The order of layout is called in the order of: onMeasure,
|
|
509
|
-
// layout, onLayout.
|
|
510
|
-
// We cannot override `layout` but we can detect the sequence of events between onMeasure
|
|
511
|
-
// and onLayout.
|
|
512
|
-
if (mScrollXAfterMeasure != NO_SCROLL_POSITION
|
|
513
|
-
&& mScroller != null
|
|
514
|
-
&& mScrollXAfterMeasure != mScroller.getFinalX()
|
|
515
|
-
&& !mScroller.isFinished()) {
|
|
516
|
-
if (DEBUG_MODE) {
|
|
517
|
-
FLog.i(
|
|
518
|
-
TAG,
|
|
519
|
-
"onLayout[%d] scroll hack enabled: reset to previous scrollX position of %d",
|
|
520
|
-
getId(),
|
|
521
|
-
mScrollXAfterMeasure);
|
|
522
|
-
}
|
|
523
|
-
mScroller.startScroll(mScrollXAfterMeasure, mScroller.getFinalY(), 0, 0);
|
|
524
|
-
mScroller.forceFinished(true);
|
|
525
|
-
mScrollXAfterMeasure = NO_SCROLL_POSITION;
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
// Apply pending contentOffset in case it was set before the view was laid out.
|
|
529
|
-
if (isContentReady()) {
|
|
530
|
-
// If a "pending" content offset value has been set, we restore that value.
|
|
531
|
-
// Upon call to scrollTo, the "pending" values will be re-set.
|
|
532
|
-
int scrollToX =
|
|
533
|
-
mPendingContentOffsetX != UNSET_CONTENT_OFFSET ? mPendingContentOffsetX : getScrollX();
|
|
534
|
-
int scrollToY =
|
|
535
|
-
mPendingContentOffsetY != UNSET_CONTENT_OFFSET ? mPendingContentOffsetY : getScrollY();
|
|
536
|
-
scrollTo(scrollToX, scrollToY);
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
ReactScrollViewHelper.emitLayoutEvent(this);
|
|
540
|
-
if (mVirtualViewContainerState != null) {
|
|
541
|
-
mVirtualViewContainerState.updateState();
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
/**
|
|
546
|
-
* Since ReactHorizontalScrollView handles layout changes on JS side, it does not call
|
|
547
|
-
* super.onLayout due to which mIsLayoutDirty flag in HorizontalScrollView remains true and
|
|
548
|
-
* prevents scrolling to child when requestChildFocus is called. Overriding this method and
|
|
549
|
-
* scrolling to child without checking any layout dirty flag. This will fix focus navigation issue
|
|
550
|
-
* for KeyEvents which are not handled in HorizontalScrollView, for example: KEYCODE_TAB.
|
|
551
|
-
*/
|
|
552
|
-
@Override
|
|
553
|
-
public void requestChildFocus(View child, View focused) {
|
|
554
|
-
if (focused != null && !mPagingEnabled && mScrollsChildToFocus) {
|
|
555
|
-
scrollToChild(focused);
|
|
556
|
-
}
|
|
557
|
-
requestChildFocusWithoutScroll(child, focused);
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
/**
|
|
561
|
-
* In rare cases where an app overrides the built-in ReactScrollView by overriding it, and also
|
|
562
|
-
* needs to customize scroll into view on focus behaviors, this protected method can be used to
|
|
563
|
-
* unblock such customization.
|
|
564
|
-
*/
|
|
565
|
-
protected void requestChildFocusWithoutScroll(View child, View focused) {
|
|
566
|
-
super.requestChildFocus(child, focused);
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
@Override
|
|
570
|
-
public boolean requestChildRectangleOnScreen(View child, Rect rectangle, boolean immediate) {
|
|
571
|
-
if (!mScrollsChildToFocus) {
|
|
572
|
-
return false;
|
|
573
|
-
}
|
|
574
|
-
return super.requestChildRectangleOnScreen(child, rectangle, immediate);
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
@Override
|
|
578
|
-
public void addFocusables(ArrayList<View> views, int direction, int focusableMode) {
|
|
579
|
-
if (mPagingEnabled && !mPagedArrowScrolling) {
|
|
580
|
-
// Only add elements within the current page to list of focusables
|
|
581
|
-
ArrayList<View> candidateViews = new ArrayList<View>();
|
|
582
|
-
super.addFocusables(candidateViews, direction, focusableMode);
|
|
583
|
-
for (View candidate : candidateViews) {
|
|
584
|
-
// We must also include the currently focused in the focusables list or focus search will
|
|
585
|
-
// always
|
|
586
|
-
// return the first element within the focusables list
|
|
587
|
-
if (isScrolledInView(candidate)
|
|
588
|
-
|| isPartiallyScrolledInView(candidate)
|
|
589
|
-
|| candidate.isFocused()) {
|
|
590
|
-
views.add(candidate);
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
} else {
|
|
594
|
-
super.addFocusables(views, direction, focusableMode);
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
/** Calculates the x delta required to scroll the given descendent into view */
|
|
599
|
-
private int getScrollDelta(View descendent) {
|
|
600
|
-
descendent.getDrawingRect(mTempRect);
|
|
601
|
-
offsetDescendantRectToMyCoords(descendent, mTempRect);
|
|
602
|
-
return computeScrollDeltaToGetChildRectOnScreen(mTempRect);
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
/** Returns whether the given descendent is scrolled fully in view */
|
|
606
|
-
private boolean isScrolledInView(View descendent) {
|
|
607
|
-
return getScrollDelta(descendent) == 0;
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
/** Returns whether the given descendent is partially scrolled in view */
|
|
611
|
-
@Override
|
|
612
|
-
public boolean isPartiallyScrolledInView(View descendent) {
|
|
613
|
-
int scrollDelta = getScrollDelta(descendent);
|
|
614
|
-
descendent.getDrawingRect(mTempRect);
|
|
615
|
-
return scrollDelta != 0 && Math.abs(scrollDelta) < mTempRect.width();
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
/** Returns whether the given descendent is "mostly" (>50%) scrolled in view */
|
|
619
|
-
private boolean isMostlyScrolledInView(View descendent) {
|
|
620
|
-
int scrollDelta = getScrollDelta(descendent);
|
|
621
|
-
descendent.getDrawingRect(mTempRect);
|
|
622
|
-
return scrollDelta != 0 && Math.abs(scrollDelta) < (mTempRect.width() / 2);
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
private void scrollToChild(View child) {
|
|
626
|
-
int scrollDelta = getScrollDelta(child);
|
|
627
|
-
|
|
628
|
-
if (scrollDelta != 0) {
|
|
629
|
-
scrollBy(scrollDelta, 0);
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
@Override
|
|
634
|
-
protected void onScrollChanged(int x, int y, int oldX, int oldY) {
|
|
635
|
-
if (DEBUG_MODE) {
|
|
636
|
-
FLog.i(TAG, "onScrollChanged[%d] x %d y %d oldx %d oldy %d", getId(), x, y, oldX, oldY);
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
Systrace.beginSection(Systrace.TRACE_TAG_REACT, "ReactHorizontalScrollView.onScrollChanged");
|
|
640
|
-
try {
|
|
641
|
-
super.onScrollChanged(x, y, oldX, oldY);
|
|
642
|
-
|
|
643
|
-
mActivelyScrolling = true;
|
|
644
|
-
|
|
645
|
-
if (mOnScrollDispatchHelper.onScrollChanged(x, y)) {
|
|
646
|
-
if (mRemoveClippedSubviews) {
|
|
647
|
-
updateClippingRect();
|
|
648
|
-
}
|
|
649
|
-
ReactScrollViewHelper.updateStateOnScrollChanged(
|
|
650
|
-
this,
|
|
651
|
-
mOnScrollDispatchHelper.getXFlingVelocity(),
|
|
652
|
-
mOnScrollDispatchHelper.getYFlingVelocity());
|
|
653
|
-
if (mVirtualViewContainerState != null) {
|
|
654
|
-
mVirtualViewContainerState.updateState();
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
} finally {
|
|
659
|
-
Systrace.endSection(Systrace.TRACE_TAG_REACT);
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
@Nullable
|
|
664
|
-
private static HorizontalScrollView findDeepestScrollViewForMotionEvent(
|
|
665
|
-
View view, MotionEvent ev) {
|
|
666
|
-
return findDeepestScrollViewForMotionEvent(view, ev, true);
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
@Nullable
|
|
670
|
-
private static HorizontalScrollView findDeepestScrollViewForMotionEvent(
|
|
671
|
-
View view, MotionEvent ev, boolean skipInitialView) {
|
|
672
|
-
if (view == null) {
|
|
673
|
-
return null;
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
Rect rectOnScreen = new Rect();
|
|
677
|
-
view.getGlobalVisibleRect(rectOnScreen);
|
|
678
|
-
if (!rectOnScreen.contains((int) ev.getRawX(), (int) ev.getRawY())) {
|
|
679
|
-
return null;
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
// Only consider the current view if it's not the initial view. We check the
|
|
683
|
-
// current view first to bail out of recursion. Essentially if there's any
|
|
684
|
-
// nested horizontal scrollview with nested scrolling enabled, the parent
|
|
685
|
-
// scroll view shouldn't pick up the down event.
|
|
686
|
-
if (!skipInitialView
|
|
687
|
-
&& view instanceof HorizontalScrollView
|
|
688
|
-
&& ViewCompat.isNestedScrollingEnabled(view)
|
|
689
|
-
&& (view instanceof ReactHorizontalScrollView
|
|
690
|
-
&& ((ReactHorizontalScrollView) view).mScrollEnabled)) {
|
|
691
|
-
return (HorizontalScrollView) view;
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
// First, check child views recursively before considering this view.
|
|
695
|
-
if (view instanceof ViewGroup) {
|
|
696
|
-
for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
|
|
697
|
-
HorizontalScrollView foundScrollView =
|
|
698
|
-
findDeepestScrollViewForMotionEvent(((ViewGroup) view).getChildAt(i), ev, false);
|
|
699
|
-
|
|
700
|
-
if (foundScrollView != null) {
|
|
701
|
-
// If a deeper HorizontalScrollView is found in child views, return it.
|
|
702
|
-
return foundScrollView;
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
// Return null if no matching view is found.
|
|
708
|
-
return null;
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
@Override
|
|
712
|
-
public boolean onInterceptTouchEvent(MotionEvent ev) {
|
|
713
|
-
if (!mScrollEnabled) {
|
|
714
|
-
return false;
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
if ((ev.getAction() == MotionEvent.ACTION_DOWN)
|
|
718
|
-
&& findDeepestScrollViewForMotionEvent(this, ev) != null) {
|
|
719
|
-
return false;
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
// We intercept the touch event if the children are not supposed to receive it.
|
|
723
|
-
if (!PointerEvents.canChildrenBeTouchTarget(mPointerEvents)) {
|
|
724
|
-
return true;
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
try {
|
|
728
|
-
if (super.onInterceptTouchEvent(ev)) {
|
|
729
|
-
handleInterceptedTouchEvent(ev);
|
|
730
|
-
return true;
|
|
731
|
-
}
|
|
732
|
-
} catch (IllegalArgumentException e) {
|
|
733
|
-
// Log and ignore the error. This seems to be a bug in the android SDK and
|
|
734
|
-
// this is the commonly accepted workaround.
|
|
735
|
-
// https://tinyurl.com/mw6qkod (Stack Overflow)
|
|
736
|
-
FLog.w(ReactConstants.TAG, "Error intercepting touch event.", e);
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
return false;
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
protected void handleInterceptedTouchEvent(MotionEvent ev) {
|
|
743
|
-
if (!ReactNativeFeatureFlags.shouldTriggerResponderTransferOnScrollAndroid()) {
|
|
744
|
-
NativeGestureUtil.notifyNativeGestureStarted(this, ev);
|
|
745
|
-
}
|
|
746
|
-
ReactScrollViewHelper.emitScrollBeginDragEvent(this);
|
|
747
|
-
mDragging = true;
|
|
748
|
-
mEmittedOverScrollSinceScrollBegin = false;
|
|
749
|
-
enableFpsListener();
|
|
750
|
-
getFlingAnimator().cancel();
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
@Override
|
|
754
|
-
public boolean pageScroll(int direction) {
|
|
755
|
-
boolean handled = super.pageScroll(direction);
|
|
756
|
-
|
|
757
|
-
if (mPagingEnabled && handled) {
|
|
758
|
-
handlePostTouchScrolling(0, 0);
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
return handled;
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
private boolean isDescendantOf(View parent, View view) {
|
|
765
|
-
if (view == null || parent == null) {
|
|
766
|
-
return false;
|
|
767
|
-
}
|
|
768
|
-
ViewParent p = view.getParent();
|
|
769
|
-
while (p != null && p.getParent() != null) {
|
|
770
|
-
if (p == parent) {
|
|
771
|
-
return true;
|
|
772
|
-
}
|
|
773
|
-
p = p.getParent();
|
|
774
|
-
}
|
|
775
|
-
return false;
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
@Override
|
|
779
|
-
public boolean arrowScroll(int direction) {
|
|
780
|
-
boolean handled = false;
|
|
781
|
-
|
|
782
|
-
if (mPagingEnabled) {
|
|
783
|
-
mPagedArrowScrolling = true;
|
|
784
|
-
|
|
785
|
-
if (getChildCount() > 0) {
|
|
786
|
-
View currentFocused = findFocus();
|
|
787
|
-
View nextFocused = FocusFinder.getInstance().findNextFocus(this, currentFocused, direction);
|
|
788
|
-
View rootChild = getContentView();
|
|
789
|
-
if (isDescendantOf(rootChild, nextFocused)) {
|
|
790
|
-
if (!isScrolledInView(nextFocused) && !isMostlyScrolledInView(nextFocused)) {
|
|
791
|
-
smoothScrollToNextPage(direction);
|
|
792
|
-
}
|
|
793
|
-
nextFocused.requestFocus();
|
|
794
|
-
handled = true;
|
|
795
|
-
} else {
|
|
796
|
-
smoothScrollToNextPage(direction);
|
|
797
|
-
handled = true;
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
mPagedArrowScrolling = false;
|
|
802
|
-
} else {
|
|
803
|
-
handled = super.arrowScroll(direction);
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
return handled;
|
|
807
|
-
}
|
|
808
|
-
|
|
809
|
-
@Override
|
|
810
|
-
public boolean onTouchEvent(MotionEvent ev) {
|
|
811
|
-
if (!mScrollEnabled) {
|
|
812
|
-
return false;
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
// We do not accept the touch event if this view is not supposed to receive it.
|
|
816
|
-
if (!PointerEvents.canBeTouchTarget(mPointerEvents)) {
|
|
817
|
-
return false;
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
mVelocityHelper.calculateVelocity(ev);
|
|
821
|
-
int action = ev.getActionMasked();
|
|
822
|
-
if (action == MotionEvent.ACTION_UP && mDragging) {
|
|
823
|
-
ReactScrollViewHelper.updateFabricScrollState(this);
|
|
824
|
-
|
|
825
|
-
float velocityX = mVelocityHelper.getXVelocity();
|
|
826
|
-
float velocityY = mVelocityHelper.getYVelocity();
|
|
827
|
-
ReactScrollViewHelper.emitScrollEndDragEvent(this, velocityX, velocityY);
|
|
828
|
-
if (!ReactNativeFeatureFlags.shouldTriggerResponderTransferOnScrollAndroid()) {
|
|
829
|
-
NativeGestureUtil.notifyNativeGestureEnded(this, ev);
|
|
830
|
-
}
|
|
831
|
-
mDragging = false;
|
|
832
|
-
// After the touch finishes, we may need to do some scrolling afterwards either as a result
|
|
833
|
-
// of a fling or because we need to page align the content
|
|
834
|
-
handlePostTouchScrolling(Math.round(velocityX), Math.round(velocityY));
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
if (action == MotionEvent.ACTION_DOWN) {
|
|
838
|
-
cancelPostTouchScrolling();
|
|
839
|
-
}
|
|
840
|
-
|
|
841
|
-
return super.onTouchEvent(ev);
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
@Override
|
|
845
|
-
public boolean dispatchGenericMotionEvent(MotionEvent ev) {
|
|
846
|
-
// Ignore generic motion events (joystick, mouse wheel, trackpad) if scrolling is disabled
|
|
847
|
-
if (!mScrollEnabled) {
|
|
848
|
-
return false;
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
// We do not dispatch the motion event if its children are not supposed to receive it
|
|
852
|
-
if (!PointerEvents.canChildrenBeTouchTarget(mPointerEvents)) {
|
|
853
|
-
return false;
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
// Handle ACTION_SCROLL events (mouse wheel, trackpad, joystick)
|
|
857
|
-
if (ev.getActionMasked() == MotionEvent.ACTION_SCROLL) {
|
|
858
|
-
float hScroll = ev.getAxisValue(MotionEvent.AXIS_HSCROLL);
|
|
859
|
-
if (hScroll != 0) {
|
|
860
|
-
// Perform the scroll
|
|
861
|
-
enableFpsListener();
|
|
862
|
-
boolean result = super.dispatchGenericMotionEvent(ev);
|
|
863
|
-
// Schedule snap alignment to run after scrolling stops
|
|
864
|
-
if (result
|
|
865
|
-
&& (mPagingEnabled
|
|
866
|
-
|| mSnapInterval != 0
|
|
867
|
-
|| mSnapOffsets != null
|
|
868
|
-
|| mSnapToAlignment != SNAP_ALIGNMENT_DISABLED)) {
|
|
869
|
-
// Cancel any pending post-touch runnable and reschedule
|
|
870
|
-
if (mPostTouchRunnable != null) {
|
|
871
|
-
removeCallbacks(mPostTouchRunnable);
|
|
872
|
-
mPostTouchRunnable = null;
|
|
873
|
-
}
|
|
874
|
-
mPostTouchRunnable =
|
|
875
|
-
new Runnable() {
|
|
876
|
-
@Override
|
|
877
|
-
public void run() {
|
|
878
|
-
mPostTouchRunnable = null;
|
|
879
|
-
// +1/-1 velocity if scrolling right or left. This is to ensure that the
|
|
880
|
-
// next/previous page is picked rather than sliding backwards to the current page
|
|
881
|
-
int velocityX = (int) Math.signum(hScroll);
|
|
882
|
-
if (mDisableIntervalMomentum) {
|
|
883
|
-
velocityX = 0;
|
|
884
|
-
}
|
|
885
|
-
flingAndSnap(velocityX);
|
|
886
|
-
handlePostTouchScrolling(velocityX, 0);
|
|
887
|
-
}
|
|
888
|
-
};
|
|
889
|
-
postOnAnimationDelayed(mPostTouchRunnable, ReactScrollViewHelper.MOMENTUM_DELAY);
|
|
890
|
-
} else {
|
|
891
|
-
handlePostTouchScrolling(0, 0);
|
|
892
|
-
}
|
|
893
|
-
return result;
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
return super.dispatchGenericMotionEvent(ev);
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
@Override
|
|
901
|
-
public boolean executeKeyEvent(KeyEvent event) {
|
|
902
|
-
int eventKeyCode = event.getKeyCode();
|
|
903
|
-
if (!mScrollEnabled
|
|
904
|
-
&& (eventKeyCode == KeyEvent.KEYCODE_DPAD_LEFT
|
|
905
|
-
|| eventKeyCode == KeyEvent.KEYCODE_DPAD_RIGHT)) {
|
|
906
|
-
return false;
|
|
907
|
-
}
|
|
908
|
-
return super.executeKeyEvent(event);
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
@Override
|
|
912
|
-
public void fling(int velocityX) {
|
|
913
|
-
if (DEBUG_MODE) {
|
|
914
|
-
FLog.i(TAG, "fling[%d] velocityX %d", getId(), velocityX);
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
// Workaround.
|
|
918
|
-
// On Android P if a ScrollView is inverted, we will get a wrong sign for
|
|
919
|
-
// velocityX (see https://issuetracker.google.com/issues/112385925).
|
|
920
|
-
// At the same time, mOnScrollDispatchHelper tracks the correct velocity direction.
|
|
921
|
-
//
|
|
922
|
-
// Hence, we can use the absolute value from whatever the OS gives
|
|
923
|
-
// us and use the sign of what mOnScrollDispatchHelper has tracked.
|
|
924
|
-
final int correctedVelocityX =
|
|
925
|
-
Build.VERSION.SDK_INT == Build.VERSION_CODES.P
|
|
926
|
-
? (int) (Math.abs(velocityX) * Math.signum(mOnScrollDispatchHelper.getXFlingVelocity()))
|
|
927
|
-
: velocityX;
|
|
928
|
-
|
|
929
|
-
if (mPagingEnabled) {
|
|
930
|
-
flingAndSnap(correctedVelocityX);
|
|
931
|
-
} else if (mScroller != null) {
|
|
932
|
-
// FB SCROLLVIEW CHANGE
|
|
933
|
-
|
|
934
|
-
// We provide our own version of fling that uses a different call to the standard OverScroller
|
|
935
|
-
// which takes into account the possibility of adding new content while the ScrollView is
|
|
936
|
-
// animating. Because we give essentially no max X for the fling, the fling will continue as
|
|
937
|
-
// long
|
|
938
|
-
// as there is content. See #onOverScrolled() to see the second part of this change which
|
|
939
|
-
// properly
|
|
940
|
-
// aborts the scroller animation when we get to the bottom of the ScrollView content.
|
|
941
|
-
|
|
942
|
-
int scrollWindowWidth =
|
|
943
|
-
getWidth() - ViewCompat.getPaddingStart(this) - ViewCompat.getPaddingEnd(this);
|
|
944
|
-
|
|
945
|
-
mScroller.fling(
|
|
946
|
-
getScrollX(), // startX
|
|
947
|
-
getScrollY(), // startY
|
|
948
|
-
correctedVelocityX, // velocityX
|
|
949
|
-
0, // velocityY
|
|
950
|
-
0, // minX
|
|
951
|
-
Integer.MAX_VALUE, // maxX
|
|
952
|
-
0, // minY
|
|
953
|
-
0, // maxY
|
|
954
|
-
scrollWindowWidth / 2, // overX
|
|
955
|
-
0 // overY
|
|
956
|
-
);
|
|
957
|
-
|
|
958
|
-
ViewCompat.postInvalidateOnAnimation(this);
|
|
959
|
-
|
|
960
|
-
// END FB SCROLLVIEW CHANGE
|
|
961
|
-
} else {
|
|
962
|
-
super.fling(correctedVelocityX);
|
|
963
|
-
}
|
|
964
|
-
handlePostTouchScrolling(correctedVelocityX, 0);
|
|
965
|
-
}
|
|
966
|
-
|
|
967
|
-
@Override
|
|
968
|
-
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
|
|
969
|
-
super.onSizeChanged(w, h, oldw, oldh);
|
|
970
|
-
if (mRemoveClippedSubviews) {
|
|
971
|
-
updateClippingRect();
|
|
972
|
-
}
|
|
973
|
-
if (mVirtualViewContainerState != null) {
|
|
974
|
-
mVirtualViewContainerState.updateState();
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
@Override
|
|
979
|
-
protected void onAttachedToWindow() {
|
|
980
|
-
super.onAttachedToWindow();
|
|
981
|
-
if (mRemoveClippedSubviews) {
|
|
982
|
-
updateClippingRect();
|
|
983
|
-
}
|
|
984
|
-
if (mMaintainVisibleContentPositionHelper != null) {
|
|
985
|
-
mMaintainVisibleContentPositionHelper.start();
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
|
|
989
|
-
@Override
|
|
990
|
-
protected void onDetachedFromWindow() {
|
|
991
|
-
super.onDetachedFromWindow();
|
|
992
|
-
if (mMaintainVisibleContentPositionHelper != null) {
|
|
993
|
-
mMaintainVisibleContentPositionHelper.stop();
|
|
994
|
-
}
|
|
995
|
-
}
|
|
996
|
-
|
|
997
|
-
@Override
|
|
998
|
-
public @Nullable View focusSearch(View focused, @FocusDirection int direction) {
|
|
999
|
-
View nextFocus = super.focusSearch(focused, direction);
|
|
1000
|
-
|
|
1001
|
-
if (ReactNativeFeatureFlags.enableCustomFocusSearchOnClippedElementsAndroid()) {
|
|
1002
|
-
// If we can find the next focus and it is a child of this view, return it, else it means we
|
|
1003
|
-
// are leaving the scroll view and we should try to find a clipped element
|
|
1004
|
-
if (nextFocus != null && this.findViewById(nextFocus.getId()) != null) {
|
|
1005
|
-
return nextFocus;
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
@Nullable View nextFocusableView = findNextFocusableView(this, focused, direction);
|
|
1009
|
-
|
|
1010
|
-
if (nextFocusableView != null) {
|
|
1011
|
-
return nextFocusableView;
|
|
1012
|
-
}
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
return nextFocus;
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
@Override
|
|
1019
|
-
public void updateClippingRect() {
|
|
1020
|
-
updateClippingRect(null);
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
@Override
|
|
1024
|
-
public void updateClippingRect(@Nullable Set<Integer> excludedViewId) {
|
|
1025
|
-
if (!mRemoveClippedSubviews) {
|
|
1026
|
-
return;
|
|
1027
|
-
}
|
|
1028
|
-
|
|
1029
|
-
Systrace.beginSection(Systrace.TRACE_TAG_REACT, "ReactHorizontalScrollView.updateClippingRect");
|
|
1030
|
-
try {
|
|
1031
|
-
Assertions.assertNotNull(mClippingRect);
|
|
1032
|
-
|
|
1033
|
-
ReactClippingViewGroupHelper.calculateClippingRect(this, mClippingRect);
|
|
1034
|
-
View contentView = getContentView();
|
|
1035
|
-
if (contentView instanceof ReactClippingViewGroup) {
|
|
1036
|
-
((ReactClippingViewGroup) contentView).updateClippingRect(excludedViewId);
|
|
1037
|
-
}
|
|
1038
|
-
} finally {
|
|
1039
|
-
Systrace.endSection(Systrace.TRACE_TAG_REACT);
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
@Override
|
|
1044
|
-
public void getClippingRect(Rect outClippingRect) {
|
|
1045
|
-
outClippingRect.set(Assertions.assertNotNull(mClippingRect));
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
|
-
@Override
|
|
1049
|
-
public boolean getChildVisibleRect(View child, Rect r, android.graphics.Point offset) {
|
|
1050
|
-
return super.getChildVisibleRect(child, r, offset);
|
|
1051
|
-
}
|
|
1052
|
-
|
|
1053
|
-
private int getSnapInterval() {
|
|
1054
|
-
if (mSnapInterval != 0) {
|
|
1055
|
-
return mSnapInterval;
|
|
1056
|
-
}
|
|
1057
|
-
return getWidth();
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
private View getContentView() {
|
|
1061
|
-
return getChildAt(0);
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1064
|
-
public void setEndFillColor(int color) {
|
|
1065
|
-
if (color != mEndFillColor) {
|
|
1066
|
-
mEndFillColor = color;
|
|
1067
|
-
mEndBackground = new ColorDrawable(mEndFillColor);
|
|
1068
|
-
}
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
@Override
|
|
1072
|
-
protected void onOverScrolled(int scrollX, int scrollY, boolean clampedX, boolean clampedY) {
|
|
1073
|
-
if (DEBUG_MODE) {
|
|
1074
|
-
FLog.i(
|
|
1075
|
-
TAG,
|
|
1076
|
-
"onOverScrolled[%d] scrollX %d scrollY %d clampedX %b clampedY %b",
|
|
1077
|
-
getId(),
|
|
1078
|
-
scrollX,
|
|
1079
|
-
scrollY,
|
|
1080
|
-
clampedX,
|
|
1081
|
-
clampedY);
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
if (mScroller != null) {
|
|
1085
|
-
// FB SCROLLVIEW CHANGE
|
|
1086
|
-
|
|
1087
|
-
// This is part two of the reimplementation of fling to fix the bounce-back bug. See #fling()
|
|
1088
|
-
// for
|
|
1089
|
-
// more information.
|
|
1090
|
-
|
|
1091
|
-
if (!mScroller.isFinished() && mScroller.getCurrX() != mScroller.getFinalX()) {
|
|
1092
|
-
int scrollRange = Math.max(computeHorizontalScrollRange() - getWidth(), 0);
|
|
1093
|
-
if (scrollX >= scrollRange) {
|
|
1094
|
-
mScroller.abortAnimation();
|
|
1095
|
-
scrollX = scrollRange;
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
// END FB SCROLLVIEW CHANGE
|
|
1100
|
-
}
|
|
1101
|
-
|
|
1102
|
-
if (ReactNativeFeatureFlags.shouldTriggerResponderTransferOnScrollAndroid()
|
|
1103
|
-
&& clampedX
|
|
1104
|
-
&& mEmittedOverScrollSinceScrollBegin == false) {
|
|
1105
|
-
ReactScrollViewHelper.emitScrollEvent(this, 0f, 0f);
|
|
1106
|
-
mEmittedOverScrollSinceScrollBegin = true;
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
super.onOverScrolled(scrollX, scrollY, clampedX, clampedY);
|
|
1110
|
-
}
|
|
1111
|
-
|
|
1112
|
-
@Override
|
|
1113
|
-
public void onChildViewAdded(View parent, View child) {
|
|
1114
|
-
mContentView = child;
|
|
1115
|
-
mContentView.addOnLayoutChangeListener(this);
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
|
-
@Override
|
|
1119
|
-
public @Nullable void onChildViewRemoved(View parent, View child) {
|
|
1120
|
-
if (mContentView != null) {
|
|
1121
|
-
mContentView.removeOnLayoutChangeListener(this);
|
|
1122
|
-
}
|
|
1123
|
-
mContentView = null;
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
private void enableFpsListener() {
|
|
1127
|
-
if (isScrollPerfLoggingEnabled()) {
|
|
1128
|
-
Assertions.assertNotNull(mFpsListener);
|
|
1129
|
-
Assertions.assertNotNull(mScrollPerfTag);
|
|
1130
|
-
mFpsListener.enable(mScrollPerfTag);
|
|
1131
|
-
}
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
|
-
private void disableFpsListener() {
|
|
1135
|
-
if (isScrollPerfLoggingEnabled()) {
|
|
1136
|
-
Assertions.assertNotNull(mFpsListener);
|
|
1137
|
-
Assertions.assertNotNull(mScrollPerfTag);
|
|
1138
|
-
mFpsListener.disable(mScrollPerfTag);
|
|
1139
|
-
}
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
private boolean isScrollPerfLoggingEnabled() {
|
|
1143
|
-
return mFpsListener != null && mScrollPerfTag != null && !mScrollPerfTag.isEmpty();
|
|
1144
|
-
}
|
|
1145
|
-
|
|
1146
|
-
@Override
|
|
1147
|
-
public void draw(Canvas canvas) {
|
|
1148
|
-
if (mEndFillColor != Color.TRANSPARENT) {
|
|
1149
|
-
final View content = getContentView();
|
|
1150
|
-
if (mEndBackground != null && content != null && content.getRight() < getWidth()) {
|
|
1151
|
-
mEndBackground.setBounds(content.getRight(), 0, getWidth(), getHeight());
|
|
1152
|
-
mEndBackground.draw(canvas);
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
super.draw(canvas);
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
|
-
/**
|
|
1159
|
-
* This handles any sort of scrolling that may occur after a touch is finished. This may be
|
|
1160
|
-
* momentum scrolling (fling) or because you have pagingEnabled on the scroll view. Because we
|
|
1161
|
-
* don't get any events from Android about this lifecycle, we do all our detection by creating a
|
|
1162
|
-
* runnable that checks if we scrolled in the last frame and if so assumes we are still scrolling.
|
|
1163
|
-
*/
|
|
1164
|
-
private void handlePostTouchScrolling(int velocityX, int velocityY) {
|
|
1165
|
-
if (DEBUG_MODE) {
|
|
1166
|
-
FLog.i(
|
|
1167
|
-
TAG,
|
|
1168
|
-
"handlePostTouchScrolling[%d] velocityX %d velocityY %d",
|
|
1169
|
-
getId(),
|
|
1170
|
-
velocityX,
|
|
1171
|
-
velocityY);
|
|
1172
|
-
}
|
|
1173
|
-
|
|
1174
|
-
// Check if we are already handling this which may occur if this is called by both the touch up
|
|
1175
|
-
// and a fling call
|
|
1176
|
-
if (mPostTouchRunnable != null) {
|
|
1177
|
-
return;
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
if (mSendMomentumEvents) {
|
|
1181
|
-
ReactScrollViewHelper.emitScrollMomentumBeginEvent(this, velocityX, velocityY);
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
|
-
mActivelyScrolling = false;
|
|
1185
|
-
mPostTouchRunnable =
|
|
1186
|
-
new Runnable() {
|
|
1187
|
-
|
|
1188
|
-
private boolean mSnappingToPage = false;
|
|
1189
|
-
private int mStableFrames = 0;
|
|
1190
|
-
|
|
1191
|
-
@Override
|
|
1192
|
-
public void run() {
|
|
1193
|
-
if (mActivelyScrolling) {
|
|
1194
|
-
// We are still scrolling.
|
|
1195
|
-
mActivelyScrolling = false;
|
|
1196
|
-
mStableFrames = 0;
|
|
1197
|
-
ReactHorizontalScrollView.this.postOnAnimationDelayed(
|
|
1198
|
-
this, ReactScrollViewHelper.MOMENTUM_DELAY);
|
|
1199
|
-
} else {
|
|
1200
|
-
// There has not been a scroll update since the last time this Runnable executed.
|
|
1201
|
-
ReactScrollViewHelper.updateFabricScrollState(ReactHorizontalScrollView.this);
|
|
1202
|
-
|
|
1203
|
-
// We keep checking for updates until the ScrollView has "stabilized" and hasn't
|
|
1204
|
-
// scrolled for N consecutive frames. This number is arbitrary: big enough to catch
|
|
1205
|
-
// a number of race conditions, but small enough to not cause perf regressions, etc.
|
|
1206
|
-
// In anecdotal testing, it seemed like a decent number.
|
|
1207
|
-
// Without this check, sometimes this Runnable stops executing too soon - it will
|
|
1208
|
-
// fire before the first scroll event of an animated scroll/fling, and stop
|
|
1209
|
-
// immediately.
|
|
1210
|
-
mStableFrames++;
|
|
1211
|
-
|
|
1212
|
-
if (mStableFrames >= 3) {
|
|
1213
|
-
mPostTouchRunnable = null;
|
|
1214
|
-
if (mSendMomentumEvents) {
|
|
1215
|
-
ReactScrollViewHelper.emitScrollMomentumEndEvent(ReactHorizontalScrollView.this);
|
|
1216
|
-
}
|
|
1217
|
-
ReactScrollViewHelper.notifyUserDrivenScrollEnded_internal(
|
|
1218
|
-
ReactHorizontalScrollView.this);
|
|
1219
|
-
disableFpsListener();
|
|
1220
|
-
} else {
|
|
1221
|
-
if (mPagingEnabled && !mSnappingToPage) {
|
|
1222
|
-
// If we have pagingEnabled and we have not snapped to the page
|
|
1223
|
-
// we need to cause that scroll by asking for it
|
|
1224
|
-
mSnappingToPage = true;
|
|
1225
|
-
flingAndSnap(0);
|
|
1226
|
-
}
|
|
1227
|
-
// The scrollview has not "stabilized" so we just post to check again a frame later
|
|
1228
|
-
ReactHorizontalScrollView.this.postOnAnimationDelayed(
|
|
1229
|
-
this, ReactScrollViewHelper.MOMENTUM_DELAY);
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
}
|
|
1233
|
-
};
|
|
1234
|
-
postOnAnimationDelayed(mPostTouchRunnable, ReactScrollViewHelper.MOMENTUM_DELAY);
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1237
|
-
private void cancelPostTouchScrolling() {
|
|
1238
|
-
if (mPostTouchRunnable != null) {
|
|
1239
|
-
removeCallbacks(mPostTouchRunnable);
|
|
1240
|
-
mPostTouchRunnable = null;
|
|
1241
|
-
getFlingAnimator().cancel();
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
private int predictFinalScrollPosition(int velocityX) {
|
|
1246
|
-
// predict where a fling would end up so we can scroll to the nearest snap offset
|
|
1247
|
-
final int maximumOffset = Math.max(0, computeHorizontalScrollRange() - getWidth());
|
|
1248
|
-
// TODO(T106335409): Existing prediction still uses overscroller. Consider change this to use
|
|
1249
|
-
// fling animator instead.
|
|
1250
|
-
return getFlingAnimator() == DEFAULT_FLING_ANIMATOR
|
|
1251
|
-
? ReactScrollViewHelper.predictFinalScrollPosition(this, velocityX, 0, maximumOffset, 0).x
|
|
1252
|
-
: ReactScrollViewHelper.getNextFlingStartValue(
|
|
1253
|
-
this,
|
|
1254
|
-
getScrollX(),
|
|
1255
|
-
getReactScrollViewScrollState().getFinalAnimatedPositionScroll().x,
|
|
1256
|
-
velocityX)
|
|
1257
|
-
+ getFlingExtrapolatedDistance(velocityX);
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
|
-
/**
|
|
1261
|
-
* This will smooth scroll us to the nearest snap offset point. It currently just looks at where
|
|
1262
|
-
* the content is and slides to the nearest point. It is intended to be run after we are done
|
|
1263
|
-
* scrolling, and handling any momentum scrolling.
|
|
1264
|
-
*/
|
|
1265
|
-
private void smoothScrollAndSnap(int velocity) {
|
|
1266
|
-
if (DEBUG_MODE) {
|
|
1267
|
-
FLog.i(TAG, "smoothScrollAndSnap[%d] velocity %d", getId(), velocity);
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
double interval = (double) getSnapInterval();
|
|
1271
|
-
double currentOffset =
|
|
1272
|
-
(double)
|
|
1273
|
-
(ReactScrollViewHelper.getNextFlingStartValue(
|
|
1274
|
-
this,
|
|
1275
|
-
getScrollX(),
|
|
1276
|
-
getReactScrollViewScrollState().getFinalAnimatedPositionScroll().x,
|
|
1277
|
-
velocity));
|
|
1278
|
-
double targetOffset = (double) predictFinalScrollPosition(velocity);
|
|
1279
|
-
|
|
1280
|
-
int previousPage = (int) Math.floor(currentOffset / interval);
|
|
1281
|
-
int nextPage = (int) Math.ceil(currentOffset / interval);
|
|
1282
|
-
int currentPage = (int) Math.round(currentOffset / interval);
|
|
1283
|
-
int targetPage = (int) Math.round(targetOffset / interval);
|
|
1284
|
-
|
|
1285
|
-
if (velocity > 0 && nextPage == previousPage) {
|
|
1286
|
-
nextPage++;
|
|
1287
|
-
} else if (velocity < 0 && previousPage == nextPage) {
|
|
1288
|
-
previousPage--;
|
|
1289
|
-
}
|
|
1290
|
-
|
|
1291
|
-
if (
|
|
1292
|
-
// if scrolling towards next page
|
|
1293
|
-
velocity > 0
|
|
1294
|
-
&&
|
|
1295
|
-
// and the middle of the page hasn't been crossed already
|
|
1296
|
-
currentPage < nextPage
|
|
1297
|
-
&&
|
|
1298
|
-
// and it would have been crossed after flinging
|
|
1299
|
-
targetPage > previousPage) {
|
|
1300
|
-
currentPage = nextPage;
|
|
1301
|
-
} else if (
|
|
1302
|
-
// if scrolling towards previous page
|
|
1303
|
-
velocity < 0
|
|
1304
|
-
&&
|
|
1305
|
-
// and the middle of the page hasn't been crossed already
|
|
1306
|
-
currentPage > previousPage
|
|
1307
|
-
&&
|
|
1308
|
-
// and it would have been crossed after flinging
|
|
1309
|
-
targetPage < nextPage) {
|
|
1310
|
-
currentPage = previousPage;
|
|
1311
|
-
}
|
|
1312
|
-
|
|
1313
|
-
targetOffset = currentPage * interval;
|
|
1314
|
-
if (targetOffset != currentOffset) {
|
|
1315
|
-
mActivelyScrolling = true;
|
|
1316
|
-
reactSmoothScrollTo((int) targetOffset, getScrollY());
|
|
1317
|
-
}
|
|
1318
|
-
}
|
|
1319
|
-
|
|
1320
|
-
private void flingAndSnap(int velocityX) {
|
|
1321
|
-
if (DEBUG_MODE) {
|
|
1322
|
-
FLog.i(TAG, "smoothScrollAndSnap[%d] velocityX %d", getId(), velocityX);
|
|
1323
|
-
}
|
|
1324
|
-
|
|
1325
|
-
if (getChildCount() <= 0) {
|
|
1326
|
-
return;
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
|
-
// pagingEnabled only allows snapping one interval at a time
|
|
1330
|
-
if (mSnapInterval == 0 && mSnapOffsets == null && mSnapToAlignment == SNAP_ALIGNMENT_DISABLED) {
|
|
1331
|
-
smoothScrollAndSnap(velocityX);
|
|
1332
|
-
return;
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1335
|
-
boolean hasCustomizedFlingAnimator = getFlingAnimator() != DEFAULT_FLING_ANIMATOR;
|
|
1336
|
-
int maximumOffset = Math.max(0, computeHorizontalScrollRange() - getWidth());
|
|
1337
|
-
int targetOffset = predictFinalScrollPosition(velocityX);
|
|
1338
|
-
if (mDisableIntervalMomentum) {
|
|
1339
|
-
targetOffset = getScrollX();
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1342
|
-
int smallerOffset = 0;
|
|
1343
|
-
int largerOffset = maximumOffset;
|
|
1344
|
-
int firstOffset = 0;
|
|
1345
|
-
int lastOffset = maximumOffset;
|
|
1346
|
-
int width = getWidth() - ViewCompat.getPaddingStart(this) - ViewCompat.getPaddingEnd(this);
|
|
1347
|
-
|
|
1348
|
-
// offsets are from the right edge in RTL layouts
|
|
1349
|
-
if (getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
|
|
1350
|
-
targetOffset = maximumOffset - targetOffset;
|
|
1351
|
-
velocityX = -velocityX;
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1354
|
-
// get the nearest snap points to the target offset
|
|
1355
|
-
if (mSnapOffsets != null && !mSnapOffsets.isEmpty()) {
|
|
1356
|
-
firstOffset = mSnapOffsets.get(0);
|
|
1357
|
-
lastOffset = mSnapOffsets.get(mSnapOffsets.size() - 1);
|
|
1358
|
-
|
|
1359
|
-
for (int i = 0; i < mSnapOffsets.size(); i++) {
|
|
1360
|
-
int offset = mSnapOffsets.get(i);
|
|
1361
|
-
|
|
1362
|
-
if (offset <= targetOffset) {
|
|
1363
|
-
if (targetOffset - offset < targetOffset - smallerOffset) {
|
|
1364
|
-
smallerOffset = offset;
|
|
1365
|
-
}
|
|
1366
|
-
}
|
|
1367
|
-
|
|
1368
|
-
if (offset >= targetOffset) {
|
|
1369
|
-
if (offset - targetOffset < largerOffset - targetOffset) {
|
|
1370
|
-
largerOffset = offset;
|
|
1371
|
-
}
|
|
1372
|
-
}
|
|
1373
|
-
}
|
|
1374
|
-
} else if (mSnapToAlignment != SNAP_ALIGNMENT_DISABLED) {
|
|
1375
|
-
if (mSnapInterval > 0) {
|
|
1376
|
-
double ratio = (double) targetOffset / mSnapInterval;
|
|
1377
|
-
smallerOffset =
|
|
1378
|
-
Math.max(
|
|
1379
|
-
getItemStartOffset(
|
|
1380
|
-
mSnapToAlignment,
|
|
1381
|
-
(int) (Math.floor(ratio) * mSnapInterval),
|
|
1382
|
-
mSnapInterval,
|
|
1383
|
-
width),
|
|
1384
|
-
0);
|
|
1385
|
-
largerOffset =
|
|
1386
|
-
Math.min(
|
|
1387
|
-
getItemStartOffset(
|
|
1388
|
-
mSnapToAlignment,
|
|
1389
|
-
(int) (Math.ceil(ratio) * mSnapInterval),
|
|
1390
|
-
mSnapInterval,
|
|
1391
|
-
width),
|
|
1392
|
-
maximumOffset);
|
|
1393
|
-
} else {
|
|
1394
|
-
ViewGroup contentView = (ViewGroup) getContentView();
|
|
1395
|
-
int smallerChildOffset = largerOffset;
|
|
1396
|
-
int largerChildOffset = smallerOffset;
|
|
1397
|
-
for (int i = 0; i < contentView.getChildCount(); i++) {
|
|
1398
|
-
View item = contentView.getChildAt(i);
|
|
1399
|
-
int itemStartOffset =
|
|
1400
|
-
getItemStartOffset(mSnapToAlignment, item.getLeft(), item.getWidth(), width);
|
|
1401
|
-
if (itemStartOffset <= targetOffset) {
|
|
1402
|
-
if (targetOffset - itemStartOffset < targetOffset - smallerOffset) {
|
|
1403
|
-
smallerOffset = itemStartOffset;
|
|
1404
|
-
}
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
if (itemStartOffset >= targetOffset) {
|
|
1408
|
-
if (itemStartOffset - targetOffset < largerOffset - targetOffset) {
|
|
1409
|
-
largerOffset = itemStartOffset;
|
|
1410
|
-
}
|
|
1411
|
-
}
|
|
1412
|
-
|
|
1413
|
-
smallerChildOffset = Math.min(smallerChildOffset, itemStartOffset);
|
|
1414
|
-
largerChildOffset = Math.max(largerChildOffset, itemStartOffset);
|
|
1415
|
-
}
|
|
1416
|
-
|
|
1417
|
-
// For Recycler ViewGroup, the maximumOffset can be much larger than the total heights of
|
|
1418
|
-
// items in the layout. In this case snapping is not possible beyond the currently rendered
|
|
1419
|
-
// children.
|
|
1420
|
-
smallerOffset = Math.max(smallerOffset, smallerChildOffset);
|
|
1421
|
-
largerOffset = Math.min(largerOffset, largerChildOffset);
|
|
1422
|
-
}
|
|
1423
|
-
} else {
|
|
1424
|
-
double interval = getSnapInterval();
|
|
1425
|
-
double ratio = (double) targetOffset / interval;
|
|
1426
|
-
smallerOffset = (int) (Math.floor(ratio) * interval);
|
|
1427
|
-
largerOffset = Math.min((int) (Math.ceil(ratio) * interval), maximumOffset);
|
|
1428
|
-
}
|
|
1429
|
-
|
|
1430
|
-
// Calculate the nearest offset
|
|
1431
|
-
int nearestOffset =
|
|
1432
|
-
Math.abs(targetOffset - smallerOffset) < Math.abs(largerOffset - targetOffset)
|
|
1433
|
-
? smallerOffset
|
|
1434
|
-
: largerOffset;
|
|
1435
|
-
|
|
1436
|
-
// if scrolling after the last snap offset and snapping to the
|
|
1437
|
-
// end of the list is disabled, then we allow free scrolling
|
|
1438
|
-
int currentOffset = getScrollX();
|
|
1439
|
-
if (getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
|
|
1440
|
-
currentOffset = maximumOffset - currentOffset;
|
|
1441
|
-
}
|
|
1442
|
-
if (!mSnapToEnd && targetOffset >= lastOffset) {
|
|
1443
|
-
if (currentOffset >= lastOffset) {
|
|
1444
|
-
// free scrolling
|
|
1445
|
-
} else {
|
|
1446
|
-
// snap to end
|
|
1447
|
-
targetOffset = lastOffset;
|
|
1448
|
-
}
|
|
1449
|
-
} else if (!mSnapToStart && targetOffset <= firstOffset) {
|
|
1450
|
-
if (currentOffset <= firstOffset) {
|
|
1451
|
-
// free scrolling
|
|
1452
|
-
} else {
|
|
1453
|
-
// snap to beginning
|
|
1454
|
-
targetOffset = firstOffset;
|
|
1455
|
-
}
|
|
1456
|
-
} else if (velocityX > 0) {
|
|
1457
|
-
if (!hasCustomizedFlingAnimator) {
|
|
1458
|
-
// The default animator requires boost on initial velocity as when snapping velocity can
|
|
1459
|
-
// feel sluggish for slow swipes
|
|
1460
|
-
velocityX += (int) ((largerOffset - targetOffset) * 10.0);
|
|
1461
|
-
}
|
|
1462
|
-
|
|
1463
|
-
targetOffset = largerOffset;
|
|
1464
|
-
} else if (velocityX < 0) {
|
|
1465
|
-
if (!hasCustomizedFlingAnimator) {
|
|
1466
|
-
// The default animator requires boost on initial velocity as when snapping velocity can
|
|
1467
|
-
// feel sluggish for slow swipes
|
|
1468
|
-
velocityX -= (int) ((targetOffset - smallerOffset) * 10.0);
|
|
1469
|
-
}
|
|
1470
|
-
|
|
1471
|
-
targetOffset = smallerOffset;
|
|
1472
|
-
} else {
|
|
1473
|
-
targetOffset = nearestOffset;
|
|
1474
|
-
}
|
|
1475
|
-
|
|
1476
|
-
// Make sure the new offset isn't out of bounds
|
|
1477
|
-
targetOffset = Math.min(Math.max(0, targetOffset), maximumOffset);
|
|
1478
|
-
|
|
1479
|
-
if (getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
|
|
1480
|
-
targetOffset = maximumOffset - targetOffset;
|
|
1481
|
-
velocityX = -velocityX;
|
|
1482
|
-
}
|
|
1483
|
-
|
|
1484
|
-
if (hasCustomizedFlingAnimator || mScroller == null) {
|
|
1485
|
-
reactSmoothScrollTo(targetOffset, getScrollY());
|
|
1486
|
-
} else {
|
|
1487
|
-
// smoothScrollTo will always scroll over 250ms which is often *waaay*
|
|
1488
|
-
// too short and will cause the scrolling to feel almost instant
|
|
1489
|
-
// try to manually interact with OverScroller instead
|
|
1490
|
-
// if velocity is 0 however, fling() won't work, so we want to use smoothScrollTo
|
|
1491
|
-
mActivelyScrolling = true;
|
|
1492
|
-
|
|
1493
|
-
mScroller.fling(
|
|
1494
|
-
getScrollX(), // startX
|
|
1495
|
-
getScrollY(), // startY
|
|
1496
|
-
// velocity = 0 doesn't work with fling() so we pretend there's a reasonable
|
|
1497
|
-
// initial velocity going on when a touch is released without any movement
|
|
1498
|
-
velocityX != 0 ? velocityX : targetOffset - getScrollX(), // velocityX
|
|
1499
|
-
0, // velocityY
|
|
1500
|
-
// setting both minX and maxX to the same value will guarantee that we scroll to it
|
|
1501
|
-
// but using the standard fling-style easing rather than smoothScrollTo's 250ms animation
|
|
1502
|
-
targetOffset, // minX
|
|
1503
|
-
targetOffset, // maxX
|
|
1504
|
-
0, // minY
|
|
1505
|
-
0, // maxY
|
|
1506
|
-
// we only want to allow overscrolling if the final offset is at the very edge of the view
|
|
1507
|
-
(targetOffset == 0 || targetOffset == maximumOffset) ? width / 2 : 0, // overX
|
|
1508
|
-
0 // overY
|
|
1509
|
-
);
|
|
1510
|
-
|
|
1511
|
-
postInvalidateOnAnimation();
|
|
1512
|
-
}
|
|
1513
|
-
}
|
|
1514
|
-
|
|
1515
|
-
private int getItemStartOffset(
|
|
1516
|
-
int snapToAlignment, int itemStartPosition, int itemWidth, int viewPortWidth) {
|
|
1517
|
-
int itemStartOffset;
|
|
1518
|
-
switch (snapToAlignment) {
|
|
1519
|
-
case SNAP_ALIGNMENT_CENTER:
|
|
1520
|
-
itemStartOffset = itemStartPosition - (viewPortWidth - itemWidth) / 2;
|
|
1521
|
-
break;
|
|
1522
|
-
case SNAP_ALIGNMENT_START:
|
|
1523
|
-
itemStartOffset = itemStartPosition;
|
|
1524
|
-
break;
|
|
1525
|
-
case SNAP_ALIGNMENT_END:
|
|
1526
|
-
itemStartOffset = itemStartPosition - (viewPortWidth - itemWidth);
|
|
1527
|
-
break;
|
|
1528
|
-
default:
|
|
1529
|
-
throw new IllegalStateException("Invalid SnapToAlignment value: " + mSnapToAlignment);
|
|
1530
|
-
}
|
|
1531
|
-
return itemStartOffset;
|
|
1532
|
-
}
|
|
1533
|
-
|
|
1534
|
-
private void smoothScrollToNextPage(int direction) {
|
|
1535
|
-
if (DEBUG_MODE) {
|
|
1536
|
-
FLog.i(TAG, "smoothScrollToNextPage[%d] direction %d", getId(), direction);
|
|
1537
|
-
}
|
|
1538
|
-
|
|
1539
|
-
int width = getWidth();
|
|
1540
|
-
int currentX = getScrollX();
|
|
1541
|
-
|
|
1542
|
-
int page = currentX / width;
|
|
1543
|
-
if (currentX % width != 0) {
|
|
1544
|
-
page++;
|
|
1545
|
-
}
|
|
1546
|
-
|
|
1547
|
-
if (direction == View.FOCUS_LEFT) {
|
|
1548
|
-
page = page - 1;
|
|
1549
|
-
} else {
|
|
1550
|
-
page = page + 1;
|
|
1551
|
-
}
|
|
1552
|
-
|
|
1553
|
-
if (page < 0) {
|
|
1554
|
-
page = 0;
|
|
1555
|
-
}
|
|
1556
|
-
|
|
1557
|
-
reactSmoothScrollTo(page * width, getScrollY());
|
|
1558
|
-
handlePostTouchScrolling(0, 0);
|
|
1559
|
-
}
|
|
1560
|
-
|
|
1561
|
-
@Override
|
|
1562
|
-
public void setBackgroundColor(int color) {
|
|
1563
|
-
BackgroundStyleApplicator.setBackgroundColor(this, color);
|
|
1564
|
-
}
|
|
1565
|
-
|
|
1566
|
-
public void setBorderWidth(int position, float width) {
|
|
1567
|
-
BackgroundStyleApplicator.setBorderWidth(
|
|
1568
|
-
this, LogicalEdge.values()[position], PixelUtil.toDIPFromPixel(width));
|
|
1569
|
-
}
|
|
1570
|
-
|
|
1571
|
-
public void setBorderColor(int position, @Nullable Integer color) {
|
|
1572
|
-
BackgroundStyleApplicator.setBorderColor(this, LogicalEdge.values()[position], color);
|
|
1573
|
-
}
|
|
1574
|
-
|
|
1575
|
-
public void setBorderRadius(float borderRadius) {
|
|
1576
|
-
setBorderRadius(borderRadius, BorderRadiusProp.BORDER_RADIUS.ordinal());
|
|
1577
|
-
}
|
|
1578
|
-
|
|
1579
|
-
public void setBorderRadius(float borderRadius, int position) {
|
|
1580
|
-
@Nullable
|
|
1581
|
-
LengthPercentage radius =
|
|
1582
|
-
Float.isNaN(borderRadius)
|
|
1583
|
-
? null
|
|
1584
|
-
: new LengthPercentage(
|
|
1585
|
-
PixelUtil.toDIPFromPixel(borderRadius), LengthPercentageType.POINT);
|
|
1586
|
-
BackgroundStyleApplicator.setBorderRadius(this, BorderRadiusProp.values()[position], radius);
|
|
1587
|
-
}
|
|
1588
|
-
|
|
1589
|
-
public void setBorderStyle(@Nullable String style) {
|
|
1590
|
-
BackgroundStyleApplicator.setBorderStyle(
|
|
1591
|
-
this, style == null ? null : BorderStyle.fromString(style));
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
/**
|
|
1595
|
-
* Calls `smoothScrollTo` and updates state.
|
|
1596
|
-
*
|
|
1597
|
-
* <p>`smoothScrollTo` changes `contentOffset` and we need to keep `contentOffset` in sync between
|
|
1598
|
-
* scroll view and state. Calling raw `smoothScrollTo` doesn't update state.
|
|
1599
|
-
*/
|
|
1600
|
-
@Override
|
|
1601
|
-
public void reactSmoothScrollTo(int x, int y) {
|
|
1602
|
-
ReactScrollViewHelper.smoothScrollTo(this, x, y);
|
|
1603
|
-
setPendingContentOffsets(x, y);
|
|
1604
|
-
}
|
|
1605
|
-
|
|
1606
|
-
/**
|
|
1607
|
-
* Calls `super.scrollTo` and updates state.
|
|
1608
|
-
*
|
|
1609
|
-
* <p>`super.scrollTo` changes `contentOffset` and we need to keep `contentOffset` in sync between
|
|
1610
|
-
* scroll view and state.
|
|
1611
|
-
*
|
|
1612
|
-
* <p>Note that while we can override scrollTo, we *cannot* override `smoothScrollTo` because it
|
|
1613
|
-
* is final. See `reactSmoothScrollTo`.
|
|
1614
|
-
*/
|
|
1615
|
-
@Override
|
|
1616
|
-
public void scrollTo(int x, int y) {
|
|
1617
|
-
if (DEBUG_MODE) {
|
|
1618
|
-
FLog.i(TAG, "scrollTo[%d] x %d y %d", getId(), x, y);
|
|
1619
|
-
}
|
|
1620
|
-
|
|
1621
|
-
super.scrollTo(x, y);
|
|
1622
|
-
ReactScrollViewHelper.updateFabricScrollState(this);
|
|
1623
|
-
setPendingContentOffsets(x, y);
|
|
1624
|
-
}
|
|
1625
|
-
|
|
1626
|
-
/** Scrolls to a new position preserving any momentum scrolling animation. */
|
|
1627
|
-
@Override
|
|
1628
|
-
public void scrollToPreservingMomentum(int x, int y) {
|
|
1629
|
-
scrollTo(x, y);
|
|
1630
|
-
recreateFlingAnimation(x, Integer.MAX_VALUE);
|
|
1631
|
-
}
|
|
1632
|
-
|
|
1633
|
-
private boolean isContentReady() {
|
|
1634
|
-
View child = getContentView();
|
|
1635
|
-
return child != null && child.getWidth() != 0 && child.getHeight() != 0;
|
|
1636
|
-
}
|
|
1637
|
-
|
|
1638
|
-
/**
|
|
1639
|
-
* If contentOffset is set before the View has been laid out, store the values and set them when
|
|
1640
|
-
* `onLayout` is called.
|
|
1641
|
-
*
|
|
1642
|
-
* @param x
|
|
1643
|
-
* @param y
|
|
1644
|
-
*/
|
|
1645
|
-
private void setPendingContentOffsets(int x, int y) {
|
|
1646
|
-
if (DEBUG_MODE) {
|
|
1647
|
-
FLog.i(TAG, "setPendingContentOffsets[%d] x %d y %d", getId(), x, y);
|
|
1648
|
-
}
|
|
1649
|
-
|
|
1650
|
-
if (isContentReady()) {
|
|
1651
|
-
mPendingContentOffsetX = UNSET_CONTENT_OFFSET;
|
|
1652
|
-
mPendingContentOffsetY = UNSET_CONTENT_OFFSET;
|
|
1653
|
-
} else {
|
|
1654
|
-
mPendingContentOffsetX = x;
|
|
1655
|
-
mPendingContentOffsetY = y;
|
|
1656
|
-
}
|
|
1657
|
-
}
|
|
1658
|
-
|
|
1659
|
-
@Override
|
|
1660
|
-
public void onLayoutChange(
|
|
1661
|
-
View v,
|
|
1662
|
-
int left,
|
|
1663
|
-
int top,
|
|
1664
|
-
int right,
|
|
1665
|
-
int bottom,
|
|
1666
|
-
int oldLeft,
|
|
1667
|
-
int oldTop,
|
|
1668
|
-
int oldRight,
|
|
1669
|
-
int oldBottom) {
|
|
1670
|
-
if (mContentView == null) {
|
|
1671
|
-
return;
|
|
1672
|
-
}
|
|
1673
|
-
|
|
1674
|
-
// Adjust the scroll position to follow new content. In RTL, this means we keep a constant
|
|
1675
|
-
// offset from the right edge instead of the left edge, so content added to the end of the flow
|
|
1676
|
-
// does not shift layout. If `maintainVisibleContentPosition` is enabled, we try to adjust
|
|
1677
|
-
// position so that the viewport keeps the same insets to previously visible views. TODO: MVCP
|
|
1678
|
-
// does not work in RTL.
|
|
1679
|
-
if (v.getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
|
|
1680
|
-
adjustPositionForContentChangeRTL(left, right, oldLeft, oldRight);
|
|
1681
|
-
}
|
|
1682
|
-
ReactScrollViewHelper.emitLayoutChangeEvent(this);
|
|
1683
|
-
}
|
|
1684
|
-
|
|
1685
|
-
/**
|
|
1686
|
-
* If we are in the middle of a fling animation from the user removing their finger (OverScroller
|
|
1687
|
-
* is in `FLING_MODE`), recreate the existing fling animation since it was calculated against
|
|
1688
|
-
* outdated scroll offsets.
|
|
1689
|
-
*/
|
|
1690
|
-
private void recreateFlingAnimation(int scrollX, int maxX) {
|
|
1691
|
-
// If we have any pending custom flings (e.g. from animated `scrollTo`, or flinging to a snap
|
|
1692
|
-
// point), cancel them.
|
|
1693
|
-
// TODO: Can we be more graceful (like OverScroller flings)?
|
|
1694
|
-
if (getFlingAnimator().isRunning()) {
|
|
1695
|
-
getFlingAnimator().cancel();
|
|
1696
|
-
}
|
|
1697
|
-
|
|
1698
|
-
if (mScroller != null && !mScroller.isFinished()) {
|
|
1699
|
-
// Calculate the velocity and position of the fling animation at the time of this layout
|
|
1700
|
-
// event, which may be later than the last ScrollView tick. These values are not committed to
|
|
1701
|
-
// the underlying ScrollView, which will recalculate positions on its next tick.
|
|
1702
|
-
int scrollerXBeforeTick = mScroller.getCurrX();
|
|
1703
|
-
boolean hasMoreTicks = mScroller.computeScrollOffset();
|
|
1704
|
-
|
|
1705
|
-
// Stop the existing animation at the current state of the scroller. We will then recreate
|
|
1706
|
-
// it starting at the adjusted x offset.
|
|
1707
|
-
mScroller.forceFinished(true);
|
|
1708
|
-
|
|
1709
|
-
if (hasMoreTicks) {
|
|
1710
|
-
// OverScroller.getCurrVelocity() returns an absolute value of the velocity a current fling
|
|
1711
|
-
// animation (only FLING_MODE animations). We derive direction along the X axis from the
|
|
1712
|
-
// start and end of the, animation assuming HorizontalScrollView never fires vertical fling
|
|
1713
|
-
// animations.
|
|
1714
|
-
// TODO: This does not fully handle overscroll.
|
|
1715
|
-
float direction = Math.signum(mScroller.getFinalX() - mScroller.getStartX());
|
|
1716
|
-
float flingVelocityX = mScroller.getCurrVelocity() * direction;
|
|
1717
|
-
|
|
1718
|
-
mScroller.fling(scrollX, getScrollY(), (int) flingVelocityX, 0, 0, maxX, 0, 0);
|
|
1719
|
-
} else {
|
|
1720
|
-
scrollTo(scrollX + (mScroller.getCurrX() - scrollerXBeforeTick), getScrollY());
|
|
1721
|
-
}
|
|
1722
|
-
}
|
|
1723
|
-
}
|
|
1724
|
-
|
|
1725
|
-
private void adjustPositionForContentChangeRTL(int left, int right, int oldLeft, int oldRight) {
|
|
1726
|
-
// If we have any pending custom flings (e.g. from animated `scrollTo`, or flinging to a snap
|
|
1727
|
-
// point), finish them, committing the final `scrollX`.
|
|
1728
|
-
// TODO: Can we be more graceful (like OverScroller flings)?
|
|
1729
|
-
if (getFlingAnimator().isRunning()) {
|
|
1730
|
-
getFlingAnimator().end();
|
|
1731
|
-
}
|
|
1732
|
-
|
|
1733
|
-
int distanceToRightEdge = oldRight - getScrollX();
|
|
1734
|
-
int newWidth = right - left;
|
|
1735
|
-
int scrollX = newWidth - distanceToRightEdge;
|
|
1736
|
-
scrollTo(scrollX, getScrollY());
|
|
1737
|
-
|
|
1738
|
-
recreateFlingAnimation(scrollX, newWidth - getWidth());
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1741
|
-
@Nullable
|
|
1742
|
-
@Override
|
|
1743
|
-
public StateWrapper getStateWrapper() {
|
|
1744
|
-
return mStateWrapper;
|
|
1745
|
-
}
|
|
1746
|
-
|
|
1747
|
-
public void setStateWrapper(StateWrapper stateWrapper) {
|
|
1748
|
-
mStateWrapper = stateWrapper;
|
|
1749
|
-
}
|
|
1750
|
-
|
|
1751
|
-
@Override
|
|
1752
|
-
public void setReactScrollViewScrollState(ReactScrollViewScrollState scrollState) {
|
|
1753
|
-
mReactScrollViewScrollState = scrollState;
|
|
1754
|
-
if (ReactNativeFeatureFlags.enableViewCulling()
|
|
1755
|
-
|| ReactNativeFeatureFlags.useTraitHiddenOnAndroid()) {
|
|
1756
|
-
Point scrollPosition = scrollState.getLastStateUpdateScroll();
|
|
1757
|
-
restoreScrollTo(scrollPosition.x, scrollPosition.y);
|
|
1758
|
-
}
|
|
1759
|
-
}
|
|
1760
|
-
|
|
1761
|
-
protected void restoreScrollTo(int x, int y) {
|
|
1762
|
-
scrollTo(x, y);
|
|
1763
|
-
}
|
|
1764
|
-
|
|
1765
|
-
@Override
|
|
1766
|
-
public ReactScrollViewScrollState getReactScrollViewScrollState() {
|
|
1767
|
-
return mReactScrollViewScrollState;
|
|
1768
|
-
}
|
|
1769
|
-
|
|
1770
|
-
@Override
|
|
1771
|
-
public void startFlingAnimator(int start, int end) {
|
|
1772
|
-
// Always cancel existing animator before starting the new one. `smoothScrollTo` contains some
|
|
1773
|
-
// logic that, if called multiple times in a short amount of time, will treat all calls as part
|
|
1774
|
-
// of the same animation and will not lengthen the duration of the animation. This means that,
|
|
1775
|
-
// for example, if the user is scrolling rapidly, multiple pages could be considered part of one
|
|
1776
|
-
// animation, causing some page animations to be animated very rapidly - looking like they're
|
|
1777
|
-
// not animated at all.
|
|
1778
|
-
DEFAULT_FLING_ANIMATOR.cancel();
|
|
1779
|
-
|
|
1780
|
-
// Update the fling animator with new values
|
|
1781
|
-
int duration = ReactScrollViewHelper.getDefaultScrollAnimationDuration(getContext());
|
|
1782
|
-
DEFAULT_FLING_ANIMATOR.setDuration(duration).setIntValues(start, end);
|
|
1783
|
-
|
|
1784
|
-
// Start the animator
|
|
1785
|
-
DEFAULT_FLING_ANIMATOR.start();
|
|
1786
|
-
|
|
1787
|
-
if (mSendMomentumEvents) {
|
|
1788
|
-
int xVelocity = 0;
|
|
1789
|
-
if (duration > 0) {
|
|
1790
|
-
xVelocity = (end - start) / duration;
|
|
1791
|
-
}
|
|
1792
|
-
ReactScrollViewHelper.emitScrollMomentumBeginEvent(this, xVelocity, 0);
|
|
1793
|
-
ReactScrollViewHelper.dispatchMomentumEndOnAnimationEnd(this);
|
|
1794
|
-
}
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
|
-
@Override
|
|
1798
|
-
public ValueAnimator getFlingAnimator() {
|
|
1799
|
-
return DEFAULT_FLING_ANIMATOR;
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1802
|
-
@Override
|
|
1803
|
-
public int getFlingExtrapolatedDistance(int velocityX) {
|
|
1804
|
-
// The DEFAULT_FLING_ANIMATOR uses AccelerateDecelerateInterpolator, which is not depending on
|
|
1805
|
-
// the init velocity. We use the overscroller to decide the fling distance.
|
|
1806
|
-
return ReactScrollViewHelper.predictFinalScrollPosition(
|
|
1807
|
-
this, velocityX, 0, Math.max(0, computeHorizontalScrollRange() - getWidth()), 0)
|
|
1808
|
-
.x;
|
|
1809
|
-
}
|
|
1810
|
-
|
|
1811
|
-
public void setPointerEvents(PointerEvents pointerEvents) {
|
|
1812
|
-
mPointerEvents = pointerEvents;
|
|
1813
|
-
}
|
|
1814
|
-
|
|
1815
|
-
public PointerEvents getPointerEvents() {
|
|
1816
|
-
return mPointerEvents;
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1819
|
-
@Override
|
|
1820
|
-
public void setScrollEventThrottle(int scrollEventThrottle) {
|
|
1821
|
-
mScrollEventThrottle = scrollEventThrottle;
|
|
1822
|
-
}
|
|
1823
|
-
|
|
1824
|
-
@Override
|
|
1825
|
-
public int getScrollEventThrottle() {
|
|
1826
|
-
return mScrollEventThrottle;
|
|
1827
|
-
}
|
|
1828
|
-
|
|
1829
|
-
@Override
|
|
1830
|
-
public void setLastScrollDispatchTime(long lastScrollDispatchTime) {
|
|
1831
|
-
mLastScrollDispatchTime = lastScrollDispatchTime;
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1834
|
-
@Override
|
|
1835
|
-
public long getLastScrollDispatchTime() {
|
|
1836
|
-
return mLastScrollDispatchTime;
|
|
1837
|
-
}
|
|
1838
|
-
}
|