Compare commits

..
Author SHA1 Message Date
Nicola Corti a429f4169c Fix tests - take 4 2024-11-05 14:15:39 +00:00
Nicola Corti 05f073d346 Fix tests - take 3 2024-11-05 14:11:50 +00:00
Nicola Corti a0ca57538f Fix tests - take 2 2024-11-05 13:49:14 +00:00
Nicola Corti 292f3a4cab Fix jest tests 2024-11-05 11:49:39 +00:00
Riccardo Cipolleschi 68231cb949 [LOCAL] Revert React 19 to React 18.3.1 2024-11-05 11:49:39 +00:00
184 changed files with 63725 additions and 46923 deletions
-3
View File
@@ -26,9 +26,6 @@
; helloworld
<PROJECT_ROOT>/packages/helloworld/ios/Pods/
; Ignore rn-tester Pods
<PROJECT_ROOT>/packages/rn-tester/Pods/
[untyped]
.*/node_modules/@react-native-community/cli/.*/.*
@@ -3,6 +3,9 @@ description: Prepare iOS Tests
runs:
using: composite
steps:
- name: brew install xcbeautify
run: brew install xcbeautify
shell: bash
- name: Run Ruby Tests
shell: bash
run: |
+4 -4
View File
@@ -121,21 +121,21 @@ runs:
if: ${{ inputs.run-unit-tests != 'true' && inputs.run-e2e-tests == 'false' }}
shell: bash
run: |
xcodebuild build \
set -o pipefail && xcodebuild build \
-workspace packages/rn-tester/RNTesterPods.xcworkspace \
-scheme RNTester \
-sdk iphonesimulator
-sdk iphonesimulator | xcbeautify
- name: Build RNTester (E2E Tests)
shell: bash
if: ${{ inputs.run-e2e-tests == 'true' }}
run: |
xcodebuild \
set -o pipefail && xcodebuild \
-scheme "RNTester" \
-workspace packages/rn-tester/RNTesterPods.xcworkspace \
-configuration "${{ inputs.flavor }}" \
-sdk "iphonesimulator" \
-destination "generic/platform=iOS Simulator" \
-derivedDataPath "/tmp/RNTesterBuild"
-derivedDataPath "/tmp/RNTesterBuild" | xcbeautify
echo "Print path to *.app file"
find "/tmp/RNTesterBuild" -type d -name "*.app"
@@ -1,44 +0,0 @@
name: test-library-on-nightly
description: Tests a library on a nightly
inputs:
library-npm-package:
description: The library npm package to add
required: true
platform:
description: whether we want to build for iOS or Android
required: true
runs:
using: composite
steps:
- name: Create new app
shell: bash
run: |
cd /tmp
npx @react-native-community/cli init RNApp --skip-install --version nightly
- name: Add library
shell: bash
run: |
cd /tmp/RNApp
yarn add ${{ inputs.library-npm-package }}
- name: Build iOS
shell: bash
if: ${{ inputs.platform == 'ios' }}
run: |
cd /tmp/RNApp/ios
bundle install
bundle exec pod install
cd ..
yarn ios
- name: Setup Java for Android
if: ${{ inputs.platform == 'android' }}
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'zulu'
- name: Build Android
shell: bash
if: ${{ inputs.platform == 'android' }}
run: |
cd /tmp/RNApp/android
./gradlew assembleDebug
+41 -29
View File
@@ -48,84 +48,96 @@ module.exports = async (github, context, labelWithContext) => {
switch (labelWithContext.label) {
case 'Type: Invalid':
await addComment(
`> [!CAUTION]\n` +
`> **Invalid issue**: This issue is not valid, either is not a bug in React Native, it doesn't match any of the issue template, or we can't help further with this.`,
`| :warning: | Issue is Invalid |\n` +
`| --- | --- |\n` +
`| :information_source: | This issue doesn't match any of the expected types for this repository - closing. |`,
);
await closeIssue();
return;
case 'Type: Question':
await addComment(
`> [!NOTE]\n` +
`> **Not a bug report**: This issue looks like a question. We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native), or on [Reactiflux](https://www.reactiflux.com/).`,
);
await closeIssue();
return;
case 'Resolution: For Stack Overflow':
await addComment(
`> [!NOTE]\n` +
`> **Not a bug report**: This issue looks like a question. We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native), or on [Reactiflux](https://www.reactiflux.com/).`,
`| :warning: | Issue is a Question |\n` +
`| --- | --- |\n` +
`| :information_source: | We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native), or on [Reactiflux](https://www.reactiflux.com/). |`,
);
await closeIssue();
return;
case 'Type: Docs':
await addComment(
`> [!NOTE]\n` +
`> **Docs issue**: This issue looks like an issue related to our docs. Please report documentation issues in the [react-native-website](https://github.com/facebook/react-native-website/issues) repository.`,
`| :warning: | Documentation Issue |\n` +
`| --- | --- |\n` +
`| :information_source: | Please report documentation issues in the [react-native-website](https://github.com/facebook/react-native-website/issues) repository. |`,
);
await closeIssue();
return;
case 'Resolution: For Stack Overflow':
await addComment(
`| :warning: | Issue is a Question |\n` +
`| --- | --- |\n` +
`| :information_source: | We are using GitHub issues exclusively to track bugs in the core React Native library. Please try asking over on [Stack Overflow](http://stackoverflow.com/questions/tagged/react-native) as it is better suited for this type of question. |`,
);
await closeIssue();
return;
case 'Type: Expo':
await addComment(
`> [!NOTE]\n` +
`> **Expo related**: It looks like your issue is related to Expo and not React Native core. Please open your issue in [Expo's repository](https://github.com/expo/expo/issues/new). If you are able to create a repro that showcases that this issue is also happening in React Native vanilla, we will be happy to re-open.`,
`| :warning: | Issue is Related to Expo |\n` +
`| --- | --- |\n` +
`| :information_source: | It looks like your issue is related to Expo and not React Native core. Please open your issue in [Expo's repository](https://github.com/expo/expo/issues/new). If you are able to create a repro that showcases that this issue is also happening in React Native vanilla, we will be happy to re-open. |`,
);
await closeIssue();
return;
case 'Needs: Issue Template':
await addComment(
`> [!WARNING]\n` +
`> **Missing issue template**: It looks like your issue may be missing some necessary information. GitHub provides an example template whenever a [new issue is created](https://github.com/facebook/react-native/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A&projects=&template=bug_report.yml). Could you go back and make sure to fill out the template? You may edit this issue, or close it and open a new one.`,
`| :warning: | Missing Required Fields |\n` +
`| --- | --- |\n` +
`| :information_source: | It looks like your issue may be missing some necessary information. GitHub provides an example template whenever a [new issue is created](https://github.com/facebook/react-native/issues/new?template=bug_report.md). Could you go back and make sure to fill out the template? You may edit this issue, or close it and open a new one. |`,
);
await requestAuthorFeedback();
return;
case 'Needs: Environment Info':
await addComment(
`> [!WARNING]\n` +
`> **Missing info**: It looks like your issue may be missing information about your development environment. You can obtain the missing information by running <code>react-native info</code> in a console.`,
`| :warning: | Missing Environment Information |\n` +
`| --- | --- |\n` +
`| :information_source: | Your issue may be missing information about your development environment. You can obtain the missing information by running <code>react-native info</code> in a console. |`,
);
await requestAuthorFeedback();
return;
case 'Newer Patch Available':
await addComment(
`> [!TIP]\n` +
`> **Newer version available**: You are on a supported minor version, but it looks like there's a newer patch available - ${labelWithContext.newestPatch}. Please [upgrade](https://reactnative.dev/docs/upgrading) to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.`,
`| :warning: | Newer Version of React Native is Available! |\n` +
`| --- | --- |\n` +
`| :information_source: | You are on a supported minor version, but it looks like there's a newer patch available - ${labelWithContext.newestPatch}. Please [upgrade](https://reactnative.dev/docs/upgrading) to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |`,
);
return;
case 'Needs: Version Info':
await addComment(
`> [!WARNING]\n` +
`> **Could not parse version**: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.`,
`| :warning: | Add or Reformat Version Info |\n` +
`| --- | --- |\n` +
`| :information_source: | We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.70.2 |`,
);
await requestAuthorFeedback();
return;
case 'Needs: Repro':
await addComment(
`> [!WARNING]\n` +
`> **Missing reproducer**: We could not detect a reproducible example in your issue report. Please provide either: <br/><ul><li>If your bug is UI related: a [Snack](https://snack.expo.dev)</li><li> If your bug is build/upgrade related: a project using our [Reproducer Template](https://github.com/react-native-community/reproducer-react-native/generate)</li><li>Otherwise send us a Pull Request with the [RNTesterPlayground.js](https://github.com/facebook/react-native/blob/main/packages/rn-tester/js/examples/Playground/RNTesterPlayground.js) edited to reproduce your bug.</li></ul>`,
`| :warning: | Missing Reproducible Example |\n` +
`| --- | --- |\n` +
`| :information_source: | We could not detect a reproducible example in your issue report. Please provide either: <br /><ul><li>If your bug is UI related: a [Snack](https://snack.expo.dev)</li><li> If your bug is build/update related: use our [Reproducer Template](https://github.com/react-native-community/reproducer-react-native/generate)</li></ul> |`,
);
await requestAuthorFeedback();
return;
case 'Type: Unsupported Version':
await addComment(
`> [!WARNING]\n` +
`> **Unsupported version**: It looks like your issue or the example you provided uses an [unsupported version of React Native](https://github.com/reactwg/react-native-releases/blob/main/docs/support.md).<br/><br/>Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support.`,
`| :warning: | Unsupported Version of React Native |\n` +
`| --- | --- |\n` +
`| :information_source: | It looks like your issue or the example you provided uses an [unsupported version of React Native](https://github.com/reactwg/react-native-releases/blob/main/README.md#releases-support-policy).<br/><br/>Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support. |`,
);
await requestAuthorFeedback();
return;
case 'Type: Too Old Version':
await addComment(
`> [!CAUTION]\n` +
`> **Too old version**: It looks like your issue or the example you provided uses a [**Too Old Version of React Native**](https://github.com/reactwg/react-native-releases/blob/main/docs/support.md).<br/><br/>Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support.`,
`| :warning: | Too Old Version of React Native |\n` +
`| --- | --- |\n` +
`| :information_source: | It looks like your issue or the example you provided uses a [**Too Old Version of React Native**](https://github.com/reactwg/react-native-releases/blob/main/README.md#releases-support-policy).<br/><br/>Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please [upgrade](https://reactnative.dev/docs/upgrading) to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on [StackOverflow](https://stackoverflow.com/questions/tagged/react-native) to get further community support. |`,
);
await closeIssue();
return;
+25 -1
View File
@@ -9,6 +9,11 @@
const NEEDS_REPRO_LABEL = 'Needs: Repro';
const NEEDS_AUTHOR_FEEDBACK_LABEL = 'Needs: Author Feedback';
const NEEDS_REPRO_HEADER = 'Missing Reproducible Example';
const NEEDS_REPRO_MESSAGE =
`| :warning: | Missing Reproducible Example |\n` +
`| --- | --- |\n` +
`| :information_source: | We could not detect a reproducible example in your issue report. Please provide either: <br /><ul><li>If your bug is UI related: a [Snack](https://snack.expo.dev)</li><li> If your bug is build/update related: use our [Reproducer Template](https://github.com/react-native-community/reproducer-react-native/generate). A reproducer needs to be in a GitHub repository under your username.</li></ul> |`;
const SKIP_ISSUES_OLDER_THAN = '2023-07-01T00:00:00Z';
module.exports = async (github, context) => {
@@ -20,6 +25,7 @@ module.exports = async (github, context) => {
const issue = await github.rest.issues.get(issueData);
const comments = await github.rest.issues.listComments(issueData);
const author = issue.data.user.login;
const issueDate = issue.data.created_at;
@@ -37,6 +43,10 @@ module.exports = async (github, context) => {
return;
}
const botComment = comments.data.find(comment =>
comment.body.includes(NEEDS_REPRO_HEADER),
);
const entities = [issue.data, ...comments.data];
// Look for Snack or a GH repo associated with the user that added an issue or comment
@@ -64,11 +74,25 @@ module.exports = async (github, context) => {
throw error;
}
}
if (!botComment) return;
await github.rest.issues.deleteComment({
...issueData,
comment_id: botComment.id,
});
} else {
await github.rest.issues.addLabels({
...issueData,
labels: [NEEDS_REPRO_LABEL, NEEDS_AUTHOR_FEEDBACK_LABEL],
});
if (botComment) return;
await github.rest.issues.createComment({
...issueData,
body: NEEDS_REPRO_MESSAGE,
});
}
};
@@ -77,7 +101,7 @@ function containsPattern(body, pattern) {
return body.search(regexp) !== -1;
}
// Prevents the bot from responding when maintainer has changed the 'Needs: Repro' label
// Prevents the bot from responding when maintainer has changed Needs: Repro the label
async function hasMaintainerChangedLabel(github, issueData, author) {
const timeline = await github.rest.issues.listEventsForTimeline(issueData);
@@ -10,6 +10,11 @@
module.exports = async (github, context) => {
const issue = context.payload.issue;
// Ignore issues using upgrade template (they use a special label)
if (issue.labels.find(label => label.name === 'Type: Upgrade Issue')) {
return;
}
const issueVersionUnparsed =
getReactNativeVersionFromIssueBodyIfExists(issue);
const issueVersion = parseVersionFromString(issueVersionUnparsed);
-6
View File
@@ -13,8 +13,6 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check nightly
run: |
TODAY=$(date "+%Y%m%d")
@@ -26,7 +24,3 @@ jobs:
else
echo 'Nightly Worked, All Good!'
fi
test-libraries:
uses: ./.github/workflows/test-libraries-on-nightlies.yml
needs: check-nightly
@@ -1,75 +0,0 @@
name: Test Libraries on Nightlies
on:
workflow_call:
jobs:
test-library-on-nightly-android:
name: "[Android] ${{ matrix.library }}"
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
library: [
"react-native-async-storage",
"react-native-blob-util",
"@react-native-clipboard/clipboard",
"@react-native-community/datetimepicker",
"react-native-gesture-handler",
"react-native-image-picker",
"react-native-linear-gradient",
"@react-native-masked-view/masked-view",
"react-native-maps",
"@react-native-community/netinfo",
"react-native-reanimated",
"react-native-svg",
"react-native-video",
"react-native-webview",
"react-native-mmkv",
"react-native-screens",
"react-native-pager-view",
"@react-native-community/slider"
]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test ${{ inputs.library-name }}
uses: ./.github/actions/test-library-on-nightly
with:
library-npm-package: ${{ matrix.library }}
platform: android
test-library-on-nightly-ios:
name: "[iOS] ${{ matrix.library }}"
runs-on: macos-13-large
continue-on-error: true
strategy:
matrix:
library: [
"react-native-async-storage",
"react-native-blob-util",
"@react-native-clipboard/clipboard",
"@react-native-community/datetimepicker",
"react-native-gesture-handler",
"react-native-image-picker",
"react-native-linear-gradient",
"@react-native-masked-view/masked-view",
"react-native-maps",
"@react-native-community/netinfo",
"react-native-reanimated",
"react-native-svg",
"react-native-video",
"react-native-webview",
"react-native-mmkv",
"react-native-screens",
"react-native-pager-view",
"@react-native-community/slider"
]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test ${{ inputs.library-name }}
uses: ./.github/actions/test-library-on-nightly
with:
library-npm-package: ${{ matrix.library }}
platform: ios
+1 -1
View File
@@ -124,7 +124,7 @@ vendor/
!/packages/rn-tester/Pods/__offline_mirrors_jsc__
# @react-native/codegen
/packages/react-native/React/FBReactNativeSpec/
/packages/react-native/React/FBReactNativeSpec/FBReactNativeSpec
/packages/react-native-codegen/lib
/packages/react-native-codegen/tmp/
/packages/react-native/ReactCommon/react/renderer/components/rncore/
+2 -5
View File
@@ -93,16 +93,13 @@
"nullthrows": "^1.1.1",
"prettier": "2.8.8",
"prettier-plugin-hermes-parser": "0.24.0",
"react": "19.0.0-rc-fb9a90fa48-20240614",
"react-test-renderer": "19.0.0-rc-fb9a90fa48-20240614",
"react": "18.3.1",
"react-test-renderer": "18.3.1",
"rimraf": "^3.0.2",
"shelljs": "^0.8.5",
"signedsource": "^1.0.0",
"supports-color": "^7.1.0",
"typescript": "5.0.4",
"ws": "^6.2.3"
},
"resolutions": {
"react-is": "19.0.0-rc-fb9a90fa48-20240614"
}
}
@@ -19,7 +19,10 @@ import isDevServerRunning from '../../utils/isDevServerRunning';
import loadMetroConfig from '../../utils/loadMetroConfig';
import * as version from '../../utils/version';
import attachKeyHandlers from './attachKeyHandlers';
import {createDevServerMiddleware, indexPageMiddleware} from './middleware';
import {
createDevServerMiddleware,
indexPageMiddleware,
} from '@react-native-community/cli-server-api';
import {createDevMiddleware} from '@react-native/dev-middleware';
import chalk from 'chalk';
import Metro from 'metro';
+2 -2
View File
@@ -12,7 +12,7 @@
"test": "jest"
},
"dependencies": {
"react": "19.0.0-rc-fb9a90fa48-20240614",
"react": "18.3.1",
"react-native": "1000.0.0"
},
"devDependencies": {
@@ -28,7 +28,7 @@
"eslint": "^8.19.0",
"jest": "^29.6.3",
"listr2": "^8.2.1",
"react-test-renderer": "19.0.0-rc-fb9a90fa48-20240614",
"react-test-renderer": "18.3.1",
"rxjs": "^7.8.1"
},
"engines": {
-42
View File
@@ -553,48 +553,6 @@ if (global.nativeLoggingHook) {
assert: consoleAssertPolyfill,
};
// TODO(T206796580): This was copy-pasted from ExceptionsManager.js
// Delete the copy there after the c++ pipeline is rolled out everywhere.
if (global.RN$useAlwaysAvailableJSErrorHandling === true) {
let originalConsoleError = console.error;
console.reportErrorsAsExceptions = true;
function stringifySafe(arg) {
return inspect(arg, {depth: 10}).replaceAll(/\n\s*/g, ' ');
}
console.error = function (...args) {
originalConsoleError.apply(this, args);
if (!console.reportErrorsAsExceptions) {
return;
}
if (global.RN$inExceptionHandler?.()) {
return;
}
let error;
const firstArg = args[0];
if (firstArg?.stack) {
// RN$handleException will console.error this with high enough fidelity.
error = firstArg;
} else {
if (typeof firstArg === 'string' && firstArg.startsWith('Warning: ')) {
// React warnings use console.error so that a stack trace is shown, but
// we don't (currently) want these to show a redbox
return;
}
const message = args
.map(arg => (typeof arg === 'string' ? arg : stringifySafe(arg)))
.join(' ');
error = new Error(message);
error.name = 'console.error';
}
const isFatal = false;
const reportToConsole = false;
global.RN$handleException(error, isFatal, reportToConsole);
};
}
Object.defineProperty(console, '_isPolyfilled', {
value: true,
enumerable: false,
+6 -6
View File
@@ -19,12 +19,12 @@ type Fn<Args, Return> = (...Args) => Return;
* when loading a module. This will report any errors encountered before
* ExceptionsManager is configured.
*/
let _globalHandler: ErrorHandler =
global.RN$useAlwaysAvailableJSErrorHandling === true
? global.RN$handleException
: (e: mixed, isFatal: boolean) => {
throw e;
};
let _globalHandler: ErrorHandler = function onError(
e: mixed,
isFatal: boolean,
) {
throw e;
};
/**
* The particular require runtime that we are using looks for a global
@@ -8,7 +8,6 @@
* @format
*/
import type {SectionBase} from '../../Lists/SectionList';
import type {AnimatedComponentType} from '../createAnimatedComponent';
import SectionList from '../../Lists/SectionList';
@@ -17,6 +16,5 @@ import * as React from 'react';
export default (createAnimatedComponent(SectionList): AnimatedComponentType<
React.ElementConfig<typeof SectionList>,
// $FlowExpectedError[unclear-type]
SectionList<SectionBase<any>>,
React.ElementRef<typeof SectionList>,
>);
@@ -26,6 +26,7 @@
#import <React/RCTFabricSurface.h>
#import <React/RCTSurfaceHostingProxyRootView.h>
#import <React/RCTSurfacePresenter.h>
#import <ReactCommon/RCTContextContainerHandling.h>
#if USE_HERMES
#import <ReactCommon/RCTHermesInstance.h>
#else
@@ -34,6 +35,7 @@
#import <ReactCommon/RCTHost+Internal.h>
#import <ReactCommon/RCTHost.h>
#import <ReactCommon/RCTTurboModuleManager.h>
#import <react/config/ReactNativeConfig.h>
#import <react/renderer/runtimescheduler/RuntimeScheduler.h>
#import <react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h>
#import <react/runtime/JSRuntimeFactory.h>
@@ -97,8 +99,13 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
@end
@interface RCTRootViewFactory () <RCTCxxBridgeDelegate> {
@interface RCTRootViewFactory () <RCTContextContainerHandling> {
std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
facebook::react::ContextContainer::Shared _contextContainer;
}
@end
@interface RCTRootViewFactory () <RCTCxxBridgeDelegate> {
std::shared_ptr<facebook::react::RuntimeScheduler> _runtimeScheduler;
}
@end
@@ -117,6 +124,8 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
_configuration = configuration;
_hostDelegate = hostdelegate;
_contextContainer = std::make_shared<const facebook::react::ContextContainer>();
_reactNativeConfig = std::make_shared<const facebook::react::EmptyReactNativeConfig>();
_contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
_turboModuleManagerDelegate = turboModuleManagerDelegate;
}
return self;
@@ -272,6 +281,7 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
[reactHost setBundleURLProvider:^NSURL *() {
return [weakSelf bundleURL];
}];
[reactHost setContextContainerHandler:self];
[reactHost start];
return reactHost;
}
@@ -279,12 +289,18 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
- (std::shared_ptr<facebook::react::JSRuntimeFactory>)createJSRuntimeFactory
{
#if USE_HERMES
return std::make_shared<facebook::react::RCTHermesInstance>(nullptr, nullptr, /* allocInOldGenBeforeTTI */ false);
return std::make_shared<facebook::react::RCTHermesInstance>(
_reactNativeConfig, nullptr, /* allocInOldGenBeforeTTI */ false);
#else
return std::make_shared<facebook::react::RCTJscInstance>();
#endif
}
- (void)didCreateContextContainer:(std::shared_ptr<facebook::react::ContextContainer>)contextContainer
{
contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
}
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge
{
if (_configuration.extraModulesForBridge != nil) {
@@ -74,7 +74,7 @@ Pod::Spec.new do |s|
s.dependency "React-RCTImage"
s.dependency "React-CoreModules"
s.dependency "React-nativeconfig"
s.dependency "React-RCTFBReactNativeSpec"
s.dependency "ReactCodegen"
s.dependency "React-defaultsnativemodule"
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
@@ -57,7 +57,7 @@ Pod::Spec.new do |s|
s.dependency "React-Core/RCTWebSocket"
s.dependency "React-RCTNetwork"
add_dependency(s, "React-RCTFBReactNativeSpec")
add_dependency(s, "ReactCodegen")
add_dependency(s, "React-NativeModulesApple")
add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern')
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
@@ -31,6 +31,7 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
pagingEnabled: true,
persistentScrollbar: true,
horizontal: true,
enableSyncOnScroll: true,
scrollEnabled: true,
scrollEventThrottle: true,
scrollPerfTag: true,
@@ -8,6 +8,10 @@
* @flow strict-local
*/
import type {
TScrollViewNativeComponentInstance,
TScrollViewNativeImperativeHandle,
} from '../../../src/private/components/useSyncOnScroll';
import type {HostInstance} from '../../Renderer/shims/ReactNativeTypes';
import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType';
import type {PointProp} from '../../StyleSheet/PointPropType';
@@ -42,6 +46,7 @@ import StyleSheet from '../../StyleSheet/StyleSheet';
import Dimensions from '../../Utilities/Dimensions';
import dismissKeyboard from '../../Utilities/dismissKeyboard';
import Platform from '../../Utilities/Platform';
import EventEmitter from '../../vendor/emitter/EventEmitter';
import Keyboard from '../Keyboard/Keyboard';
import TextInputState from '../TextInput/TextInputState';
import processDecelerationRate from './processDecelerationRate';
@@ -147,7 +152,7 @@ export type DecelerationRateType = 'fast' | 'normal' | number;
export type ScrollResponderType = ScrollViewImperativeMethods;
type PublicScrollViewInstance = $ReadOnly<{|
...HostInstance,
...$Exact<TScrollViewNativeComponentInstance>,
...ScrollViewImperativeMethods,
|}>;
@@ -738,6 +743,10 @@ class ScrollView extends React.Component<Props, State> {
_subscriptionKeyboardDidShow: ?EventSubscription = null;
_subscriptionKeyboardDidHide: ?EventSubscription = null;
#onScrollEmitter: ?EventEmitter<{
scroll: [{x: number, y: number}],
}> = null;
state: State = {
layoutHeight: null,
};
@@ -808,6 +817,8 @@ class ScrollView extends React.Component<Props, State> {
if (this._scrollAnimatedValueAttachment) {
this._scrollAnimatedValueAttachment.detach();
}
this.#onScrollEmitter?.removeAllListeners();
}
/**
@@ -833,8 +844,9 @@ class ScrollView extends React.Component<Props, State> {
return this._innerView.nativeInstance;
};
getNativeScrollRef: () => HostInstance | null = () => {
return this._scrollView.nativeInstance;
getNativeScrollRef: () => TScrollViewNativeComponentInstance | null = () => {
const {nativeInstance} = this._scrollView;
return nativeInstance == null ? null : nativeInstance.componentRef.current;
};
/**
@@ -925,6 +937,20 @@ class ScrollView extends React.Component<Props, State> {
Commands.flashScrollIndicators(component);
};
_subscribeToOnScroll: (
callback: ({x: number, y: number}) => void,
) => EventSubscription = callback => {
let onScrollEmitter = this.#onScrollEmitter;
if (onScrollEmitter == null) {
onScrollEmitter = new EventEmitter();
this.#onScrollEmitter = onScrollEmitter;
// This is the first subscription, so make sure the native component is
// also configured to output synchronous scroll events.
this._scrollView.nativeInstance?.unstable_setEnableSyncOnScroll(true);
}
return onScrollEmitter.addListener('scroll', callback);
};
/**
* This method should be used as the callback to onFocus in a TextInputs'
* parent view. Note that any module using this mixin needs to return
@@ -1128,6 +1154,11 @@ class ScrollView extends React.Component<Props, State> {
_handleScroll = (e: ScrollEvent) => {
this._observedScrollSinceBecomingResponder = true;
this.props.onScroll && this.props.onScroll(e);
this.#onScrollEmitter?.emit('scroll', {
x: e.nativeEvent.contentOffset.x,
y: e.nativeEvent.contentOffset.y,
});
};
_handleLayout = (e: LayoutEvent) => {
@@ -1150,36 +1181,45 @@ class ScrollView extends React.Component<Props, State> {
(instance: InnerViewInstance): InnerViewInstance => instance,
);
_scrollView: RefForwarder<HostInstance, PublicScrollViewInstance | null> =
createRefForwarder(nativeInstance => {
// This is a hack. Ideally we would forwardRef to the underlying
// host component. However, since ScrollView has it's own methods that can be
// called as well, if we used the standard forwardRef then these
// methods wouldn't be accessible and thus be a breaking change.
//
// Therefore we edit ref to include ScrollView's public methods so that
// they are callable from the ref.
_scrollView: RefForwarder<
TScrollViewNativeImperativeHandle,
PublicScrollViewInstance | null,
> = createRefForwarder(nativeImperativeHandle => {
const nativeInstance = nativeImperativeHandle.componentRef.current;
if (nativeInstance == null) {
return null;
}
// $FlowFixMe[prop-missing] - Known issue with appending custom methods.
const publicInstance: PublicScrollViewInstance = Object.assign(
nativeInstance,
{
getScrollResponder: this.getScrollResponder,
getScrollableNode: this.getScrollableNode,
getInnerViewNode: this.getInnerViewNode,
getInnerViewRef: this.getInnerViewRef,
getNativeScrollRef: this.getNativeScrollRef,
scrollTo: this.scrollTo,
scrollToEnd: this.scrollToEnd,
flashScrollIndicators: this.flashScrollIndicators,
scrollResponderZoomTo: this.scrollResponderZoomTo,
scrollResponderScrollNativeHandleToKeyboard:
this.scrollResponderScrollNativeHandleToKeyboard,
},
);
// This is a hack. Ideally we would forwardRef to the underlying
// host component. However, since ScrollView has it's own methods that can be
// called as well, if we used the standard forwardRef then these
// methods wouldn't be accessible and thus be a breaking change.
//
// Therefore we edit ref to include ScrollView's public methods so that
// they are callable from the ref.
return publicInstance;
});
// $FlowFixMe[prop-missing] - Known issue with appending custom methods.
const publicInstance: PublicScrollViewInstance = Object.assign(
nativeInstance,
{
getScrollResponder: this.getScrollResponder,
getScrollableNode: this.getScrollableNode,
getInnerViewNode: this.getInnerViewNode,
getInnerViewRef: this.getInnerViewRef,
getNativeScrollRef: this.getNativeScrollRef,
scrollTo: this.scrollTo,
scrollToEnd: this.scrollToEnd,
flashScrollIndicators: this.flashScrollIndicators,
scrollResponderZoomTo: this.scrollResponderZoomTo,
// TODO: Replace unstable_subscribeToOnScroll once scrollView.addEventListener('scroll', (e: ScrollEvent) => {}, {passive: false});
unstable_subscribeToOnScroll: this._subscribeToOnScroll,
scrollResponderScrollNativeHandleToKeyboard:
this.scrollResponderScrollNativeHandleToKeyboard,
},
);
return publicInstance;
});
/**
* Warning, this may be called several times for a single keyboard opening.
@@ -1789,9 +1829,8 @@ class ScrollView extends React.Component<Props, State> {
}
const refreshControl = this.props.refreshControl;
const scrollViewRef = this._scrollView.getForwardingRef(
this.props.scrollViewRef,
);
const scrollViewRef: React.RefSetter<TScrollViewNativeImperativeHandle | null> =
this._scrollView.getForwardingRef(this.props.scrollViewRef);
if (refreshControl) {
if (Platform.OS === 'ios') {
@@ -45,6 +45,7 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
diff: require('../../Utilities/differ/pointsDiffer'),
},
decelerationRate: true,
enableSyncOnScroll: true, // Fabric only.
disableIntervalMomentum: true,
maintainVisibleContentPosition: true,
pagingEnabled: true,
@@ -134,6 +135,7 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
contentInsetAdjustmentBehavior: true,
decelerationRate: true,
endDraggingSensitivityMultiplier: true,
enableSyncOnScroll: true, // Fabric only.
directionalLockEnabled: true,
disableIntervalMomentum: true,
indicatorStyle: true,
@@ -301,6 +301,7 @@ const ScrollViewStickyHeaderWithForwardedRef: component(
const styles = StyleSheet.create({
header: {
zIndex: 10,
position: 'relative',
},
fill: {
flex: 1,
@@ -211,11 +211,4 @@ export interface ViewProps
* Used to reference react managed views from native code.
*/
nativeID?: string | undefined;
/**
* Contols whether this view, and its transitive children, are laid in a way
* consistent with web browsers ('strict'), or consistent with existing
* React Native code which may rely on incorrect behavior ('classic').
*/
experimental_layoutConformance?: 'strict' | 'classic' | undefined;
}
+4 -1
View File
@@ -177,7 +177,10 @@ function reactConsoleErrorHandler(...args) {
if (!console.reportErrorsAsExceptions) {
return;
}
if (inExceptionHandler || global.RN$inExceptionHandler?.()) {
if (
inExceptionHandler ||
(global.RN$inExceptionHandler && global.RN$inExceptionHandler())
) {
// The fundamental trick here is that are multiple entry point to logging errors:
// (see D19743075 for more background)
//
+18 -20
View File
@@ -10,26 +10,24 @@
'use strict';
if (global.RN$useAlwaysAvailableJSErrorHandling !== true) {
/**
* Sets up the console and exception handling (redbox) for React Native.
* You can use this module directly, or just require InitializeCore.
*/
const ExceptionsManager = require('./ExceptionsManager');
ExceptionsManager.installConsoleErrorReporter();
/**
* Sets up the console and exception handling (redbox) for React Native.
* You can use this module directly, or just require InitializeCore.
*/
const ExceptionsManager = require('./ExceptionsManager');
ExceptionsManager.installConsoleErrorReporter();
// Set up error handler
if (!global.__fbDisableExceptionsManager) {
const handleError = (e: mixed, isFatal: boolean) => {
try {
ExceptionsManager.handleException(e, isFatal);
} catch (ee) {
console.log('Failed to print error: ', ee.message);
throw e;
}
};
// Set up error handler
if (!global.__fbDisableExceptionsManager) {
const handleError = (e: mixed, isFatal: boolean) => {
try {
ExceptionsManager.handleException(e, isFatal);
} catch (ee) {
console.log('Failed to print error: ', ee.message);
throw e;
}
};
const ErrorUtils = require('../vendor/core/ErrorUtils');
ErrorUtils.setGlobalHandler(handleError);
}
const ErrorUtils = require('../vendor/core/ErrorUtils');
ErrorUtils.setGlobalHandler(handleError);
}
-2
View File
@@ -200,8 +200,6 @@ export interface ImagePropsBase
* 'center': Scale the image down so that it is completely visible,
* if bigger than the area of the view.
* The image will not be scaled up.
*
* 'none': Do not resize the image. The image will be displayed at its intrinsic size.
*/
resizeMode?: ImageResizeMode | undefined;
+1 -2
View File
@@ -19,7 +19,6 @@ import type {
} from '../StyleSheet/StyleSheet';
import type {LayoutEvent, SyntheticEvent} from '../Types/CoreEventTypes';
import typeof Image from './Image';
import type {ImageResizeMode} from './ImageResizeMode';
import type {ImageSource} from './ImageSource';
import type {ElementRef, Node, RefSetter} from 'react';
@@ -235,7 +234,7 @@ export type ImageProps = $ReadOnly<{|
*
* See https://reactnative.dev/docs/image#resizemode
*/
resizeMode?: ?ImageResizeMode,
resizeMode?: ?('cover' | 'contain' | 'stretch' | 'repeat' | 'center'),
/**
* A unique identifier for this element to be used in UI Automation
+1 -8
View File
@@ -12,8 +12,7 @@ export type ImageResizeMode =
| 'contain'
| 'stretch'
| 'repeat'
| 'center'
| 'none';
| 'center';
/**
* @see ImageResizeMode.js
@@ -47,10 +46,4 @@ export interface ImageResizeModeStatic {
* image will keep it's size and aspect ratio.
*/
repeat: ImageResizeMode;
/**
* none - The image will be displayed at its intrinsic size, which means the
* image will not be scaled up or down.
*/
none: ImageResizeMode;
}
+1 -4
View File
@@ -33,7 +33,4 @@ export type ImageResizeMode =
// Resize by stretching it to fill the entire frame of the view without
// clipping. This may change the aspect ratio of the image, distorting it.
| 'stretch'
// The image will not be resized at all.
| 'none';
| 'stretch';
+3 -6
View File
@@ -8,18 +8,15 @@
* @format
*/
import type {ImageResizeMode} from './ImageResizeMode';
type ResizeMode = 'cover' | 'contain' | 'stretch' | 'repeat' | 'center';
const objectFitMap: {[string]: ImageResizeMode} = {
const objectFitMap: {[string]: ResizeMode} = {
contain: 'contain',
cover: 'cover',
fill: 'stretch',
'scale-down': 'contain',
none: 'none',
};
export function convertObjectFitToResizeMode(
objectFit: ?string,
): ?ImageResizeMode {
export function convertObjectFitToResizeMode(objectFit: ?string): ?ResizeMode {
return objectFit != null ? objectFitMap[objectFit] : undefined;
}
@@ -477,7 +477,10 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image, CGSize size, CGFloat scal
// Add missing png extension
if (request.URL.fileURL && request.URL.pathExtension.length == 0) {
mutableRequest.URL = [request.URL URLByAppendingPathExtension:@"png"];
NSURL *pngRequestURL = [request.URL URLByAppendingPathExtension:@"png"];
if ([[NSFileManager defaultManager] fileExistsAtPath:pngRequestURL.path]) {
mutableRequest.URL = pngRequestURL;
}
}
if (_redirectDelegate != nil) {
mutableRequest.URL = [_redirectDelegate redirectAssetsURL:mutableRequest.URL];
@@ -85,7 +85,6 @@ CGRect RCTTargetRect(CGSize sourceSize, CGSize destSize, CGFloat destScale, RCTR
switch (resizeMode) {
case RCTResizeModeStretch:
case RCTResizeModeRepeat:
case RCTResizeModeNone:
return (CGRect){CGPointZero, RCTCeilSize(destSize, destScale)};
@@ -250,7 +249,6 @@ BOOL RCTUpscalingRequired(
case RCTResizeModeRepeat:
case RCTResizeModeCenter:
case RCTResizeModeNone:
return NO;
}
@@ -13,7 +13,6 @@ typedef NS_ENUM(NSInteger, RCTResizeMode) {
RCTResizeModeStretch = UIViewContentModeScaleToFill,
RCTResizeModeCenter = UIViewContentModeCenter,
RCTResizeModeRepeat = -1, // Use negative values to avoid conflicts with iOS enum values.
RCTResizeModeNone = UIViewContentModeTopLeft,
};
static inline RCTResizeMode RCTResizeModeFromUIViewContentMode(UIViewContentMode mode)
@@ -31,14 +30,12 @@ static inline RCTResizeMode RCTResizeModeFromUIViewContentMode(UIViewContentMode
case UIViewContentModeCenter:
return RCTResizeModeCenter;
break;
case UIViewContentModeTopLeft:
return RCTResizeModeNone;
break;
case UIViewContentModeRedraw:
case UIViewContentModeTop:
case UIViewContentModeBottom:
case UIViewContentModeLeft:
case UIViewContentModeRight:
case UIViewContentModeTopLeft:
case UIViewContentModeTopRight:
case UIViewContentModeBottomLeft:
case UIViewContentModeBottomRight:
@@ -17,7 +17,6 @@ RCT_ENUM_CONVERTER(
@"stretch" : @(RCTResizeModeStretch),
@"center" : @(RCTResizeModeCenter),
@"repeat" : @(RCTResizeModeRepeat),
@"none" : @(RCTResizeModeNone),
}),
RCTResizeModeStretch,
integerValue)
@@ -53,7 +53,7 @@ Pod::Spec.new do |s|
s.dependency "React-Core/RCTImageHeaders"
s.dependency "React-RCTNetwork"
add_dependency(s, "React-RCTFBReactNativeSpec")
add_dependency(s, "ReactCodegen")
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple")
@@ -10,7 +10,6 @@
import type {Task} from './TaskQueue';
import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
import EventEmitter from '../vendor/emitter/EventEmitter';
const BatchedBridge = require('../BatchedBridge/BatchedBridge');
@@ -209,8 +208,4 @@ function _processUpdate() {
_deleteInteractionSet.clear();
}
module.exports = (
ReactNativeFeatureFlags.disableInteractionManager()
? require('./InteractionManagerStub')
: InteractionManager
) as typeof InteractionManager;
module.exports = InteractionManager;
@@ -1,176 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
import type {EventSubscription} from '../vendor/emitter/EventEmitter';
const invariant = require('invariant');
export type Handle = number;
type Task =
| {
name: string,
run: () => void,
}
| {
name: string,
gen: () => Promise<void>,
}
| (() => void);
/**
* InteractionManager allows long-running work to be scheduled after any
* interactions/animations have completed. In particular, this allows JavaScript
* animations to run smoothly.
*
* Applications can schedule tasks to run after interactions with the following:
*
* ```
* InteractionManager.runAfterInteractions(() => {
* // ...long-running synchronous task...
* });
* ```
*
* Compare this to other scheduling alternatives:
*
* - requestAnimationFrame(): for code that animates a view over time.
* - setImmediate/setTimeout(): run code later, note this may delay animations.
* - runAfterInteractions(): run code later, without delaying active animations.
*
* The touch handling system considers one or more active touches to be an
* 'interaction' and will delay `runAfterInteractions()` callbacks until all
* touches have ended or been cancelled.
*
* InteractionManager also allows applications to register animations by
* creating an interaction 'handle' on animation start, and clearing it upon
* completion:
*
* ```
* var handle = InteractionManager.createInteractionHandle();
* // run animation... (`runAfterInteractions` tasks are queued)
* // later, on animation completion:
* InteractionManager.clearInteractionHandle(handle);
* // queued tasks run if all handles were cleared
* ```
*
* `runAfterInteractions` takes either a plain callback function, or a
* `PromiseTask` object with a `gen` method that returns a `Promise`. If a
* `PromiseTask` is supplied, then it is fully resolved (including asynchronous
* dependencies that also schedule more tasks via `runAfterInteractions`) before
* starting on the next task that might have been queued up synchronously
* earlier.
*
* By default, queued tasks are executed together in a loop in one
* `setImmediate` batch. If `setDeadline` is called with a positive number, then
* tasks will only be executed until the deadline (in terms of js event loop run
* time) approaches, at which point execution will yield via setTimeout,
* allowing events such as touches to start interactions and block queued tasks
* from executing, making apps more responsive.
*
* @deprecated
*/
const InteractionManagerStub = {
Events: {
interactionStart: 'interactionStart',
interactionComplete: 'interactionComplete',
},
/**
* Schedule a function to run after all interactions have completed. Returns a cancellable
* "promise".
*
* @deprecated
*/
runAfterInteractions(task: ?Task): {
then: <U>(
onFulfill?: ?(void) => ?(Promise<U> | U),
onReject?: ?(error: mixed) => ?(Promise<U> | U),
) => Promise<U>,
cancel: () => void,
...
} {
let immediateID: ?$FlowIssue;
const promise = new Promise((resolve, reject) => {
immediateID = setImmediate(() => {
if (typeof task === 'object' && task !== null) {
if (typeof task.gen === 'function') {
task.gen().then(resolve, reject);
} else if (typeof task.run === 'function') {
try {
task.run();
resolve();
} catch (error) {
reject(error);
}
} else {
reject(new TypeError(`Task "${task.name}" missing gen or run.`));
}
} else if (typeof task === 'function') {
try {
task();
resolve();
} catch (error) {
reject(error);
}
} else {
reject(new TypeError('Invalid task of type: ' + typeof task));
}
});
});
return {
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
then: promise.then.bind(promise),
cancel() {
clearImmediate(immediateID);
},
};
},
/**
* Notify manager that an interaction has started.
*
* @deprecated
*/
createInteractionHandle(): Handle {
return -1;
},
/**
* Notify manager that an interaction has completed.
*
* @deprecated
*/
clearInteractionHandle(handle: Handle) {
invariant(!!handle, 'InteractionManager: Must provide a handle to clear.');
},
/**
* @deprecated
*/
addListener(): EventSubscription {
return {
remove() {},
};
},
/**
* A positive number will use setTimeout to schedule any tasks after the
* eventLoopRunningTime hits the deadline value, otherwise all tasks will be
* executed in one setImmediate batch (default).
*
* @deprecated
*/
setDeadline(deadline: number) {
// Do nothing.
},
};
module.exports = InteractionManagerStub;
@@ -50,7 +50,7 @@ Pod::Spec.new do |s|
s.dependency "ReactCommon/turbomodule/core", version
s.dependency "React-jsi", version
add_dependency(s, "React-RCTFBReactNativeSpec")
add_dependency(s, "ReactCodegen", :additional_framework_paths => ["build/generated/ios"])
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
end
+1 -1
View File
@@ -55,7 +55,7 @@ if (__DEV__) {
if (global.RN$registerExceptionListener != null) {
global.RN$registerExceptionListener(
(error: ExtendedExceptionData & {preventDefault: () => mixed}) => {
if (global.RN$isRuntimeReady?.() || !error.isFatal) {
if (!error.isFatal) {
error.preventDefault();
addException(error);
}
@@ -80,7 +80,7 @@ describe('LogBox', () => {
expect(mockWarn).not.toBeCalled();
expect(console.error).toBeCalledTimes(1);
expect(console.error.mock.calls[0]).toEqual([
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.%s',
'Warning: Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.%s',
'\n\nCheck the render method of `DoesNotUseKey`.',
'',
expect.stringMatching('at DoesNotUseKey'),
@@ -94,7 +94,7 @@ describe('LogBox', () => {
componentStackType: 'stack',
message: {
content:
'Warning: Each child in a list should have a unique "key" prop.\n\nCheck the render method of `DoesNotUseKey`. See https://react.dev/link/warning-keys for more information.',
'Warning: Each child in a list should have a unique "key" prop.\n\nCheck the render method of `DoesNotUseKey`. See https://reactjs.org/link/warning-keys for more information.',
substitutions: [
{length: 45, offset: 62},
{length: 0, offset: 107},
@@ -106,7 +106,7 @@ describe('LogBox', () => {
// We also interpolate the string before passing to the underlying console method.
expect(mockError.mock.calls[0]).toEqual([
expect.stringMatching(
'Warning: Each child in a list should have a unique "key" prop.\n\nCheck the render method of `DoesNotUseKey`. See https://react.dev/link/warning-keys for more information.\n at ',
'Warning: Each child in a list should have a unique "key" prop.\n\nCheck the render method of `DoesNotUseKey`. See https://reactjs.org/link/warning-keys for more information.\n at ',
),
]);
});
@@ -134,7 +134,7 @@ describe('LogBox', () => {
expect(mockWarn).not.toBeCalled();
expect(console.error).toBeCalledTimes(1);
expect(console.error.mock.calls[0]).toEqual([
'Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.%s',
'Warning: Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.%s',
'invalid',
expect.stringMatching('at FragmentWithProp'),
]);
-5
View File
@@ -101,11 +101,6 @@ export interface ModalPropsAndroid {
* Determines whether your modal should go under the system statusbar.
*/
statusBarTranslucent?: boolean | undefined;
/**
* Determines whether your modal should go under the system navigationbar.
*/
navigationBarTranslucent?: boolean | undefined;
}
export type ModalProps = ModalBaseProps &
-17
View File
@@ -95,14 +95,6 @@ export type Props = $ReadOnly<{|
*/
statusBarTranslucent?: ?boolean,
/**
* The `navigationBarTranslucent` prop determines whether your modal should go under
* the system navigationbar.
*
* See https://reactnative.dev/docs/modal.html#navigationbartranslucent-android
*/
navigationBarTranslucent?: ?boolean,
/**
* The `hardwareAccelerated` prop controls whether to force hardware
* acceleration for the underlying window.
@@ -184,14 +176,6 @@ function confirmProps(props: Props) {
`Modal with '${props.presentationStyle}' presentation style and 'transparent' value is not supported.`,
);
}
if (
props.navigationBarTranslucent === true &&
props.statusBarTranslucent !== true
) {
console.warn(
'Modal with translucent navigation bar and without translucent status bar is not supported.',
);
}
}
}
@@ -317,7 +301,6 @@ class Modal extends React.Component<Props, State> {
onDismiss={onDismiss}
visible={this.props.visible}
statusBarTranslucent={this.props.statusBarTranslucent}
navigationBarTranslucent={this.props.navigationBarTranslucent}
identifier={this._identifier}
style={styles.modal}
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
@@ -50,7 +50,7 @@ Pod::Spec.new do |s|
s.dependency "React-jsi"
s.dependency "React-Core/RCTAnimationHeaders"
add_dependency(s, "React-RCTFBReactNativeSpec")
add_dependency(s, "ReactCodegen", :additional_framework_paths => ["build/generated/ios"])
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple")
end
@@ -50,7 +50,7 @@ Pod::Spec.new do |s|
s.dependency "React-jsi"
s.dependency "React-Core/RCTNetworkHeaders"
add_dependency(s, "React-RCTFBReactNativeSpec")
add_dependency(s, "ReactCodegen", :additional_framework_paths => ["build/generated/ios"])
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
end
@@ -66,58 +66,11 @@ export interface PermissionsAndroidStatic {
/**
* A list of permission results that are returned
*/
RESULTS: {
[key in 'GRANTED' | 'DENIED' | 'NEVER_ASK_AGAIN']: PermissionStatus;
};
RESULTS: {[key: string]: PermissionStatus};
/**
* A list of specified "dangerous" permissions that require prompting the user
*/
PERMISSIONS: {
[key in
| 'READ_CALENDAR'
| 'WRITE_CALENDAR'
| 'CAMERA'
| 'READ_CONTACTS'
| 'WRITE_CONTACTS'
| 'GET_ACCOUNTS'
| 'ACCESS_FINE_LOCATION'
| 'ACCESS_COARSE_LOCATION'
| 'ACCESS_BACKGROUND_LOCATION'
| 'RECORD_AUDIO'
| 'READ_PHONE_STATE'
| 'CALL_PHONE'
| 'READ_CALL_LOG'
| 'WRITE_CALL_LOG'
| 'ADD_VOICEMAIL'
| 'READ_VOICEMAIL'
| 'WRITE_VOICEMAIL'
| 'USE_SIP'
| 'PROCESS_OUTGOING_CALLS'
| 'BODY_SENSORS'
| 'BODY_SENSORS_BACKGROUND'
| 'SEND_SMS'
| 'RECEIVE_SMS'
| 'READ_SMS'
| 'RECEIVE_WAP_PUSH'
| 'RECEIVE_MMS'
| 'READ_EXTERNAL_STORAGE'
| 'READ_MEDIA_IMAGES'
| 'READ_MEDIA_VIDEO'
| 'READ_MEDIA_AUDIO'
| 'READ_MEDIA_VISUAL_USER_SELECTED'
| 'WRITE_EXTERNAL_STORAGE'
| 'BLUETOOTH_CONNECT'
| 'BLUETOOTH_SCAN'
| 'BLUETOOTH_ADVERTISE'
| 'ACCESS_MEDIA_LOCATION'
| 'ACCEPT_HANDOVER'
| 'ACTIVITY_RECOGNITION'
| 'ANSWER_PHONE_CALLS'
| 'READ_PHONE_NUMBERS'
| 'UWB_RANGING'
| 'POST_NOTIFICATIONS'
| 'NEARBY_WIFI_DEVICES']: Permission;
};
PERMISSIONS: {[key: string]: Permission};
new (): PermissionsAndroidStatic;
/**
* @deprecated Use check instead
@@ -50,7 +50,7 @@ Pod::Spec.new do |s|
s.dependency "React-Core/RCTPushNotificationHeaders"
s.dependency "React-jsi"
add_dependency(s, "React-RCTFBReactNativeSpec")
add_dependency(s, "ReactCodegen", :additional_framework_paths => ["build/generated/ios"])
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple")
end
@@ -0,0 +1,17 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
'use strict';
const createReactNativeComponentClass = require('../Renderer/shims/createReactNativeComponentClass');
module.exports = {
createReactNativeComponentClass,
};
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -50,7 +50,7 @@ Pod::Spec.new do |s|
s.dependency "React-jsi"
s.dependency "React-Core/RCTSettingsHeaders"
add_dependency(s, "React-RCTFBReactNativeSpec")
add_dependency(s, "ReactCodegen", :additional_framework_paths => ["build/generated/ios"])
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
end
@@ -434,12 +434,6 @@ export interface ViewStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
cursor?: CursorValue | undefined;
boxShadow?: ReadonlyArray<BoxShadowValue> | string | undefined;
filter?: ReadonlyArray<FilterFunction> | string | undefined;
mixBlendMode?: BlendMode | undefined;
experimental_backgroundImage?:
| ReadonlyArray<GradientValue>
| string
| undefined;
}
export type FontVariant =
@@ -568,6 +562,6 @@ export interface ImageStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
overlayColor?: ColorValue | undefined;
tintColor?: ColorValue | undefined;
opacity?: AnimatableNumericValue | undefined;
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none' | undefined;
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | undefined;
cursor?: CursorValue | undefined;
}
@@ -11,7 +11,6 @@
'use strict';
import type AnimatedNode from '../Animated/nodes/AnimatedNode';
import type {ImageResizeMode} from './../Image/ImageResizeMode';
import type {
____DangerouslyImpreciseStyle_InternalOverrides,
____ImageStyle_InternalOverrides,
@@ -942,8 +941,8 @@ export type ____TextStyle_Internal = $ReadOnly<{
export type ____ImageStyle_InternalCore = $ReadOnly<{
...$Exact<____ViewStyle_Internal>,
resizeMode?: ImageResizeMode,
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none',
resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat',
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down',
tintColor?: ____ColorValue_Internal,
overlayColor?: string,
}>;
@@ -955,8 +954,8 @@ export type ____ImageStyle_Internal = $ReadOnly<{
export type ____DangerouslyImpreciseStyle_InternalCore = $ReadOnly<{
...$Exact<____TextStyle_Internal>,
resizeMode?: ImageResizeMode,
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none',
resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat',
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down',
tintColor?: ____ColorValue_Internal,
overlayColor?: string,
}>;
@@ -10,6 +10,8 @@
'use strict';
module.exports = require('../Components/UnimplementedViews/UnimplementedView');
type BackPressEventName = 'backPress' | 'hardwareBackPress';
function emptyFunction(): void {}
@@ -50,7 +50,7 @@ Pod::Spec.new do |s|
s.dependency "React-jsi"
s.dependency "React-Core/RCTVibrationHeaders"
add_dependency(s, "React-RCTFBReactNativeSpec")
add_dependency(s, "ReactCodegen", :additional_framework_paths => ["build/generated/ios"])
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple")
end
@@ -707,7 +707,7 @@ declare export default typeof AnimatedScrollView;
exports[`public API should not change unintentionally Libraries/Animated/components/AnimatedSectionList.js 1`] = `
"declare export default AnimatedComponentType<
React.ElementConfig<typeof SectionList>,
SectionList<SectionBase<any>>,
React.ElementRef<typeof SectionList>,
>;
"
`;
@@ -2042,7 +2042,7 @@ exports[`public API should not change unintentionally Libraries/Components/Scrol
export type DecelerationRateType = \\"fast\\" | \\"normal\\" | number;
export type ScrollResponderType = ScrollViewImperativeMethods;
type PublicScrollViewInstance = $ReadOnly<{|
...HostInstance,
...$Exact<TScrollViewNativeComponentInstance>,
...ScrollViewImperativeMethods,
|}>;
type InnerViewInstance = React.ElementRef<View>;
@@ -2169,7 +2169,7 @@ declare class ScrollView extends React.Component<Props, State> {
getScrollableNode: () => ?number;
getInnerViewNode: () => ?number;
getInnerViewRef: () => InnerViewInstance | null;
getNativeScrollRef: () => HostInstance | null;
getNativeScrollRef: () => TScrollViewNativeComponentInstance | null;
scrollTo: (
options?:
| {
@@ -2184,6 +2184,9 @@ declare class ScrollView extends React.Component<Props, State> {
) => void;
scrollToEnd: (options?: ?{ animated?: boolean, ... }) => void;
flashScrollIndicators: () => void;
_subscribeToOnScroll: (
callback: ({ x: number, y: number }) => void
) => EventSubscription;
scrollResponderScrollNativeHandleToKeyboard: (
nodeHandle: number | HostInstance,
additionalOffset?: number,
@@ -2221,7 +2224,10 @@ declare class ScrollView extends React.Component<Props, State> {
_handleLayout: $FlowFixMe;
_handleContentOnLayout: $FlowFixMe;
_innerView: RefForwarder<InnerViewInstance, InnerViewInstance>;
_scrollView: RefForwarder<HostInstance, PublicScrollViewInstance | null>;
_scrollView: RefForwarder<
TScrollViewNativeImperativeHandle,
PublicScrollViewInstance | null,
>;
scrollResponderKeyboardWillShow: (e: KeyboardEvent) => void;
scrollResponderKeyboardWillHide: (e: KeyboardEvent) => void;
scrollResponderKeyboardDidShow: (e: KeyboardEvent) => void;
@@ -4863,7 +4869,7 @@ export type ImageProps = $ReadOnly<{|
| \\"strict-origin-when-cross-origin\\"
| \\"unsafe-url\\"
),
resizeMode?: ?ImageResizeMode,
resizeMode?: ?(\\"cover\\" | \\"contain\\" | \\"stretch\\" | \\"repeat\\" | \\"center\\"),
testID?: ?string,
tintColor?: ColorValue,
src?: ?string,
@@ -4886,8 +4892,7 @@ exports[`public API should not change unintentionally Libraries/Image/ImageResiz
| \\"contain\\"
| \\"cover\\"
| \\"repeat\\"
| \\"stretch\\"
| \\"none\\";
| \\"stretch\\";
"
`;
@@ -4984,9 +4989,10 @@ export type { ImageProps } from \\"./ImageProps\\";
`;
exports[`public API should not change unintentionally Libraries/Image/ImageUtils.js 1`] = `
"declare export function convertObjectFitToResizeMode(
"type ResizeMode = \\"cover\\" | \\"contain\\" | \\"stretch\\" | \\"repeat\\" | \\"center\\";
declare export function convertObjectFitToResizeMode(
objectFit: ?string
): ?ImageResizeMode;
): ?ResizeMode;
"
`;
@@ -5335,41 +5341,7 @@ declare const InteractionManager: {
addListener: $FlowFixMe,
setDeadline(deadline: number): void,
};
declare module.exports: typeof InteractionManager;
"
`;
exports[`public API should not change unintentionally Libraries/Interaction/InteractionManagerStub.js 1`] = `
"export type Handle = number;
type Task =
| {
name: string,
run: () => void,
}
| {
name: string,
gen: () => Promise<void>,
}
| (() => void);
declare const InteractionManagerStub: {
Events: {
interactionStart: \\"interactionStart\\",
interactionComplete: \\"interactionComplete\\",
},
runAfterInteractions(task: ?Task): {
then: <U>(
onFulfill?: ?(void) => ?(Promise<U> | U),
onReject?: ?(error: mixed) => ?(Promise<U> | U)
) => Promise<U>,
cancel: () => void,
...
},
createInteractionHandle(): Handle,
clearInteractionHandle(handle: Handle): void,
addListener(): EventSubscription,
setDeadline(deadline: number): void,
};
declare module.exports: InteractionManagerStub;
declare module.exports: InteractionManager;
"
`;
@@ -6439,7 +6411,6 @@ export type Props = $ReadOnly<{|
),
transparent?: ?boolean,
statusBarTranslucent?: ?boolean,
navigationBarTranslucent?: ?boolean,
hardwareAccelerated?: ?boolean,
visible?: ?boolean,
onRequestClose?: ?DirectEventHandler<null>,
@@ -7554,6 +7525,14 @@ declare module.exports: UIManagerJS;
"
`;
exports[`public API should not change unintentionally Libraries/ReactNative/ReactFabricInternals.js 1`] = `
"declare const createReactNativeComponentClass: $FlowFixMe;
declare module.exports: {
createReactNativeComponentClass: createReactNativeComponentClass,
};
"
`;
exports[`public API should not change unintentionally Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js 1`] = `
"declare export default class ReactFabricHostComponent
implements INativeMethods
@@ -8282,8 +8261,8 @@ export type ____TextStyle_Internal = $ReadOnly<{
}>;
export type ____ImageStyle_InternalCore = $ReadOnly<{
...$Exact<____ViewStyle_Internal>,
resizeMode?: ImageResizeMode,
objectFit?: \\"cover\\" | \\"contain\\" | \\"fill\\" | \\"scale-down\\" | \\"none\\",
resizeMode?: \\"contain\\" | \\"cover\\" | \\"stretch\\" | \\"center\\" | \\"repeat\\",
objectFit?: \\"cover\\" | \\"contain\\" | \\"fill\\" | \\"scale-down\\",
tintColor?: ____ColorValue_Internal,
overlayColor?: string,
}>;
@@ -8293,8 +8272,8 @@ export type ____ImageStyle_Internal = $ReadOnly<{
}>;
export type ____DangerouslyImpreciseStyle_InternalCore = $ReadOnly<{
...$Exact<____TextStyle_Internal>,
resizeMode?: ImageResizeMode,
objectFit?: \\"cover\\" | \\"contain\\" | \\"fill\\" | \\"scale-down\\" | \\"none\\",
resizeMode?: \\"contain\\" | \\"cover\\" | \\"stretch\\" | \\"center\\" | \\"repeat\\",
objectFit?: \\"cover\\" | \\"contain\\" | \\"fill\\" | \\"scale-down\\",
tintColor?: ____ColorValue_Internal,
overlayColor?: string,
}>;
@@ -207,7 +207,7 @@ class RCTBridgeHostTargetDelegate : public facebook::react::jsinspector_modern::
void onReload(const PageReloadRequest &request) override
{
RCTAssertMainQueue();
RCTTriggerReloadCommandListeners(@"Reloading due to PageReloadRequest from DevTools.");
[bridge_ reload];
}
void onSetPausedInDebuggerMessage(const OverlaySetPausedInDebuggerMessageRequest &request) override
@@ -19,9 +19,6 @@ NS_ASSUME_NONNULL_BEGIN
stack:(nullable NSArray *)stack
exceptionId:(NSNumber *)exceptionId
extraDataAsJSON:(nullable NSString *)extraDataAsJSON;
@optional
- (NSDictionary<NSString *, id> *)decorateJSExceptionData:(NSDictionary<NSString *, id> *)exceptionData;
@end
@interface RCTExceptionsManager : NSObject <RCTBridgeModule>
@@ -83,7 +83,6 @@ RCT_EXPORT_MODULE()
}
}
// TODO(T205456329): This method is deprecated in favour of reportException. Delete in v0.77
RCT_EXPORT_METHOD(reportSoftException
: (NSString *)message stack
: (NSArray<NSDictionary *> *)stack exceptionId
@@ -92,7 +91,6 @@ RCT_EXPORT_METHOD(reportSoftException
[self reportSoft:message stack:stack exceptionId:exceptionId extraDataAsJSON:nil];
}
// TODO(T205456329): This method is deprecated in favour of reportException. Delete in v0.77
RCT_EXPORT_METHOD(reportFatalException
: (NSString *)message stack
: (NSArray<NSDictionary *> *)stack exceptionId
@@ -105,24 +103,15 @@ RCT_EXPORT_METHOD(dismissRedbox) {}
RCT_EXPORT_METHOD(reportException : (JS::NativeExceptionsManager::ExceptionData &)data)
{
NSMutableDictionary<NSString *, id> *mutableErrorData = [NSMutableDictionary new];
mutableErrorData[@"message"] = data.message();
if (data.originalMessage()) {
mutableErrorData[@"originalMessage"] = data.originalMessage();
}
if (data.name()) {
mutableErrorData[@"name"] = data.name();
}
if (data.componentStack()) {
mutableErrorData[@"componentStack"] = data.componentStack();
}
NSString *message = data.message();
double exceptionId = data.id_();
// Reserialize data.stack() into an array of untyped dictionaries.
// TODO: (moti) T53588496 Replace `(NSArray<NSDictionary *> *)stack` in
// reportFatalException etc with a typed interface.
NSMutableArray<NSDictionary<NSString *, id> *> *stackArray = [NSMutableArray<NSDictionary<NSString *, id> *> new];
NSMutableArray<NSDictionary *> *stackArray = [NSMutableArray<NSDictionary *> new];
for (auto frame : data.stack()) {
NSMutableDictionary<NSString *, id> *frameDict = [NSMutableDictionary new];
NSMutableDictionary *frameDict = [NSMutableDictionary new];
if (frame.column().has_value()) {
frameDict[@"column"] = @(frame.column().value());
}
@@ -137,28 +126,13 @@ RCT_EXPORT_METHOD(reportException : (JS::NativeExceptionsManager::ExceptionData
[stackArray addObject:frameDict];
}
mutableErrorData[@"stack"] = stackArray;
mutableErrorData[@"id"] = @(data.id_());
mutableErrorData[@"isFatal"] = @(data.isFatal());
NSDictionary *extraData = (NSDictionary *)data.extraData();
NSString *extraDataAsJSON = RCTJSONStringify(extraData, NULL);
if (data.extraData()) {
mutableErrorData[@"extraData"] = data.extraData();
}
NSDictionary<NSString *, id> *errorData = mutableErrorData;
if ([_delegate respondsToSelector:@selector(decorateJSExceptionData:)]) {
errorData = [_delegate decorateJSExceptionData:errorData];
}
NSString *extraDataAsJSON = RCTJSONStringify(errorData[@"extraData"], NULL);
NSString *message = errorData[@"message"];
NSArray<NSDictionary<NSString *, id> *> *stack = errorData[@"stack"];
double exceptionId = [errorData[@"id"] doubleValue];
if ([errorData[@"isFatal"] boolValue]) {
[self reportFatal:message stack:stack exceptionId:exceptionId extraDataAsJSON:extraDataAsJSON];
if (data.isFatal()) {
[self reportFatal:message stack:stackArray exceptionId:exceptionId extraDataAsJSON:extraDataAsJSON];
} else {
[self reportSoft:message stack:stack exceptionId:exceptionId extraDataAsJSON:extraDataAsJSON];
[self reportSoft:message stack:stackArray exceptionId:exceptionId extraDataAsJSON:extraDataAsJSON];
}
}
@@ -71,7 +71,7 @@ Pod::Spec.new do |s|
s.dependency "SocketRocket", socket_rocket_version
add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern')
add_dependency(s, "React-RCTFBReactNativeSpec")
add_dependency(s, "ReactCodegen")
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "React-NativeModulesApple")
end
@@ -56,11 +56,7 @@
UIButton *resumeButton = [UIButton buttonWithType:UIButtonTypeCustom];
[resumeButton setImage:[UIImage systemImageNamed:@"forward.frame.fill"] forState:UIControlStateNormal];
resumeButton.tintColor = [UIColor colorWithRed:0.37 green:0.37 blue:0.37 alpha:1];
resumeButton.configurationUpdateHandler = ^(UIButton *button) {
button.imageView.tintAdjustmentMode = UIViewTintAdjustmentModeNormal;
};
resumeButton.adjustsImageWhenDisabled = NO;
resumeButton.enabled = NO;
[NSLayoutConstraint activateConstraints:@[
[resumeButton.widthAnchor constraintEqualToConstant:48],
@@ -618,18 +618,31 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
const auto &props = static_cast<const ScrollViewProps &>(*_props);
auto scrollMetrics = [self _scrollViewMetrics];
[self _updateStateWithContentOffset];
NSTimeInterval now = CACurrentMediaTime();
if ((_lastScrollEventDispatchTime == 0) || (now - _lastScrollEventDispatchTime > _scrollEventThrottle)) {
_lastScrollEventDispatchTime = now;
if (props.enableSyncOnScroll) {
if (_eventEmitter) {
static_cast<const ScrollViewEventEmitter &>(*_eventEmitter).onScroll(scrollMetrics);
const auto &eventEmitter = static_cast<const ScrollViewEventEmitter &>(*_eventEmitter);
// TODO: temporary API to unblock testing of synchronous rendering.
eventEmitter.experimental_flushSync([&eventEmitter, &scrollMetrics, &self]() {
[self _updateStateWithContentOffset];
// TODO: temporary API to unblock testing of synchronous rendering.
eventEmitter.experimental_onDiscreteScroll(scrollMetrics);
});
}
} else {
[self _updateStateWithContentOffset];
RCTSendScrollEventForNativeAnimations_DEPRECATED(scrollView, self.tag, kOnScrollEvent);
NSTimeInterval now = CACurrentMediaTime();
if ((_lastScrollEventDispatchTime == 0) || (now - _lastScrollEventDispatchTime > _scrollEventThrottle)) {
_lastScrollEventDispatchTime = now;
if (_eventEmitter) {
static_cast<const ScrollViewEventEmitter &>(*_eventEmitter).onScroll(scrollMetrics);
}
RCTSendScrollEventForNativeAnimations_DEPRECATED(scrollView, self.tag, kOnScrollEvent);
}
}
[self _remountChildrenIfNeeded];
@@ -1,87 +0,0 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
require "json"
# This Podspec wraps the code generated by Codegen that defines all the interfaces for the
# internal Native Modules that React Native depends on.
package = JSON.parse(File.read(File.join(__dir__, "..", "package.json")))
version = package['version']
source = { :git => 'https://github.com/facebook/react-native.git' }
if version == '1000.0.0'
# This is an unpublished version, use the latest commit hash of the react-native repo, which were presumably in.
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
else
source[:tag] = "v#{version}"
end
module_name = "FBReactNativeSpec"
header_dir = "FBReactNativeSpec"
folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]
new_arch_flags = ENV['RCT_NEW_ARCH_ENABLED'] == '1' ? ' -DRCT_NEW_ARCH_ENABLED=1' : ''
header_search_paths = [
"\"$(PODS_ROOT)/RCT-Folly\"",
]
Pod::Spec.new do |s|
s.name = "React-RCTFBReactNativeSpec"
s.version = version
s.summary = "FBReactNativeSpec for React Native."
s.homepage = "https://reactnative.dev/"
s.license = package["license"]
s.author = "Meta Platforms, Inc. and its affiliates"
s.platforms = min_supported_versions
s.source = source
s.source_files = "FBReactNativeSpec/**/*.{c,h,m,mm,S,cpp}"
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags + new_arch_flags
s.header_dir = header_dir
s.module_name = module_name
s.pod_target_xcconfig = {
"HEADER_SEARCH_PATHS" => header_search_paths,
"OTHER_CFLAGS" => "$(inherited) " + folly_compiler_flags + new_arch_flags,
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard()
}
s.dependency "React-jsi"
s.dependency "React-jsiexecutor"
s.dependency "RCT-Folly"
s.dependency "RCTRequired"
s.dependency "RCTTypeSafety"
s.dependency "React-Core"
s.dependency "React-NativeModulesApple"
add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"])
add_dependency(s, "ReactCommon", :subspec => "turbomodule/bridging", :additional_framework_paths => ["react/nativemodule/bridging"])
if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1"
s.dependency "hermes-engine"
else
s.dependency "React-jsc"
end
s.script_phases = [
{
:name => '[RN]Check FBReactNativeSpec',
:execution_position => :before_compile,
:script => <<-EOS
echo "Checking whether Codegen has run..."
fbReactNativeSpecPath="$REACT_NATIVE_PATH/React/FBReactNativeSpec"
if [[ ! -d "$fbReactNativeSpecPath" ]]; then
echo 'error: Codegen did not run properly in your project. Please reinstall cocoapods with `bundle exec pod install`.'
exit 1
fi
EOS
}
]
end
@@ -926,14 +926,12 @@ public class com/facebook/react/bridge/JavaOnlyArray : com/facebook/react/bridge
public fun toString ()Ljava/lang/String;
}
public final class com/facebook/react/bridge/JavaOnlyMap : com/facebook/react/bridge/ReadableMap, com/facebook/react/bridge/WritableMap {
public static final field Companion Lcom/facebook/react/bridge/JavaOnlyMap$Companion;
public class com/facebook/react/bridge/JavaOnlyMap : com/facebook/react/bridge/ReadableMap, com/facebook/react/bridge/WritableMap {
public fun <init> ()V
public synthetic fun <init> ([Ljava/lang/Object;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun copy ()Lcom/facebook/react/bridge/WritableMap;
public static final fun deepClone (Lcom/facebook/react/bridge/ReadableMap;)Lcom/facebook/react/bridge/JavaOnlyMap;
public static fun deepClone (Lcom/facebook/react/bridge/ReadableMap;)Lcom/facebook/react/bridge/JavaOnlyMap;
public fun equals (Ljava/lang/Object;)Z
public static final fun from (Ljava/util/Map;)Lcom/facebook/react/bridge/JavaOnlyMap;
public static fun from (Ljava/util/Map;)Lcom/facebook/react/bridge/JavaOnlyMap;
public fun getArray (Ljava/lang/String;)Lcom/facebook/react/bridge/ReadableArray;
public fun getBoolean (Ljava/lang/String;)Z
public fun getDouble (Ljava/lang/String;)D
@@ -949,7 +947,7 @@ public final class com/facebook/react/bridge/JavaOnlyMap : com/facebook/react/br
public fun isNull (Ljava/lang/String;)Z
public fun keySetIterator ()Lcom/facebook/react/bridge/ReadableMapKeySetIterator;
public fun merge (Lcom/facebook/react/bridge/ReadableMap;)V
public static final fun of ([Ljava/lang/Object;)Lcom/facebook/react/bridge/JavaOnlyMap;
public static fun of ([Ljava/lang/Object;)Lcom/facebook/react/bridge/JavaOnlyMap;
public fun putArray (Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
public fun putBoolean (Ljava/lang/String;Z)V
public fun putDouble (Ljava/lang/String;D)V
@@ -958,17 +956,10 @@ public final class com/facebook/react/bridge/JavaOnlyMap : com/facebook/react/br
public fun putMap (Ljava/lang/String;Lcom/facebook/react/bridge/ReadableMap;)V
public fun putNull (Ljava/lang/String;)V
public fun putString (Ljava/lang/String;Ljava/lang/String;)V
public final fun remove (Ljava/lang/String;)V
public fun toHashMap ()Ljava/util/HashMap;
public fun toString ()Ljava/lang/String;
}
public final class com/facebook/react/bridge/JavaOnlyMap$Companion {
public final fun deepClone (Lcom/facebook/react/bridge/ReadableMap;)Lcom/facebook/react/bridge/JavaOnlyMap;
public final fun from (Ljava/util/Map;)Lcom/facebook/react/bridge/JavaOnlyMap;
public final fun of ([Ljava/lang/Object;)Lcom/facebook/react/bridge/JavaOnlyMap;
}
public class com/facebook/react/bridge/JavaScriptContextHolder {
public fun <init> (J)V
public fun clear ()V
@@ -1563,7 +1554,7 @@ public abstract interface class com/facebook/react/bridge/UIManager : com/facebo
public abstract fun addUIManagerEventListener (Lcom/facebook/react/bridge/UIManagerListener;)V
public abstract fun dispatchCommand (IILcom/facebook/react/bridge/ReadableArray;)V
public abstract fun dispatchCommand (ILjava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
public abstract fun getEventDispatcher ()Lcom/facebook/react/uimanager/events/EventDispatcher;
public abstract fun getEventDispatcher ()Ljava/lang/Object;
public abstract fun initialize ()V
public abstract fun invalidate ()V
public abstract fun markActiveTouchForTag (II)V
@@ -1915,6 +1906,19 @@ public final class com/facebook/react/common/build/ReactBuildConfig {
public static final field IS_INTERNAL_BUILD Z
}
public final class com/facebook/react/common/futures/SimpleSettableFuture : java/util/concurrent/Future {
public fun <init> ()V
public fun cancel (Z)Z
public fun get ()Ljava/lang/Object;
public fun get (JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;
public final fun getOrThrow ()Ljava/lang/Object;
public final fun getOrThrow (JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;
public fun isCancelled ()Z
public fun isDone ()Z
public final fun set (Ljava/lang/Object;)V
public final fun setException (Ljava/lang/Exception;)V
}
public abstract interface class com/facebook/react/common/mapbuffer/MapBuffer : java/lang/Iterable, kotlin/jvm/internal/markers/KMappedMarker {
public static final field Companion Lcom/facebook/react/common/mapbuffer/MapBuffer$Companion;
public abstract fun contains (I)Z
@@ -2009,6 +2013,11 @@ public final class com/facebook/react/common/mapbuffer/WritableMapBuffer : com/f
public final fun put (IZ)Lcom/facebook/react/common/mapbuffer/WritableMapBuffer;
}
public final class com/facebook/react/common/network/OkHttpCallUtil {
public static final field INSTANCE Lcom/facebook/react/common/network/OkHttpCallUtil;
public static final fun cancelTag (Lokhttp3/OkHttpClient;Ljava/lang/Object;)V
}
public final class com/facebook/react/config/ReactFeatureFlags {
public static final field INSTANCE Lcom/facebook/react/config/ReactFeatureFlags;
public static field dispatchPointerEvents Z
@@ -2623,6 +2632,7 @@ public class com/facebook/react/fabric/FabricUIManager : com/facebook/react/brid
public fun dispatchCommand (ILjava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
public fun getColor (I[Ljava/lang/String;)I
public fun getEventDispatcher ()Lcom/facebook/react/uimanager/events/EventDispatcher;
public synthetic fun getEventDispatcher ()Ljava/lang/Object;
public fun getInspectorDataForInstance (ILandroid/view/View;)Lcom/facebook/react/bridge/ReadableMap;
public fun getPerformanceCounters ()Ljava/util/Map;
public fun getThemeData (I[F)Z
@@ -3045,6 +3055,27 @@ public class com/facebook/react/modules/blob/FileReaderModule : com/facebook/fbr
public fun readAsText (Lcom/facebook/react/bridge/ReadableMap;Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V
}
public final class com/facebook/react/modules/camera/ImageStoreManager : com/facebook/fbreact/specs/NativeImageStoreAndroidSpec {
public static final field Companion Lcom/facebook/react/modules/camera/ImageStoreManager$Companion;
public static final field NAME Ljava/lang/String;
public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;)V
public fun getBase64ForTag (Ljava/lang/String;Lcom/facebook/react/bridge/Callback;Lcom/facebook/react/bridge/Callback;)V
}
public final class com/facebook/react/modules/camera/ImageStoreManager$Companion {
}
public final class com/facebook/react/modules/clipboard/ClipboardModule : com/facebook/fbreact/specs/NativeClipboardSpec {
public static final field Companion Lcom/facebook/react/modules/clipboard/ClipboardModule$Companion;
public static final field NAME Ljava/lang/String;
public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;)V
public fun getString (Lcom/facebook/react/bridge/Promise;)V
public fun setString (Ljava/lang/String;)V
}
public final class com/facebook/react/modules/clipboard/ClipboardModule$Companion {
}
public final class com/facebook/react/modules/common/ModuleDataCleaner {
public static final field INSTANCE Lcom/facebook/react/modules/common/ModuleDataCleaner;
public static final fun cleanDataFromModules (Lcom/facebook/react/bridge/ReactContext;)V
@@ -3272,6 +3303,17 @@ public final class com/facebook/react/modules/deviceinfo/DeviceInfoModule : com/
public fun onHostResume ()V
}
public final class com/facebook/react/modules/devloading/DevLoadingModule : com/facebook/fbreact/specs/NativeDevLoadingViewSpec {
public static final field Companion Lcom/facebook/react/modules/devloading/DevLoadingModule$Companion;
public static final field NAME Ljava/lang/String;
public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;)V
public fun hide ()V
public fun showMessage (Ljava/lang/String;Ljava/lang/Double;Ljava/lang/Double;)V
}
public final class com/facebook/react/modules/devloading/DevLoadingModule$Companion {
}
public class com/facebook/react/modules/dialog/AlertFragment : androidx/fragment/app/DialogFragment, android/content/DialogInterface$OnClickListener {
public fun <init> ()V
public fun <init> (Lcom/facebook/react/modules/dialog/DialogModule$AlertFragmentListener;Landroid/os/Bundle;)V
@@ -3631,6 +3673,18 @@ public final class com/facebook/react/modules/toast/ToastModule : com/facebook/f
public final class com/facebook/react/modules/toast/ToastModule$Companion {
}
public final class com/facebook/react/modules/vibration/VibrationModule : com/facebook/fbreact/specs/NativeVibrationSpec {
public static final field Companion Lcom/facebook/react/modules/vibration/VibrationModule$Companion;
public static final field NAME Ljava/lang/String;
public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;)V
public fun cancel ()V
public fun vibrate (D)V
public fun vibrateByPattern (Lcom/facebook/react/bridge/ReadableArray;D)V
}
public final class com/facebook/react/modules/vibration/VibrationModule$Companion {
}
public final class com/facebook/react/modules/websocket/WebSocketModule : com/facebook/fbreact/specs/NativeWebSocketModuleSpec {
public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;)V
public fun addListener (Ljava/lang/String;)V
@@ -3720,6 +3774,22 @@ public abstract interface class com/facebook/react/packagerconnection/Responder
public abstract fun respond (Ljava/lang/Object;)V
}
public abstract class com/facebook/react/reactperflogger/NativeModulePerfLogger {
protected fun <init> ()V
protected abstract fun initHybrid ()Lcom/facebook/jni/HybridData;
protected final fun maybeLoadOtherSoLibraries ()V
public abstract fun moduleCreateCacheHit (Ljava/lang/String;I)V
public abstract fun moduleCreateConstructEnd (Ljava/lang/String;I)V
public abstract fun moduleCreateConstructStart (Ljava/lang/String;I)V
public abstract fun moduleCreateEnd (Ljava/lang/String;I)V
public abstract fun moduleCreateFail (Ljava/lang/String;I)V
public abstract fun moduleCreateSetUpEnd (Ljava/lang/String;I)V
public abstract fun moduleCreateSetUpStart (Ljava/lang/String;I)V
public abstract fun moduleCreateStart (Ljava/lang/String;I)V
public abstract fun moduleDataCreateEnd (Ljava/lang/String;I)V
public abstract fun moduleDataCreateStart (Ljava/lang/String;I)V
}
public abstract class com/facebook/react/runtime/BindingsInstaller {
public fun <init> (Lcom/facebook/jni/HybridData;)V
}
@@ -4226,6 +4296,13 @@ public class com/facebook/react/uimanager/LayoutShadowNode : com/facebook/react/
public fun setWidth (Lcom/facebook/react/bridge/Dynamic;)V
}
public class com/facebook/react/uimanager/LayoutShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public fun setProperty (Lcom/facebook/react/uimanager/LayoutShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/uimanager/LengthPercentage {
public static final field Companion Lcom/facebook/react/uimanager/LengthPercentage$Companion;
public fun <init> ()V
@@ -4879,6 +4956,13 @@ public class com/facebook/react/uimanager/ReactShadowNodeImpl : com/facebook/rea
public final fun updateProperties (Lcom/facebook/react/uimanager/ReactStylesDiffMap;)V
}
public class com/facebook/react/uimanager/ReactShadowNodeImpl$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNodeImpl;Ljava/lang/String;Ljava/lang/Object;)V
}
public abstract interface annotation class com/facebook/react/uimanager/ReactStage : java/lang/annotation/Annotation {
public static final field BRIDGE_DID_LOAD I
public static final field MODULE_DID_LOAD I
@@ -4932,6 +5016,13 @@ public final class com/facebook/react/uimanager/RootViewManager : com/facebook/r
public fun getName ()Ljava/lang/String;
}
public class com/facebook/react/uimanager/RootViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public fun setProperty (Lcom/facebook/react/uimanager/RootViewManager;Landroid/view/ViewGroup;Ljava/lang/String;Ljava/lang/Object;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/uimanager/RootViewManager$Companion {
}
@@ -5146,6 +5237,7 @@ public class com/facebook/react/uimanager/UIManagerModule : com/facebook/react/b
public fun getDefaultEventTypes ()Lcom/facebook/react/bridge/WritableMap;
public fun getDirectEventNamesResolver ()Lcom/facebook/react/uimanager/UIManagerModule$CustomEventNamesResolver;
public fun getEventDispatcher ()Lcom/facebook/react/uimanager/events/EventDispatcher;
public synthetic fun getEventDispatcher ()Ljava/lang/Object;
public fun getName ()Ljava/lang/String;
public fun getPerformanceCounters ()Ljava/util/Map;
public fun getUIImplementation ()Lcom/facebook/react/uimanager/UIImplementation;
@@ -5566,6 +5658,11 @@ public final class com/facebook/react/uimanager/common/ViewUtil {
public static final fun isRootTag (I)Z
}
public abstract interface class com/facebook/react/uimanager/debug/NotThreadSafeViewHierarchyUpdateDebugListener {
public abstract fun onViewHierarchyUpdateEnqueued ()V
public abstract fun onViewHierarchyUpdateFinished ()V
}
public abstract interface class com/facebook/react/uimanager/events/BatchEventDispatchedListener {
public abstract fun onBatchEventDispatched ()V
}
@@ -6095,15 +6192,15 @@ public final class com/facebook/react/uimanager/style/Overflow$Companion {
public final fun fromString (Ljava/lang/String;)Lcom/facebook/react/uimanager/style/Overflow;
}
public final class com/facebook/react/uimanager/util/ReactFindViewUtil {
public static final field INSTANCE Lcom/facebook/react/uimanager/util/ReactFindViewUtil;
public static final fun addViewListener (Lcom/facebook/react/uimanager/util/ReactFindViewUtil$OnViewFoundListener;)V
public static final fun addViewsListener (Lcom/facebook/react/uimanager/util/ReactFindViewUtil$OnMultipleViewsFoundListener;Ljava/util/Set;)V
public static final fun findView (Landroid/view/View;Lcom/facebook/react/uimanager/util/ReactFindViewUtil$OnViewFoundListener;)V
public static final fun findView (Landroid/view/View;Ljava/lang/String;)Landroid/view/View;
public static final fun notifyViewRendered (Landroid/view/View;)V
public static final fun removeViewListener (Lcom/facebook/react/uimanager/util/ReactFindViewUtil$OnViewFoundListener;)V
public static final fun removeViewsListener (Lcom/facebook/react/uimanager/util/ReactFindViewUtil$OnMultipleViewsFoundListener;)V
public class com/facebook/react/uimanager/util/ReactFindViewUtil {
public fun <init> ()V
public static fun addViewListener (Lcom/facebook/react/uimanager/util/ReactFindViewUtil$OnViewFoundListener;)V
public static fun addViewsListener (Lcom/facebook/react/uimanager/util/ReactFindViewUtil$OnMultipleViewsFoundListener;Ljava/util/Set;)V
public static fun findView (Landroid/view/View;Lcom/facebook/react/uimanager/util/ReactFindViewUtil$OnViewFoundListener;)V
public static fun findView (Landroid/view/View;Ljava/lang/String;)Landroid/view/View;
public static fun notifyViewRendered (Landroid/view/View;)V
public static fun removeViewListener (Lcom/facebook/react/uimanager/util/ReactFindViewUtil$OnViewFoundListener;)V
public static fun removeViewsListener (Lcom/facebook/react/uimanager/util/ReactFindViewUtil$OnMultipleViewsFoundListener;)V
}
public abstract interface class com/facebook/react/uimanager/util/ReactFindViewUtil$OnMultipleViewsFoundListener {
@@ -6260,7 +6357,6 @@ public abstract interface class com/facebook/react/viewmanagers/ModalHostViewMan
public abstract fun setAnimationType (Landroid/view/View;Ljava/lang/String;)V
public abstract fun setHardwareAccelerated (Landroid/view/View;Z)V
public abstract fun setIdentifier (Landroid/view/View;I)V
public abstract fun setNavigationBarTranslucent (Landroid/view/View;Z)V
public abstract fun setPresentationStyle (Landroid/view/View;Ljava/lang/String;)V
public abstract fun setStatusBarTranslucent (Landroid/view/View;Z)V
public abstract fun setSupportedOrientations (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
@@ -6303,24 +6399,24 @@ public final class com/facebook/react/views/debuggingoverlay/DebuggingOverlay :
public final fun setTraceUpdates (Ljava/util/List;)V
}
public final class com/facebook/react/views/debuggingoverlay/DebuggingOverlayManager : com/facebook/react/uimanager/SimpleViewManager, com/facebook/react/viewmanagers/DebuggingOverlayManagerInterface {
public final class com/facebook/react/views/debuggingoverlay/DebuggingOverlayManager : com/facebook/react/uimanager/SimpleViewManager {
public static final field Companion Lcom/facebook/react/views/debuggingoverlay/DebuggingOverlayManager$Companion;
public static final field REACT_CLASS Ljava/lang/String;
public fun <init> ()V
public synthetic fun clearElementsHighlights (Landroid/view/View;)V
public fun clearElementsHighlights (Lcom/facebook/react/views/debuggingoverlay/DebuggingOverlay;)V
public synthetic fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Landroid/view/View;
public fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Lcom/facebook/react/views/debuggingoverlay/DebuggingOverlay;
public fun getDelegate ()Lcom/facebook/react/uimanager/ViewManagerDelegate;
public fun getName ()Ljava/lang/String;
public synthetic fun highlightElements (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
public fun highlightElements (Lcom/facebook/react/views/debuggingoverlay/DebuggingOverlay;Lcom/facebook/react/bridge/ReadableArray;)V
public synthetic fun highlightTraceUpdates (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
public fun highlightTraceUpdates (Lcom/facebook/react/views/debuggingoverlay/DebuggingOverlay;Lcom/facebook/react/bridge/ReadableArray;)V
public synthetic fun receiveCommand (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
public fun receiveCommand (Lcom/facebook/react/views/debuggingoverlay/DebuggingOverlay;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
}
public class com/facebook/react/views/debuggingoverlay/DebuggingOverlayManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/debuggingoverlay/DebuggingOverlayManager;Lcom/facebook/react/views/debuggingoverlay/DebuggingOverlay;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/debuggingoverlay/DebuggingOverlayManager$Companion {
}
@@ -6382,6 +6478,13 @@ public final class com/facebook/react/views/drawer/ReactDrawerLayoutManager : co
public fun setStatusBarBackgroundColor (Lcom/facebook/react/views/drawer/ReactDrawerLayout;Ljava/lang/Integer;)V
}
public class com/facebook/react/views/drawer/ReactDrawerLayoutManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/drawer/ReactDrawerLayoutManager;Lcom/facebook/react/views/drawer/ReactDrawerLayout;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/drawer/ReactDrawerLayoutManager$Companion {
}
@@ -6543,6 +6646,13 @@ public final class com/facebook/react/views/image/ReactImageManager : com/facebo
public final fun setTintColor (Lcom/facebook/react/views/image/ReactImageView;Ljava/lang/Integer;)V
}
public class com/facebook/react/views/image/ReactImageManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/image/ReactImageManager;Lcom/facebook/react/views/image/ReactImageView;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/image/ReactImageManager$Companion {
}
@@ -6624,6 +6734,13 @@ public final class com/facebook/react/views/imagehelper/ResourceDrawableIdHelper
public final fun getInstance ()Lcom/facebook/react/views/imagehelper/ResourceDrawableIdHelper;
}
public class com/facebook/react/views/modal/ModalHostShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/modal/ModalHostShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/modal/ReactModalHostManager : com/facebook/react/uimanager/ViewGroupManager, com/facebook/react/viewmanagers/ModalHostViewManagerInterface {
public static final field Companion Lcom/facebook/react/views/modal/ReactModalHostManager$Companion;
public static final field REACT_CLASS Ljava/lang/String;
@@ -6644,8 +6761,6 @@ public final class com/facebook/react/views/modal/ReactModalHostManager : com/fa
public fun setHardwareAccelerated (Lcom/facebook/react/views/modal/ReactModalHostView;Z)V
public synthetic fun setIdentifier (Landroid/view/View;I)V
public fun setIdentifier (Lcom/facebook/react/views/modal/ReactModalHostView;I)V
public synthetic fun setNavigationBarTranslucent (Landroid/view/View;Z)V
public fun setNavigationBarTranslucent (Lcom/facebook/react/views/modal/ReactModalHostView;Z)V
public synthetic fun setPresentationStyle (Landroid/view/View;Ljava/lang/String;)V
public fun setPresentationStyle (Lcom/facebook/react/views/modal/ReactModalHostView;Ljava/lang/String;)V
public synthetic fun setStatusBarTranslucent (Landroid/view/View;Z)V
@@ -6660,6 +6775,13 @@ public final class com/facebook/react/views/modal/ReactModalHostManager : com/fa
public fun updateState (Lcom/facebook/react/views/modal/ReactModalHostView;Lcom/facebook/react/uimanager/ReactStylesDiffMap;Lcom/facebook/react/uimanager/StateWrapper;)Ljava/lang/Object;
}
public class com/facebook/react/views/modal/ReactModalHostManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/modal/ReactModalHostManager;Lcom/facebook/react/views/modal/ReactModalHostView;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/modal/ReactModalHostManager$Companion {
}
@@ -6674,7 +6796,6 @@ public final class com/facebook/react/views/modal/ReactModalHostView : android/v
public fun getChildCount ()I
public final fun getEventDispatcher ()Lcom/facebook/react/uimanager/events/EventDispatcher;
public final fun getHardwareAccelerated ()Z
public final fun getNavigationBarTranslucent ()Z
public final fun getOnRequestCloseListener ()Lcom/facebook/react/views/modal/ReactModalHostView$OnRequestCloseListener;
public final fun getOnShowListener ()Landroid/content/DialogInterface$OnShowListener;
public final fun getStateWrapper ()Lcom/facebook/react/uimanager/StateWrapper;
@@ -6690,7 +6811,6 @@ public final class com/facebook/react/views/modal/ReactModalHostView : android/v
public final fun setEventDispatcher (Lcom/facebook/react/uimanager/events/EventDispatcher;)V
public final fun setHardwareAccelerated (Z)V
public fun setId (I)V
public final fun setNavigationBarTranslucent (Z)V
public final fun setOnRequestCloseListener (Lcom/facebook/react/views/modal/ReactModalHostView$OnRequestCloseListener;)V
public final fun setOnShowListener (Landroid/content/DialogInterface$OnShowListener;)V
public final fun setStateWrapper (Lcom/facebook/react/uimanager/StateWrapper;)V
@@ -6715,6 +6835,100 @@ public abstract interface class com/facebook/react/views/modal/ReactModalHostVie
public abstract fun onRequestClose (Landroid/content/DialogInterface;)V
}
public final class com/facebook/react/views/progressbar/ProgressBarContainerView : android/widget/FrameLayout {
public static final field MAX_PROGRESS I
public fun <init> (Landroid/content/Context;)V
}
public final class com/facebook/react/views/progressbar/ProgressBarShadowNode : com/facebook/react/uimanager/LayoutShadowNode, com/facebook/yoga/YogaMeasureFunction {
public fun <init> ()V
public final fun getStyle ()Ljava/lang/String;
public fun measure (Lcom/facebook/yoga/YogaNode;FLcom/facebook/yoga/YogaMeasureMode;FLcom/facebook/yoga/YogaMeasureMode;)J
public final fun setStyle (Ljava/lang/String;)V
}
public class com/facebook/react/views/progressbar/ProgressBarShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/progressbar/ProgressBarShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/progressbar/ReactProgressBarViewManager : com/facebook/react/uimanager/BaseViewManager, com/facebook/react/viewmanagers/AndroidProgressBarManagerInterface {
public static final field Companion Lcom/facebook/react/views/progressbar/ReactProgressBarViewManager$Companion;
public static final field REACT_CLASS Ljava/lang/String;
public fun <init> ()V
public synthetic fun createShadowNodeInstance ()Lcom/facebook/react/uimanager/ReactShadowNode;
public fun createShadowNodeInstance ()Lcom/facebook/react/views/progressbar/ProgressBarShadowNode;
public synthetic fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Landroid/view/View;
public fun getName ()Ljava/lang/String;
public fun getShadowNodeClass ()Ljava/lang/Class;
public fun measure (Landroid/content/Context;Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/ReadableMap;FLcom/facebook/yoga/YogaMeasureMode;FLcom/facebook/yoga/YogaMeasureMode;[F)J
public synthetic fun onAfterUpdateTransaction (Landroid/view/View;)V
public synthetic fun setAnimating (Landroid/view/View;Z)V
public fun setAnimating (Lcom/facebook/react/views/progressbar/ProgressBarContainerView;Z)V
public synthetic fun setColor (Landroid/view/View;Ljava/lang/Integer;)V
public fun setColor (Lcom/facebook/react/views/progressbar/ProgressBarContainerView;Ljava/lang/Integer;)V
public synthetic fun setIndeterminate (Landroid/view/View;Z)V
public fun setIndeterminate (Lcom/facebook/react/views/progressbar/ProgressBarContainerView;Z)V
public synthetic fun setProgress (Landroid/view/View;D)V
public fun setProgress (Lcom/facebook/react/views/progressbar/ProgressBarContainerView;D)V
public synthetic fun setStyleAttr (Landroid/view/View;Ljava/lang/String;)V
public fun setStyleAttr (Lcom/facebook/react/views/progressbar/ProgressBarContainerView;Ljava/lang/String;)V
public synthetic fun setTestID (Landroid/view/View;Ljava/lang/String;)V
public fun setTestID (Lcom/facebook/react/views/progressbar/ProgressBarContainerView;Ljava/lang/String;)V
public synthetic fun setTypeAttr (Landroid/view/View;Ljava/lang/String;)V
public fun setTypeAttr (Lcom/facebook/react/views/progressbar/ProgressBarContainerView;Ljava/lang/String;)V
public synthetic fun updateExtraData (Landroid/view/View;Ljava/lang/Object;)V
public fun updateExtraData (Lcom/facebook/react/views/progressbar/ProgressBarContainerView;Ljava/lang/Object;)V
}
public class com/facebook/react/views/progressbar/ReactProgressBarViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/progressbar/ReactProgressBarViewManager;Lcom/facebook/react/views/progressbar/ProgressBarContainerView;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/progressbar/ReactProgressBarViewManager$Companion {
public final fun createProgressBar (Landroid/content/Context;I)Landroid/widget/ProgressBar;
}
public final class com/facebook/react/views/safeareaview/ReactSafeAreaView : android/view/ViewGroup {
public fun <init> (Lcom/facebook/react/uimanager/ThemedReactContext;)V
public final fun getReactContext ()Lcom/facebook/react/uimanager/ThemedReactContext;
}
public final class com/facebook/react/views/safeareaview/ReactSafeAreaViewManager : com/facebook/react/uimanager/ViewGroupManager, com/facebook/react/viewmanagers/SafeAreaViewManagerInterface {
public static final field Companion Lcom/facebook/react/views/safeareaview/ReactSafeAreaViewManager$Companion;
public static final field REACT_CLASS Ljava/lang/String;
public fun <init> ()V
public fun createShadowNodeInstance ()Lcom/facebook/react/uimanager/LayoutShadowNode;
public synthetic fun createShadowNodeInstance ()Lcom/facebook/react/uimanager/ReactShadowNode;
public synthetic fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Landroid/view/View;
public fun getName ()Ljava/lang/String;
public fun getShadowNodeClass ()Ljava/lang/Class;
public synthetic fun updateState (Landroid/view/View;Lcom/facebook/react/uimanager/ReactStylesDiffMap;Lcom/facebook/react/uimanager/StateWrapper;)Ljava/lang/Object;
public fun updateState (Lcom/facebook/react/views/safeareaview/ReactSafeAreaView;Lcom/facebook/react/uimanager/ReactStylesDiffMap;Lcom/facebook/react/uimanager/StateWrapper;)Ljava/lang/Object;
}
public class com/facebook/react/views/safeareaview/ReactSafeAreaViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/safeareaview/ReactSafeAreaViewManager;Lcom/facebook/react/views/safeareaview/ReactSafeAreaView;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/safeareaview/ReactSafeAreaViewManager$Companion {
}
public class com/facebook/react/views/safeareaview/ReactSafeAreaViewShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/safeareaview/ReactSafeAreaViewShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}
public abstract interface class com/facebook/react/views/scroll/FpsListener {
public abstract fun disable (Ljava/lang/String;)V
public abstract fun enable (Ljava/lang/String;)V
@@ -6738,6 +6952,13 @@ public final class com/facebook/react/views/scroll/ReactHorizontalScrollContaine
public fun getName ()Ljava/lang/String;
}
public class com/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager;Lcom/facebook/react/views/view/ReactViewGroup;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager$Companion {
}
@@ -6794,6 +7015,7 @@ public class com/facebook/react/views/scroll/ReactHorizontalScrollView : android
public fun setBorderWidth (IF)V
public fun setDecelerationRate (F)V
public fun setDisableIntervalMomentum (Z)V
public fun setEnableSyncOnScroll (Z)V
public fun setEndFillColor (I)V
public fun setLastScrollDispatchTime (J)V
public fun setMaintainVisibleContentPosition (Lcom/facebook/react/views/scroll/MaintainVisibleScrollPositionHelper$Config;)V
@@ -6841,6 +7063,7 @@ public class com/facebook/react/views/scroll/ReactHorizontalScrollViewManager :
public fun setContentOffset (Lcom/facebook/react/views/scroll/ReactHorizontalScrollView;Lcom/facebook/react/bridge/ReadableMap;)V
public fun setDecelerationRate (Lcom/facebook/react/views/scroll/ReactHorizontalScrollView;F)V
public fun setDisableIntervalMomentum (Lcom/facebook/react/views/scroll/ReactHorizontalScrollView;Z)V
public fun setEnableSyncOnScroll (Lcom/facebook/react/views/scroll/ReactHorizontalScrollView;Z)V
public fun setFadingEdgeLength (Lcom/facebook/react/views/scroll/ReactHorizontalScrollView;I)V
public fun setHorizontal (Lcom/facebook/react/views/scroll/ReactHorizontalScrollView;Z)V
public fun setMaintainVisibleContentPosition (Lcom/facebook/react/views/scroll/ReactHorizontalScrollView;Lcom/facebook/react/bridge/ReadableMap;)V
@@ -6865,6 +7088,13 @@ public class com/facebook/react/views/scroll/ReactHorizontalScrollViewManager :
public fun updateState (Lcom/facebook/react/views/scroll/ReactHorizontalScrollView;Lcom/facebook/react/uimanager/ReactStylesDiffMap;Lcom/facebook/react/uimanager/StateWrapper;)Ljava/lang/Object;
}
public class com/facebook/react/views/scroll/ReactHorizontalScrollViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/scroll/ReactHorizontalScrollViewManager;Lcom/facebook/react/views/scroll/ReactHorizontalScrollView;Ljava/lang/String;Ljava/lang/Object;)V
}
public class com/facebook/react/views/scroll/ReactScrollView : android/widget/ScrollView, android/view/View$OnLayoutChangeListener, android/view/ViewGroup$OnHierarchyChangeListener, com/facebook/react/uimanager/ReactClippingViewGroup, com/facebook/react/uimanager/ReactOverflowViewWithInset, com/facebook/react/views/scroll/ReactScrollViewHelper$HasFlingAnimator, com/facebook/react/views/scroll/ReactScrollViewHelper$HasScrollEventThrottle, com/facebook/react/views/scroll/ReactScrollViewHelper$HasScrollState, com/facebook/react/views/scroll/ReactScrollViewHelper$HasSmoothScroll, com/facebook/react/views/scroll/ReactScrollViewHelper$HasStateWrapper {
public fun <init> (Landroid/content/Context;)V
public fun <init> (Landroid/content/Context;Lcom/facebook/react/views/scroll/FpsListener;)V
@@ -6915,6 +7145,7 @@ public class com/facebook/react/views/scroll/ReactScrollView : android/widget/Sc
public fun setContentOffset (Lcom/facebook/react/bridge/ReadableMap;)V
public fun setDecelerationRate (F)V
public fun setDisableIntervalMomentum (Z)V
public fun setEnableSyncOnScroll (Z)V
public fun setEndFillColor (I)V
public fun setLastScrollDispatchTime (J)V
public fun setMaintainVisibleContentPosition (Lcom/facebook/react/views/scroll/MaintainVisibleScrollPositionHelper$Config;)V
@@ -6996,6 +7227,7 @@ public final class com/facebook/react/views/scroll/ReactScrollViewHelper {
public static final fun updateFabricScrollState (Landroid/view/ViewGroup;)V
public final fun updateFabricScrollState (Landroid/view/ViewGroup;II)V
public static final fun updateStateOnScrollChanged (Landroid/view/ViewGroup;FF)V
public static final fun updateStateOnScrollChanged (Landroid/view/ViewGroup;FFZ)V
}
public abstract interface class com/facebook/react/views/scroll/ReactScrollViewHelper$HasFlingAnimator {
@@ -7078,6 +7310,7 @@ public class com/facebook/react/views/scroll/ReactScrollViewManager : com/facebo
public fun setContentOffset (Lcom/facebook/react/views/scroll/ReactScrollView;Lcom/facebook/react/bridge/ReadableMap;)V
public fun setDecelerationRate (Lcom/facebook/react/views/scroll/ReactScrollView;F)V
public fun setDisableIntervalMomentum (Lcom/facebook/react/views/scroll/ReactScrollView;Z)V
public fun setEnableSyncOnScroll (Lcom/facebook/react/views/scroll/ReactScrollView;Z)V
public fun setFadingEdgeLength (Lcom/facebook/react/views/scroll/ReactScrollView;I)V
public fun setHorizontal (Lcom/facebook/react/views/scroll/ReactScrollView;Z)V
public fun setIsInvertedVirtualizedList (Lcom/facebook/react/views/scroll/ReactScrollView;Z)V
@@ -7103,17 +7336,24 @@ public class com/facebook/react/views/scroll/ReactScrollViewManager : com/facebo
public fun updateState (Lcom/facebook/react/views/scroll/ReactScrollView;Lcom/facebook/react/uimanager/ReactStylesDiffMap;Lcom/facebook/react/uimanager/StateWrapper;)Ljava/lang/Object;
}
public class com/facebook/react/views/scroll/ReactScrollViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/scroll/ReactScrollViewManager;Lcom/facebook/react/views/scroll/ReactScrollView;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/scroll/ScrollEvent : com/facebook/react/uimanager/events/Event {
public static final field Companion Lcom/facebook/react/views/scroll/ScrollEvent$Companion;
public fun canCoalesce ()Z
public fun getEventName ()Ljava/lang/String;
public static final fun obtain (IILcom/facebook/react/views/scroll/ScrollEventType;FFFFIIII)Lcom/facebook/react/views/scroll/ScrollEvent;
public static final fun obtain (IILcom/facebook/react/views/scroll/ScrollEventType;FFFFIIIIZ)Lcom/facebook/react/views/scroll/ScrollEvent;
public static final fun obtain (ILcom/facebook/react/views/scroll/ScrollEventType;FFFFIIII)Lcom/facebook/react/views/scroll/ScrollEvent;
public fun onDispose ()V
}
public final class com/facebook/react/views/scroll/ScrollEvent$Companion {
public final fun obtain (IILcom/facebook/react/views/scroll/ScrollEventType;FFFFIIII)Lcom/facebook/react/views/scroll/ScrollEvent;
public final fun obtain (IILcom/facebook/react/views/scroll/ScrollEventType;FFFFIIIIZ)Lcom/facebook/react/views/scroll/ScrollEvent;
public final fun obtain (ILcom/facebook/react/views/scroll/ScrollEventType;FFFFIIII)Lcom/facebook/react/views/scroll/ScrollEvent;
}
@@ -7145,6 +7385,44 @@ public class com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout : and
public fun setRefreshing (Z)V
}
public class com/facebook/react/views/swiperefresh/SwipeRefreshLayoutManager : com/facebook/react/uimanager/ViewGroupManager, com/facebook/react/viewmanagers/AndroidSwipeRefreshLayoutManagerInterface {
public static final field REACT_CLASS Ljava/lang/String;
public fun <init> ()V
protected synthetic fun addEventEmitters (Lcom/facebook/react/uimanager/ThemedReactContext;Landroid/view/View;)V
protected fun addEventEmitters (Lcom/facebook/react/uimanager/ThemedReactContext;Lcom/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout;)V
protected synthetic fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Landroid/view/View;
protected fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Lcom/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout;
protected fun getDelegate ()Lcom/facebook/react/uimanager/ViewManagerDelegate;
public fun getExportedCustomDirectEventTypeConstants ()Ljava/util/Map;
public fun getExportedViewConstants ()Ljava/util/Map;
public fun getName ()Ljava/lang/String;
public synthetic fun receiveCommand (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
public fun receiveCommand (Lcom/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
public synthetic fun setColors (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
public fun setColors (Lcom/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout;Lcom/facebook/react/bridge/ReadableArray;)V
public synthetic fun setEnabled (Landroid/view/View;Z)V
public fun setEnabled (Lcom/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout;Z)V
public synthetic fun setNativeRefreshing (Landroid/view/View;Z)V
public fun setNativeRefreshing (Lcom/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout;Z)V
public synthetic fun setProgressBackgroundColor (Landroid/view/View;Ljava/lang/Integer;)V
public fun setProgressBackgroundColor (Lcom/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout;Ljava/lang/Integer;)V
public synthetic fun setProgressViewOffset (Landroid/view/View;F)V
public fun setProgressViewOffset (Lcom/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout;F)V
public synthetic fun setRefreshing (Landroid/view/View;Z)V
public fun setRefreshing (Lcom/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout;Z)V
public synthetic fun setSize (Landroid/view/View;Ljava/lang/String;)V
public fun setSize (Lcom/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout;I)V
public fun setSize (Lcom/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout;Lcom/facebook/react/bridge/Dynamic;)V
public fun setSize (Lcom/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout;Ljava/lang/String;)V
}
public class com/facebook/react/views/swiperefresh/SwipeRefreshLayoutManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/swiperefresh/SwipeRefreshLayoutManager;Lcom/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout;Ljava/lang/String;Ljava/lang/Object;)V
}
public class com/facebook/react/views/switchview/ReactSwitchManager : com/facebook/react/uimanager/SimpleViewManager, com/facebook/react/viewmanagers/AndroidSwitchManagerInterface {
public static final field REACT_CLASS Ljava/lang/String;
public fun <init> ()V
@@ -7184,6 +7462,20 @@ public class com/facebook/react/views/switchview/ReactSwitchManager : com/facebo
public fun setValue (Lcom/facebook/react/views/switchview/ReactSwitch;Z)V
}
public class com/facebook/react/views/switchview/ReactSwitchManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/switchview/ReactSwitchManager;Lcom/facebook/react/views/switchview/ReactSwitch;Ljava/lang/String;Ljava/lang/Object;)V
}
public class com/facebook/react/views/switchview/ReactSwitchManager$ReactSwitchShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/switchview/ReactSwitchManager$ReactSwitchShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/text/DefaultStyleValuesUtil {
public static final field INSTANCE Lcom/facebook/react/views/text/DefaultStyleValuesUtil;
public static final fun getDefaultTextColor (Landroid/content/Context;)Landroid/content/res/ColorStateList;
@@ -7261,20 +7553,14 @@ public abstract class com/facebook/react/views/text/ReactBaseTextShadowNode : co
protected fun spannedFromShadowNode (Lcom/facebook/react/views/text/ReactBaseTextShadowNode;Ljava/lang/String;ZLcom/facebook/react/uimanager/NativeViewHierarchyOptimizer;)Landroid/text/Spannable;
}
public final class com/facebook/react/views/text/ReactFontManager {
public static final field Companion Lcom/facebook/react/views/text/ReactFontManager$Companion;
public synthetic fun <init> (Lcom/facebook/react/views/text/ReactFontManager;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun addCustomFont (Landroid/content/Context;Ljava/lang/String;I)V
public final fun addCustomFont (Ljava/lang/String;Landroid/graphics/Typeface;)V
public static final fun getInstance ()Lcom/facebook/react/views/text/ReactFontManager;
public final fun getTypeface (Ljava/lang/String;IILandroid/content/res/AssetManager;)Landroid/graphics/Typeface;
public final fun getTypeface (Ljava/lang/String;ILandroid/content/res/AssetManager;)Landroid/graphics/Typeface;
public final fun getTypeface (Ljava/lang/String;IZLandroid/content/res/AssetManager;)Landroid/graphics/Typeface;
public final fun setTypeface (Ljava/lang/String;ILandroid/graphics/Typeface;)V
}
public final class com/facebook/react/views/text/ReactFontManager$Companion {
public final fun getInstance ()Lcom/facebook/react/views/text/ReactFontManager;
public class com/facebook/react/views/text/ReactFontManager {
public fun addCustomFont (Landroid/content/Context;Ljava/lang/String;I)V
public fun addCustomFont (Ljava/lang/String;Landroid/graphics/Typeface;)V
public static fun getInstance ()Lcom/facebook/react/views/text/ReactFontManager;
public fun getTypeface (Ljava/lang/String;IILandroid/content/res/AssetManager;)Landroid/graphics/Typeface;
public fun getTypeface (Ljava/lang/String;ILandroid/content/res/AssetManager;)Landroid/graphics/Typeface;
public fun getTypeface (Ljava/lang/String;IZLandroid/content/res/AssetManager;)Landroid/graphics/Typeface;
public fun setTypeface (Ljava/lang/String;ILandroid/graphics/Typeface;)V
}
public class com/facebook/react/views/text/ReactRawTextManager : com/facebook/react/uimanager/ViewManager {
@@ -7289,6 +7575,13 @@ public class com/facebook/react/views/text/ReactRawTextManager : com/facebook/re
public fun updateExtraData (Landroid/view/View;Ljava/lang/Object;)V
}
public class com/facebook/react/views/text/ReactRawTextManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/text/ReactRawTextManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
}
public class com/facebook/react/views/text/ReactRawTextShadowNode : com/facebook/react/uimanager/ReactShadowNodeImpl {
public fun <init> ()V
public fun getText ()Ljava/lang/String;
@@ -7297,6 +7590,13 @@ public class com/facebook/react/views/text/ReactRawTextShadowNode : com/facebook
public fun toString ()Ljava/lang/String;
}
public class com/facebook/react/views/text/ReactRawTextShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/text/ReactRawTextShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}
public abstract class com/facebook/react/views/text/ReactTextAnchorViewManager : com/facebook/react/uimanager/BaseViewManager {
public fun <init> ()V
public fun setAccessible (Lcom/facebook/react/views/text/ReactTextView;Z)V
@@ -7331,6 +7631,13 @@ public class com/facebook/react/views/text/ReactTextShadowNode : com/facebook/re
public fun setShouldNotifyOnTextLayout (Z)V
}
public class com/facebook/react/views/text/ReactTextShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/text/ReactTextShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}
public class com/facebook/react/views/text/ReactTextUpdate {
public fun <init> (Landroid/text/Spannable;IZFFFFI)V
public fun <init> (Landroid/text/Spannable;IZFFFFIII)V
@@ -7414,6 +7721,13 @@ public class com/facebook/react/views/text/ReactTextViewManager : com/facebook/r
public fun updateState (Lcom/facebook/react/views/text/ReactTextView;Lcom/facebook/react/uimanager/ReactStylesDiffMap;Lcom/facebook/react/uimanager/StateWrapper;)Ljava/lang/Object;
}
public class com/facebook/react/views/text/ReactTextViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/text/ReactTextViewManager;Lcom/facebook/react/views/text/ReactTextView;Ljava/lang/String;Ljava/lang/Object;)V
}
public abstract interface class com/facebook/react/views/text/ReactTextViewManagerCallback {
public abstract fun onPostProcessSpannable (Landroid/text/Spannable;)V
}
@@ -7426,6 +7740,35 @@ public class com/facebook/react/views/text/ReactTypefaceUtils {
public static fun parseFontWeight (Ljava/lang/String;)I
}
public class com/facebook/react/views/text/ReactVirtualTextShadowNode : com/facebook/react/views/text/ReactBaseTextShadowNode {
public fun <init> ()V
public fun isVirtual ()Z
}
public class com/facebook/react/views/text/ReactVirtualTextShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/text/ReactVirtualTextShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}
public class com/facebook/react/views/text/ReactVirtualTextViewManager : com/facebook/react/uimanager/BaseViewManager {
public fun <init> ()V
public synthetic fun createShadowNodeInstance ()Lcom/facebook/react/uimanager/ReactShadowNode;
public fun createShadowNodeInstance ()Lcom/facebook/react/views/text/ReactVirtualTextShadowNode;
public fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Landroid/view/View;
public fun getName ()Ljava/lang/String;
public fun getShadowNodeClass ()Ljava/lang/Class;
public fun updateExtraData (Landroid/view/View;Ljava/lang/Object;)V
}
public class com/facebook/react/views/text/ReactVirtualTextViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/text/ReactVirtualTextViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
}
public class com/facebook/react/views/text/TextAttributeProps {
public static final field TA_KEY_ACCESSIBILITY_ROLE S
public static final field TA_KEY_ALIGNMENT S
@@ -7573,19 +7916,20 @@ public class com/facebook/react/views/text/TextLayoutManager {
public final class com/facebook/react/views/text/TextTransform : java/lang/Enum {
public static final field CAPITALIZE Lcom/facebook/react/views/text/TextTransform;
public static final field Companion Lcom/facebook/react/views/text/TextTransform$Companion;
public static final field LOWERCASE Lcom/facebook/react/views/text/TextTransform;
public static final field NONE Lcom/facebook/react/views/text/TextTransform;
public static final field UNSET Lcom/facebook/react/views/text/TextTransform;
public static final field UPPERCASE Lcom/facebook/react/views/text/TextTransform;
public static final fun apply (Ljava/lang/String;Lcom/facebook/react/views/text/TextTransform;)Ljava/lang/String;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static fun apply (Ljava/lang/String;Lcom/facebook/react/views/text/TextTransform;)Ljava/lang/String;
public static fun valueOf (Ljava/lang/String;)Lcom/facebook/react/views/text/TextTransform;
public static fun values ()[Lcom/facebook/react/views/text/TextTransform;
}
public final class com/facebook/react/views/text/TextTransform$Companion {
public final fun apply (Ljava/lang/String;Lcom/facebook/react/views/text/TextTransform;)Ljava/lang/String;
public class com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}
public class com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageViewManager : com/facebook/react/uimanager/BaseViewManager {
@@ -7600,6 +7944,13 @@ public class com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInl
public fun updateExtraData (Landroid/view/View;Ljava/lang/Object;)V
}
public class com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
}
public abstract interface class com/facebook/react/views/textinput/ContentSizeWatcher {
public abstract fun onLayout ()V
}
@@ -7787,6 +8138,20 @@ public class com/facebook/react/views/textinput/ReactTextInputManager : com/face
public fun updateState (Lcom/facebook/react/views/textinput/ReactEditText;Lcom/facebook/react/uimanager/ReactStylesDiffMap;Lcom/facebook/react/uimanager/StateWrapper;)Ljava/lang/Object;
}
public class com/facebook/react/views/textinput/ReactTextInputManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/textinput/ReactTextInputManager;Lcom/facebook/react/views/textinput/ReactEditText;Ljava/lang/String;Ljava/lang/Object;)V
}
public class com/facebook/react/views/textinput/ReactTextInputShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/textinput/ReactTextInputShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}
public abstract interface class com/facebook/react/views/textinput/ScrollWatcher {
public abstract fun onScrollChanged (IIII)V
}
@@ -7923,6 +8288,13 @@ public class com/facebook/react/views/view/ReactViewManager : com/facebook/react
protected fun setTransformProperty (Lcom/facebook/react/views/view/ReactViewGroup;Lcom/facebook/react/bridge/ReadableArray;Lcom/facebook/react/bridge/ReadableArray;)V
}
public class com/facebook/react/views/view/ReactViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/view/ReactViewManager;Lcom/facebook/react/views/view/ReactViewGroup;Ljava/lang/String;Ljava/lang/Object;)V
}
public final class com/facebook/react/views/view/ReactViewManager$Companion {
}
@@ -7936,6 +8308,5 @@ public final class com/facebook/react/views/view/ViewGroupClickEvent : com/faceb
public final class com/facebook/react/views/view/WindowUtilKt {
public static final fun setStatusBarTranslucency (Landroid/view/Window;Z)V
public static final fun setStatusBarVisibility (Landroid/view/Window;Z)V
public static final fun setSystemBarsTranslucency (Landroid/view/Window;Z)V
}
@@ -8,12 +8,8 @@ android.useAndroidX=true
react.internal.disableJavaVersionAlignment=true
# Binary Compatibility Validator properties
# We ignore:
# - BuildConfig classes because they are generated and not part of the public API
binaryCompatibilityValidator.ignoredClasses=com.facebook.react.BuildConfig,\
com.facebook.react.views.progressbar.ReactProgressBarViewManager$$PropsSetter,\
com.facebook.react.views.progressbar.ProgressBarShadowNode$$PropsSetter
com.facebook.react.views.unimplementedview.ReactUnimplementedViewManager$$PropsSetter
binaryCompatibilityValidator.ignoredPackages=com.facebook.debug,\
com.facebook.fbreact,\
@@ -5,8 +5,12 @@
* LICENSE file in the root directory of this source tree.
*/
#pragma once
package com.facebook.perftest;
// This header exists for backwards compatibility with libraries importing
// <react/fabric/Binding.h>
#include "FabricUIManagerBinding.h"
/** PerfTestConfig stub. */
public class PerfTestConfig {
public boolean isRunningInPerfTest() {
return false;
}
}
@@ -0,0 +1,266 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.bridge;
import static androidx.core.util.Preconditions.checkNotNull;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/**
* Java {@link HashMap} backed implementation of {@link ReadableMap} and {@link WritableMap}
* Instances of this class SHOULD NOT be used for communication between java and JS, use instances
* of {@link WritableNativeMap} created via {@link Arguments#createMap} or just {@link ReadableMap}
* interface if you want your "native" module method to take a map from JS as an argument.
*
* <p>Main purpose for this class is to be used in java-only unit tests, but could also be used
* outside of tests in the code that operates only in java and needs to communicate with RN modules
* via their JS-exposed API.
*/
public class JavaOnlyMap implements ReadableMap, WritableMap {
private final Map mBackingMap;
public static JavaOnlyMap of(Object... keysAndValues) {
return new JavaOnlyMap(keysAndValues);
}
public static JavaOnlyMap from(Map<String, Object> map) {
return new JavaOnlyMap(map);
}
public static JavaOnlyMap deepClone(ReadableMap map) {
JavaOnlyMap res = new JavaOnlyMap();
ReadableMapKeySetIterator iter = map.keySetIterator();
while (iter.hasNextKey()) {
String propKey = iter.nextKey();
ReadableType type = map.getType(propKey);
switch (type) {
case Null:
res.putNull(propKey);
break;
case Boolean:
res.putBoolean(propKey, map.getBoolean(propKey));
break;
case Number:
res.putDouble(propKey, map.getDouble(propKey));
break;
case String:
res.putString(propKey, map.getString(propKey));
break;
case Map:
res.putMap(propKey, deepClone(map.getMap(propKey)));
break;
case Array:
res.putArray(propKey, JavaOnlyArray.deepClone(map.getArray(propKey)));
break;
}
}
return res;
}
/**
* @param keysAndValues keys and values, interleaved
*/
private JavaOnlyMap(Object... keysAndValues) {
if (keysAndValues.length % 2 != 0) {
throw new IllegalArgumentException("You must provide the same number of keys and values");
}
mBackingMap = new HashMap();
for (int i = 0; i < keysAndValues.length; i += 2) {
Object val = keysAndValues[i + 1];
if (val instanceof Number) {
// all values from JS are doubles, so emulate that here for tests.
val = ((Number) val).doubleValue();
}
mBackingMap.put(keysAndValues[i], val);
}
}
public JavaOnlyMap() {
mBackingMap = new HashMap();
}
@Override
public boolean hasKey(@NonNull String name) {
return mBackingMap.containsKey(name);
}
@Override
public boolean isNull(@NonNull String name) {
return mBackingMap.get(name) == null;
}
@Override
public boolean getBoolean(@NonNull String name) {
return (Boolean) mBackingMap.get(name);
}
@Override
public double getDouble(@NonNull String name) {
return ((Number) mBackingMap.get(name)).doubleValue();
}
@Override
public int getInt(@NonNull String name) {
return ((Number) mBackingMap.get(name)).intValue();
}
@Override
public long getLong(@NonNull String name) {
return ((Number) checkNotNull(mBackingMap.get(name))).longValue();
}
@Override
public String getString(@NonNull String name) {
return (String) mBackingMap.get(name);
}
@Override
public ReadableMap getMap(@NonNull String name) {
return (ReadableMap) mBackingMap.get(name);
}
@Override
public ReadableArray getArray(@NonNull String name) {
return (ReadableArray) mBackingMap.get(name);
}
@Override
public @NonNull Dynamic getDynamic(@NonNull String name) {
return DynamicFromMap.create(this, name);
}
@Override
public @NonNull ReadableType getType(@NonNull String name) {
Object value = mBackingMap.get(name);
if (value == null) {
return ReadableType.Null;
} else if (value instanceof Number) {
return ReadableType.Number;
} else if (value instanceof String) {
return ReadableType.String;
} else if (value instanceof Boolean) {
return ReadableType.Boolean;
} else if (value instanceof ReadableMap) {
return ReadableType.Map;
} else if (value instanceof ReadableArray) {
return ReadableType.Array;
} else if (value instanceof Dynamic) {
return ((Dynamic) value).getType();
} else {
throw new IllegalArgumentException(
"Invalid value " + value.toString() + " for key " + name + "contained in JavaOnlyMap");
}
}
@Override
public @NonNull Iterator<Map.Entry<String, Object>> getEntryIterator() {
return mBackingMap.entrySet().iterator();
}
@Override
public @NonNull ReadableMapKeySetIterator keySetIterator() {
return new ReadableMapKeySetIterator() {
Iterator<Map.Entry<String, Object>> mIterator = mBackingMap.entrySet().iterator();
@Override
public boolean hasNextKey() {
return mIterator.hasNext();
}
@Override
public String nextKey() {
return mIterator.next().getKey();
}
};
}
@Override
public void putBoolean(@NonNull String key, boolean value) {
mBackingMap.put(key, value);
}
@Override
public void putDouble(@NonNull String key, double value) {
mBackingMap.put(key, value);
}
@Override
public void putInt(@NonNull String key, int value) {
mBackingMap.put(key, new Double(value));
}
@Override
public void putLong(@NonNull String key, long value) {
mBackingMap.put(key, value);
}
@Override
public void putString(@NonNull String key, @Nullable String value) {
mBackingMap.put(key, value);
}
@Override
public void putNull(@NonNull String key) {
mBackingMap.put(key, null);
}
@Override
public void putMap(@NonNull String key, @Nullable ReadableMap value) {
mBackingMap.put(key, value);
}
@Override
public void merge(@NonNull ReadableMap source) {
mBackingMap.putAll(((JavaOnlyMap) source).mBackingMap);
}
@Override
public WritableMap copy() {
final JavaOnlyMap target = new JavaOnlyMap();
target.merge(this);
return target;
}
@Override
public void putArray(@NonNull String key, @Nullable ReadableArray value) {
mBackingMap.put(key, value);
}
@Override
public @NonNull HashMap<String, Object> toHashMap() {
return new HashMap<String, Object>(mBackingMap);
}
@Override
public String toString() {
return mBackingMap.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
JavaOnlyMap that = (JavaOnlyMap) o;
if (mBackingMap != null ? !mBackingMap.equals(that.mBackingMap) : that.mBackingMap != null)
return false;
return true;
}
@Override
public int hashCode() {
return mBackingMap != null ? mBackingMap.hashCode() : 0;
}
}
@@ -1,180 +0,0 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.bridge
import java.util.HashMap
import kotlin.collections.Iterator
import kotlin.collections.Map
/**
* Java [HashMap] backed implementation of [ReadableMap] and [WritableMap] Instances of this class
* SHOULD NOT be used for communication between java and JS, use instances of [WritableNativeMap]
* created via [Arguments#createMap] or just [ReadableMap] interface if you want your "native"
* module method to take a map from JS as an argument.
*
* Main purpose for this class is to be used in java-only unit tests, but could also be used outside
* of tests in the code that operates only in java and needs to communicate with RN modules via
* their JS-exposed API.
*/
public class JavaOnlyMap() : ReadableMap, WritableMap {
public companion object {
@JvmStatic public fun of(vararg keysAndValues: Any?): JavaOnlyMap = JavaOnlyMap(*keysAndValues)
@JvmStatic public fun from(map: Map<String, Any?>): JavaOnlyMap = JavaOnlyMap(map)
@JvmStatic
public fun deepClone(map: ReadableMap?): JavaOnlyMap {
val res = JavaOnlyMap()
if (map == null) {
return res
}
val iter = map.keySetIterator()
while (iter.hasNextKey()) {
val propKey = iter.nextKey()
val type = map.getType(propKey)
when (type) {
ReadableType.Null -> res.putNull(propKey)
ReadableType.Boolean -> res.putBoolean(propKey, map.getBoolean(propKey))
ReadableType.Number -> res.putDouble(propKey, map.getDouble(propKey))
ReadableType.String -> res.putString(propKey, map.getString(propKey))
ReadableType.Map -> res.putMap(propKey, deepClone(map.getMap(propKey)))
ReadableType.Array ->
res.putArray(propKey, JavaOnlyArray.deepClone(map.getArray(propKey)))
}
}
return res
}
}
private val backingMap: MutableMap<String, Any?> = HashMap()
/** @param keysAndValues keys and values, interleaved */
private constructor(vararg keysAndValues: Any?) : this() {
require(keysAndValues.size % 2 == 0) { "You must provide the same number of keys and values" }
for (i in keysAndValues.indices step 2) {
var value = keysAndValues[i + 1]
if (value is Number) {
// all values from JS are doubles, so emulate that here for tests.
value = value.toDouble()
}
backingMap[keysAndValues[i] as String] = value
}
}
override fun hasKey(name: String): Boolean = backingMap.containsKey(name)
override fun isNull(name: String): Boolean = backingMap[name] == null
override fun getBoolean(name: String): Boolean = backingMap[name] as Boolean
override fun getDouble(name: String): Double = (backingMap[name] as Number).toDouble()
override fun getInt(name: String): Int = (backingMap[name] as Number).toInt()
override fun getLong(name: String): Long = (backingMap[name] as Number).toLong()
override fun getString(name: String): String? = backingMap[name] as String?
override fun getMap(name: String): ReadableMap? = backingMap[name] as ReadableMap?
override fun getArray(name: String): ReadableArray? = backingMap[name] as ReadableArray?
override fun getDynamic(name: String): Dynamic = DynamicFromMap.create(this, name)
override fun getType(name: String): ReadableType {
val value = backingMap[name]
return when {
value == null -> ReadableType.Null
value is Number -> ReadableType.Number
value is String -> ReadableType.String
value is Boolean -> ReadableType.Boolean
value is ReadableMap -> ReadableType.Map
value is ReadableArray -> ReadableType.Array
value is Dynamic -> value.type
else -> {
throw IllegalArgumentException(
"Invalid value $value for key $name contained in JavaOnlyMap")
}
}
}
override val entryIterator: Iterator<Map.Entry<String, Any?>>
get() = backingMap.entries.iterator()
override fun keySetIterator(): ReadableMapKeySetIterator {
return object : ReadableMapKeySetIterator {
private val iterator = backingMap.entries.iterator()
override fun hasNextKey(): Boolean = iterator.hasNext()
override fun nextKey(): String = iterator.next().key
}
}
override fun putBoolean(key: String, value: Boolean) {
backingMap[key] = value
}
override fun putDouble(key: String, value: Double) {
backingMap[key] = value
}
override fun putInt(key: String, value: Int) {
backingMap[key] = value.toDouble()
}
override fun putLong(key: String, value: Long) {
backingMap[key] = value.toDouble()
}
override fun putString(key: String, value: String?) {
backingMap[key] = value
}
override fun putNull(key: String) {
backingMap[key] = null
}
override fun putMap(key: String, value: ReadableMap?) {
backingMap[key] = value
}
override fun merge(source: ReadableMap) {
backingMap.putAll((source as JavaOnlyMap).backingMap)
}
override fun copy(): WritableMap {
val target = JavaOnlyMap()
target.merge(this)
return target
}
override fun putArray(key: String, value: ReadableArray?) {
backingMap[key] = value
}
public fun remove(key: String) {
backingMap.remove(key)
}
override fun toHashMap(): HashMap<String, Any?> = HashMap<String, Any?>(backingMap)
override fun toString(): String = backingMap.toString()
override fun equals(other: Any?): Boolean {
return if (this === other) {
true
} else if (other == null || javaClass != other.javaClass) {
false
} else {
backingMap == (other as JavaOnlyMap).backingMap
}
}
override fun hashCode(): Int = backingMap.hashCode()
}
@@ -16,7 +16,7 @@ import kotlin.collections.Map
* Kotlin.
*/
public interface ReadableMap {
public val entryIterator: Iterator<Map.Entry<String, Any?>>
public val entryIterator: Iterator<Map.Entry<String, Any>>
public fun getArray(name: String): ReadableArray?
@@ -42,5 +42,5 @@ public interface ReadableMap {
public fun keySetIterator(): ReadableMapKeySetIterator
public fun toHashMap(): HashMap<String, Any?>
public fun toHashMap(): HashMap<String, Any>
}
@@ -20,10 +20,10 @@ public open class ReadableNativeMap protected constructor() : NativeMap(), Reada
private val keys: Array<String> by
lazy(LazyThreadSafetyMode.SYNCHRONIZED) { importKeys().also { jniPassCounter++ } }
private val localMap: HashMap<String, Any?> by
private val localMap: HashMap<String, Any> by
lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
val length = keys.size
val res = HashMap<String, Any?>(length)
val res = HashMap<String, Any>(length)
val values = importValues()
jniPassCounter++
for (i in 0 until length) {
@@ -157,7 +157,7 @@ public open class ReadableNativeMap protected constructor() : NativeMap(), Reada
false
} else localMap == other.localMap
override fun toHashMap(): HashMap<String, Any?> {
override fun toHashMap(): HashMap<String, Any> {
// we can almost just return getLocalMap(), but we need to convert nested arrays and maps to the
// correct types first
val hashMap = HashMap(localMap)
@@ -12,7 +12,6 @@ import androidx.annotation.AnyThread
import androidx.annotation.UiThread
import com.facebook.infer.annotation.ThreadConfined
import com.facebook.react.common.annotations.UnstableReactNativeAPI
import com.facebook.react.uimanager.events.EventDispatcher
@OptIn(UnstableReactNativeAPI::class)
public interface UIManager : PerformanceCounter {
@@ -79,7 +78,7 @@ public interface UIManager : PerformanceCounter {
public fun dispatchCommand(reactTag: Int, commandId: String, commandArgs: ReadableArray?)
/** @return the [EventDispatcher] object that is used by this class. */
public val eventDispatcher: EventDispatcher
public val eventDispatcher: Any?
/**
* Used by native animated module to bypass the process of updating the values through the shadow
@@ -17,7 +17,7 @@ import java.util.concurrent.TimeoutException
* A super simple Future-like class that can safely notify another Thread when a value is ready.
* Does not support canceling.
*/
internal class SimpleSettableFuture<T> : Future<T?> {
public class SimpleSettableFuture<T> : Future<T?> {
private val readyLatch = CountDownLatch(1)
private var result: T? = null
@@ -13,7 +13,7 @@ import okhttp3.OkHttpClient
/**
* Helper class that provides the necessary methods for canceling queued and running OkHttp calls
*/
internal object OkHttpCallUtil {
public object OkHttpCallUtil {
@JvmStatic
public fun cancelTag(client: OkHttpClient, tag: Any) {
// client.dispatcher is private, so we need to use reflection to access
@@ -22,7 +22,7 @@ import java.io.InputStream
import java.util.concurrent.Executors
@ReactModule(name = NativeImageStoreAndroidSpec.NAME)
internal class ImageStoreManager(reactContext: ReactApplicationContext) :
public class ImageStoreManager(reactContext: ReactApplicationContext) :
NativeImageStoreAndroidSpec(reactContext) {
/**
@@ -16,14 +16,14 @@ import com.facebook.react.module.annotations.ReactModule
/** A module that allows JS to get/set clipboard contents. */
@ReactModule(name = NativeClipboardSpec.NAME)
internal class ClipboardModule(context: ReactApplicationContext) : NativeClipboardSpec(context) {
public class ClipboardModule(context: ReactApplicationContext) : NativeClipboardSpec(context) {
private val clipboardService: ClipboardManager
get() =
getReactApplicationContext().getSystemService(ReactApplicationContext.CLIPBOARD_SERVICE)
as ClipboardManager
override fun getString(promise: Promise) {
public override fun getString(promise: Promise) {
try {
val clipboard = clipboardService
val clipData = clipboard.primaryClip
@@ -38,12 +38,12 @@ internal class ClipboardModule(context: ReactApplicationContext) : NativeClipboa
}
}
override fun setString(text: String?) {
public override fun setString(text: String?) {
val clipdata: ClipData = ClipData.newPlainText(null, text)
clipboardService.setPrimaryClip(clipdata)
}
companion object {
const val NAME: String = NativeClipboardSpec.NAME
public companion object {
public const val NAME: String = NativeClipboardSpec.NAME
}
}
@@ -18,7 +18,7 @@ import com.facebook.react.module.annotations.ReactModule
/** [NativeModule] that allows JS to show dev loading view. */
@ReactModule(name = NativeDevLoadingViewSpec.NAME)
internal class DevLoadingModule(reactContext: ReactApplicationContext) :
public class DevLoadingModule(reactContext: ReactApplicationContext) :
NativeDevLoadingViewSpec(reactContext) {
private val jsExceptionHandler: JSExceptionHandler? = reactContext.jsExceptionHandler
@@ -15,9 +15,7 @@ import android.net.Uri;
import android.nfc.NfcAdapter;
import android.provider.Settings;
import androidx.annotation.Nullable;
import androidx.core.util.Preconditions;
import com.facebook.fbreact.specs.NativeIntentAndroidSpec;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.react.bridge.JSApplicationIllegalArgumentException;
import com.facebook.react.bridge.LifecycleEventListener;
import com.facebook.react.bridge.Promise;
@@ -30,7 +28,6 @@ import java.util.ArrayList;
import java.util.List;
/** Intent module. Launch other activities or open URLs. */
@Nullsafe(Nullsafe.Mode.LOCAL)
@ReactModule(name = NativeIntentAndroidSpec.NAME)
public class IntentModule extends NativeIntentAndroidSpec {
@@ -127,7 +124,7 @@ public class IntentModule extends NativeIntentAndroidSpec {
* @param url the URL to open
*/
@Override
public void openURL(@Nullable String url, Promise promise) {
public void openURL(String url, Promise promise) {
if (url == null || url.isEmpty()) {
promise.reject(new JSApplicationIllegalArgumentException("Invalid URL: " + url));
return;
@@ -152,7 +149,7 @@ public class IntentModule extends NativeIntentAndroidSpec {
* @param promise a promise that is always resolved with a boolean argument
*/
@Override
public void canOpenURL(@Nullable String url, Promise promise) {
public void canOpenURL(String url, Promise promise) {
if (url == null || url.isEmpty()) {
promise.reject(new JSApplicationIllegalArgumentException("Invalid URL: " + url));
return;
@@ -163,8 +160,8 @@ public class IntentModule extends NativeIntentAndroidSpec {
// We need Intent.FLAG_ACTIVITY_NEW_TASK since getReactApplicationContext() returns
// the ApplicationContext instead of the Activity context.
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PackageManager packageManager = getReactApplicationContext().getPackageManager();
boolean canOpen = packageManager != null && intent.resolveActivity(packageManager) != null;
boolean canOpen =
intent.resolveActivity(getReactApplicationContext().getPackageManager()) != null;
promise.resolve(canOpen);
} catch (Exception e) {
promise.reject(
@@ -182,7 +179,7 @@ public class IntentModule extends NativeIntentAndroidSpec {
public void openSettings(Promise promise) {
try {
Intent intent = new Intent();
Activity currentActivity = Preconditions.checkNotNull(getCurrentActivity());
Activity currentActivity = getCurrentActivity();
String selfPackageName = getReactApplicationContext().getPackageName();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
@@ -222,7 +219,7 @@ public class IntentModule extends NativeIntentAndroidSpec {
Intent intent = new Intent(action);
PackageManager packageManager = getReactApplicationContext().getPackageManager();
if (packageManager == null || intent.resolveActivity(packageManager) == null) {
if (intent.resolveActivity(packageManager) == null) {
promise.reject(
new JSApplicationIllegalArgumentException(
"Could not launch Intent with action " + action + "."));
@@ -238,7 +235,6 @@ public class IntentModule extends NativeIntentAndroidSpec {
switch (type) {
case String:
{
// NULLSAFE_FIXME[Parameter Not Nullable]
intent.putExtra(name, map.getString(EXTRA_MAP_KEY_FOR_VALUE));
break;
}
@@ -248,13 +244,11 @@ public class IntentModule extends NativeIntentAndroidSpec {
// See: https://github.com/facebook/react-native/issues/4141
// We might need to find a workaround if this is really an issue
Double number = map.getDouble(EXTRA_MAP_KEY_FOR_VALUE);
// NULLSAFE_FIXME[Parameter Not Nullable]
intent.putExtra(name, number);
break;
}
case Boolean:
{
// NULLSAFE_FIXME[Parameter Not Nullable]
intent.putExtra(name, map.getBoolean(EXTRA_MAP_KEY_FOR_VALUE));
break;
}
@@ -276,13 +270,8 @@ public class IntentModule extends NativeIntentAndroidSpec {
Activity currentActivity = getCurrentActivity();
String selfPackageName = getReactApplicationContext().getPackageName();
PackageManager packageManager = getReactApplicationContext().getPackageManager();
ComponentName componentName = null;
if (packageManager == null) {
componentName = intent.getComponent();
} else {
componentName = intent.resolveActivity(packageManager);
}
ComponentName componentName =
intent.resolveActivity(getReactApplicationContext().getPackageManager());
String otherPackageName = (componentName != null ? componentName.getPackageName() : "");
// If there is no currentActivity or we are launching to a different package we need to set
@@ -20,10 +20,10 @@ import com.facebook.react.module.annotations.ReactModule
@SuppressLint("MissingPermission")
@ReactModule(name = NativeVibrationSpec.NAME)
internal class VibrationModule(reactContext: ReactApplicationContext) :
public class VibrationModule(reactContext: ReactApplicationContext) :
NativeVibrationSpec(reactContext) {
override fun vibrate(durationDouble: Double) {
public override fun vibrate(durationDouble: Double) {
val duration = durationDouble.toInt()
val v = getVibrator() ?: return
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
@@ -33,7 +33,7 @@ internal class VibrationModule(reactContext: ReactApplicationContext) :
}
}
override fun vibrateByPattern(pattern: ReadableArray, repeatDouble: Double) {
public override fun vibrateByPattern(pattern: ReadableArray, repeatDouble: Double) {
val repeat = repeatDouble.toInt()
val v = getVibrator() ?: return
val patternLong = LongArray(pattern.size())
@@ -47,7 +47,7 @@ internal class VibrationModule(reactContext: ReactApplicationContext) :
}
}
override fun cancel() {
public override fun cancel() {
getVibrator()?.cancel()
}
@@ -62,7 +62,7 @@ internal class VibrationModule(reactContext: ReactApplicationContext) :
getReactApplicationContext().getSystemService(Context.VIBRATOR_SERVICE) as Vibrator?
}
companion object {
const val NAME: String = NativeVibrationSpec.NAME
public companion object {
public const val NAME: String = NativeVibrationSpec.NAME
}
}
@@ -19,7 +19,6 @@ import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.DynamicFromObject;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.common.annotations.UnstableReactNativeAPI;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.facebook.react.uimanager.annotations.ReactPropGroup;
import com.facebook.react.uimanager.annotations.ReactPropertyHolder;
@@ -269,7 +268,6 @@ public class ReactPropertyProcessor extends ProcessorBase {
TypeSpec holderClass =
TypeSpec.classBuilder(holderClassName)
.addSuperinterface(superType)
.addAnnotation(UnstableReactNativeAPI.class)
.addModifiers(PUBLIC)
.addMethod(generateSetPropertySpec(classInfo, properties))
.addMethod(getMethods)
@@ -9,7 +9,7 @@ package com.facebook.react.reactperflogger
import com.facebook.jni.HybridData
internal abstract class NativeModulePerfLogger protected constructor() {
public abstract class NativeModulePerfLogger protected constructor() {
@Suppress("NoHungarianNotation") private val mHybridData: HybridData
@@ -20,25 +20,25 @@ internal abstract class NativeModulePerfLogger protected constructor() {
protected abstract fun initHybrid(): HybridData
abstract fun moduleDataCreateStart(moduleName: String, id: Int)
public abstract fun moduleDataCreateStart(moduleName: String, id: Int)
abstract fun moduleDataCreateEnd(moduleName: String, id: Int)
public abstract fun moduleDataCreateEnd(moduleName: String, id: Int)
abstract fun moduleCreateStart(moduleName: String, id: Int)
public abstract fun moduleCreateStart(moduleName: String, id: Int)
abstract fun moduleCreateCacheHit(moduleName: String, id: Int)
public abstract fun moduleCreateCacheHit(moduleName: String, id: Int)
abstract fun moduleCreateConstructStart(moduleName: String, id: Int)
public abstract fun moduleCreateConstructStart(moduleName: String, id: Int)
abstract fun moduleCreateConstructEnd(moduleName: String, id: Int)
public abstract fun moduleCreateConstructEnd(moduleName: String, id: Int)
abstract fun moduleCreateSetUpStart(moduleName: String, id: Int)
public abstract fun moduleCreateSetUpStart(moduleName: String, id: Int)
abstract fun moduleCreateSetUpEnd(moduleName: String, id: Int)
public abstract fun moduleCreateSetUpEnd(moduleName: String, id: Int)
abstract fun moduleCreateEnd(moduleName: String, id: Int)
public abstract fun moduleCreateEnd(moduleName: String, id: Int)
abstract fun moduleCreateFail(moduleName: String, id: Int)
public abstract fun moduleCreateFail(moduleName: String, id: Int)
/** Subclasses will override this method to load their own SO libraries. */
@Synchronized
@@ -21,15 +21,14 @@ import com.facebook.react.bridge.RuntimeExecutor
import com.facebook.react.bridge.RuntimeScheduler
import com.facebook.react.bridge.UIManager
import com.facebook.react.bridge.queue.ReactQueueConfiguration
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
import com.facebook.react.common.annotations.VisibleForTesting
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModuleRegistry
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder
import com.facebook.react.turbomodule.core.interfaces.NativeMethodCallInvokerHolder
@DoNotStrip
@Deprecated(
message =
"This class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.")
@DeprecatedInNewArchitecture
public class BridgelessCatalystInstance(private val reactHost: ReactHostImpl) : CatalystInstance {
override fun handleMemoryPressure(level: Int) {
@@ -148,23 +147,23 @@ public class BridgelessCatalystInstance(private val reactHost: ReactHostImpl) :
throw UnsupportedOperationException("Unimplemented method 'setGlobalVariable'")
}
@Deprecated(
@DeprecatedInNewArchitecture(
message =
"This class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.")
"This method will be deprecated later as part of Stable APIs with bridge removal and not encouraged usage.")
override fun setTurboModuleRegistry(turboModuleRegistry: TurboModuleRegistry) {
throw UnsupportedOperationException("Unimplemented method 'setTurboModuleRegistry'")
}
@Deprecated(
@DeprecatedInNewArchitecture(
message =
"This class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.")
"This method will be deprecated later as part of Stable APIs with bridge removal and not encouraged usage.")
override fun setFabricUIManager(fabricUIManager: UIManager) {
throw UnsupportedOperationException("Unimplemented method 'setFabricUIManager'")
}
@Deprecated(
@DeprecatedInNewArchitecture(
message =
"This class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.")
"This method will be deprecated later as part of Stable APIs with bridge removal and not encouraged usage.")
override fun getFabricUIManager(): UIManager {
throw UnsupportedOperationException("Unimplemented method 'getFabricUIManager'")
}
@@ -774,8 +774,6 @@ public class UIImplementation {
mViewManagers.invalidate();
}
// NOTE: When converted to Kotlin this method should be `internal` due to
// visibility restriction for `NotThreadSafeViewHierarchyUpdateDebugListener`
public void setViewHierarchyUpdateDebugListener(
@Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener) {
mOperationsQueue.setViewHierarchyUpdateDebugListener(listener);
@@ -687,8 +687,6 @@ public class UIManagerModule extends ReactContextBaseJavaModule
}
}
// NOTE: When converted to Kotlin this method should be `internal` due to
// visibility restriction for `NotThreadSafeViewHierarchyUpdateDebugListener`
public void setViewHierarchyUpdateDebugListener(
@Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener) {
mUIImplementation.setViewHierarchyUpdateDebugListener(listener);
@@ -609,8 +609,6 @@ public class UIViewOperationQueue {
return mNativeViewHierarchyManager;
}
// NOTE: When converted to Kotlin this method should be `internal` due to
// visibility restriction for `NotThreadSafeViewHierarchyUpdateDebugListener`
public void setViewHierarchyUpdateDebugListener(
@Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener) {
mViewHierarchyUpdateDebugListener = listener;
@@ -5,22 +5,26 @@
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.uimanager.debug
package com.facebook.react.uimanager.debug;
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
import com.facebook.react.uimanager.UIManagerModule;
/**
* A listener that is notified about view hierarchy update events. This listener should only be used
* for debug purposes and should not affect application state.
*
* NB: while [onViewHierarchyUpdateFinished] will always be called from the UI thread, there are no
* <p>NB: while onViewHierarchyUpdateFinished will always be called from the UI thread, there are no
* guarantees what thread onViewHierarchyUpdateEnqueued is called on.
*/
@DeprecatedInNewArchitecture
internal interface NotThreadSafeViewHierarchyUpdateDebugListener {
/** Called when `UIManagerModule` enqueues a UI batch to be dispatched to the main thread. */
fun onViewHierarchyUpdateEnqueued()
public interface NotThreadSafeViewHierarchyUpdateDebugListener {
/**
* Called when {@link UIManagerModule} enqueues a UI batch to be dispatched to the main thread.
*/
void onViewHierarchyUpdateEnqueued();
/** Called from the main thread after a UI batch has been applied to all root views. */
fun onViewHierarchyUpdateFinished()
void onViewHierarchyUpdateFinished();
}
@@ -0,0 +1,138 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.uimanager.util;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.react.R;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
/** Finds views in React Native view hierarchies */
@Nullsafe(Nullsafe.Mode.LOCAL)
public class ReactFindViewUtil {
private static final List<OnViewFoundListener> mOnViewFoundListeners = new ArrayList<>();
private static final Map<OnMultipleViewsFoundListener, Set<String>>
mOnMultipleViewsFoundListener = new HashMap<>();
/** Callback to be invoked when a react native view has been found */
public interface OnViewFoundListener {
/** Returns the native id of the view of interest */
String getNativeId();
/**
* Called when the view has been found
*
* @param view
*/
void onViewFound(View view);
}
/** Callback to be invoked when all react native views with geiven NativeIds have been found */
public interface OnMultipleViewsFoundListener {
void onViewFound(View view, String nativeId);
}
/**
* Finds a view that is tagged with {@param nativeId} as its nativeID prop under the {@param root}
* view hierarchy. Returns the view if found, null otherwise.
*
* @param root root of the view hierarchy from which to find the view
*/
public static @Nullable View findView(View root, String nativeId) {
String tag = getNativeId(root);
if (tag != null && tag.equals(nativeId)) {
return root;
}
if (root instanceof ViewGroup) {
ViewGroup viewGroup = (ViewGroup) root;
for (int i = 0; i < viewGroup.getChildCount(); i++) {
View view = findView(viewGroup.getChildAt(i), nativeId);
if (view != null) {
return view;
}
}
}
return null;
}
/**
* Finds a view tagged with {@param onViewFoundListener}'s nativeID in the given {@param root}
* view hierarchy. If the view does not exist yet due to React Native's async layout, a listener
* will be added. When the view is found, the {@param onViewFoundListener} will be invoked.
*
* @param root root of the view hierarchy from which to find the view
*/
public static void findView(View root, OnViewFoundListener onViewFoundListener) {
View view = findView(root, onViewFoundListener.getNativeId());
if (view != null) {
onViewFoundListener.onViewFound(view);
}
addViewListener(onViewFoundListener);
}
/**
* Registers an OnViewFoundListener to be invoked when a view with a matching nativeID is found.
* Remove this listener using removeViewListener() if it's no longer needed.
*/
public static void addViewListener(OnViewFoundListener onViewFoundListener) {
mOnViewFoundListeners.add(onViewFoundListener);
}
/** Removes an OnViewFoundListener previously registered with addViewListener(). */
public static void removeViewListener(OnViewFoundListener onViewFoundListener) {
mOnViewFoundListeners.remove(onViewFoundListener);
}
public static void addViewsListener(OnMultipleViewsFoundListener listener, Set<String> ids) {
mOnMultipleViewsFoundListener.put(listener, ids);
}
public static void removeViewsListener(OnMultipleViewsFoundListener listener) {
mOnMultipleViewsFoundListener.remove(listener);
}
/** Invokes any listeners that are listening on this {@param view}'s native id */
public static void notifyViewRendered(View view) {
String nativeId = getNativeId(view);
if (nativeId == null) {
return;
}
Iterator<OnViewFoundListener> iterator = mOnViewFoundListeners.iterator();
while (iterator.hasNext()) {
OnViewFoundListener listener = iterator.next();
if (nativeId.equals(listener.getNativeId())) {
listener.onViewFound(view);
iterator.remove();
}
}
for (Map.Entry<OnMultipleViewsFoundListener, Set<String>> entry :
mOnMultipleViewsFoundListener.entrySet()) {
Set<String> nativeIds = entry.getValue();
if (nativeIds != null && nativeIds.contains(nativeId)) {
entry.getKey().onViewFound(view, nativeId);
}
}
}
private static @Nullable String getNativeId(View view) {
Object tag = view.getTag(R.id.view_tag_native_id);
return tag instanceof String ? (String) tag : null;
}
}
@@ -1,129 +0,0 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.uimanager.util
import android.view.View
import android.view.ViewGroup
import com.facebook.react.R
import java.util.ArrayList
import java.util.HashMap
/** Finds views in React Native view hierarchies */
public object ReactFindViewUtil {
private val onViewFoundListeners: MutableList<OnViewFoundListener> = ArrayList()
private val onMultipleViewsFoundListener: MutableMap<OnMultipleViewsFoundListener, Set<String>> =
HashMap()
/** Callback to be invoked when a react native view has been found */
public interface OnViewFoundListener {
/** Returns the native id of the view of interest */
public fun getNativeId(): String
/**
* Called when the view has been found
*
* @param view
*/
public fun onViewFound(view: View)
}
/** Callback to be invoked when all react native views with geiven NativeIds have been found */
public fun interface OnMultipleViewsFoundListener {
public fun onViewFound(view: View, nativeId: String)
}
/**
* Finds a view that is tagged with {@param nativeId} as its nativeID prop under the {@param root}
* view hierarchy. Returns the view if found, null otherwise.
*
* @param root root of the view hierarchy from which to find the view
*/
@JvmStatic
public fun findView(root: View, nativeId: String): View? {
if (getNativeId(root) == nativeId) {
return root
}
if (root is ViewGroup) {
for (i in 0..<root.childCount) {
val view = findView(root.getChildAt(i), nativeId)
if (view != null) {
return view
}
}
}
return null
}
/**
* Finds a view tagged with {@param onViewFoundListener}'s nativeID in the given {@param root}
* view hierarchy. If the view does not exist yet due to React Native's async layout, a listener
* will be added. When the view is found, the {@param onViewFoundListener} will be invoked.
*
* @param root root of the view hierarchy from which to find the view
*/
@JvmStatic
public fun findView(root: View, onViewFoundListener: OnViewFoundListener): Unit {
val view = findView(root, onViewFoundListener.getNativeId())
if (view != null) {
onViewFoundListener.onViewFound(view)
}
addViewListener(onViewFoundListener)
}
/**
* Registers an OnViewFoundListener to be invoked when a view with a matching nativeID is found.
* Remove this listener using removeViewListener() if it's no longer needed.
*/
@JvmStatic
public fun addViewListener(onViewFoundListener: OnViewFoundListener): Unit {
onViewFoundListeners.add(onViewFoundListener)
}
/** Removes an OnViewFoundListener previously registered with addViewListener(). */
@JvmStatic
public fun removeViewListener(onViewFoundListener: OnViewFoundListener): Unit {
onViewFoundListeners.remove(onViewFoundListener)
}
@JvmStatic
public fun addViewsListener(listener: OnMultipleViewsFoundListener, ids: Set<String>): Unit {
onMultipleViewsFoundListener[listener] = ids
}
@JvmStatic
public fun removeViewsListener(listener: OnMultipleViewsFoundListener): Unit {
onMultipleViewsFoundListener.remove(listener)
}
/** Invokes any listeners that are listening on this {@param view}'s native id */
@JvmStatic
public fun notifyViewRendered(view: View): Unit {
val nativeId = getNativeId(view) ?: return
val iterator = onViewFoundListeners.iterator()
while (iterator.hasNext()) {
val listener = iterator.next()
if (nativeId == listener.getNativeId()) {
listener.onViewFound(view)
iterator.remove()
}
}
onMultipleViewsFoundListener.forEach { (listener, nativeIds) ->
if (nativeId in nativeIds) {
listener.onViewFound(view, nativeId)
}
}
}
private fun getNativeId(view: View): String? {
val tag = view.getTag(R.id.view_tag_native_id)
return tag as? String
}
}
@@ -17,24 +17,108 @@ import com.facebook.react.module.annotations.ReactModule
import com.facebook.react.uimanager.PixelUtil.dpToPx
import com.facebook.react.uimanager.SimpleViewManager
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.uimanager.ViewManagerDelegate
import com.facebook.react.viewmanagers.DebuggingOverlayManagerDelegate
import com.facebook.react.viewmanagers.DebuggingOverlayManagerInterface
@ReactModule(name = DebuggingOverlayManager.REACT_CLASS)
public class DebuggingOverlayManager :
SimpleViewManager<DebuggingOverlay>(), DebuggingOverlayManagerInterface<DebuggingOverlay> {
private val delegate: ViewManagerDelegate<DebuggingOverlay> =
DebuggingOverlayManagerDelegate(this)
public override fun getDelegate(): ViewManagerDelegate<DebuggingOverlay> = delegate
public class DebuggingOverlayManager : SimpleViewManager<DebuggingOverlay>() {
override fun receiveCommand(view: DebuggingOverlay, commandId: String, args: ReadableArray?) {
when (commandId) {
"highlightTraceUpdates" -> highlightTraceUpdates(view, args)
"highlightElements" -> highlightElements(view, args)
"clearElementsHighlights" -> clearElementsHighlights(view)
"highlightTraceUpdates" -> {
if (args == null) {
return
}
val providedTraceUpdates = args.getArray(0)
val formattedTraceUpdates = mutableListOf<TraceUpdate>()
var successfullyParsedPayload = true
for (i in 0 until providedTraceUpdates.size()) {
val traceUpdate = providedTraceUpdates.getMap(i)
val serializedRectangle = traceUpdate.getMap("rectangle")
if (serializedRectangle == null) {
ReactSoftExceptionLogger.logSoftException(
REACT_CLASS,
ReactNoCrashSoftException(
"Unexpected payload for highlighting trace updates: rectangle field is" +
" null"))
successfullyParsedPayload = false
break
}
val id = traceUpdate.getInt("id")
val color = traceUpdate.getInt("color")
try {
val left = serializedRectangle.getDouble("x").toFloat()
val top = serializedRectangle.getDouble("y").toFloat()
val right = (left + serializedRectangle.getDouble("width")).toFloat()
val bottom = (top + serializedRectangle.getDouble("height")).toFloat()
val rectangle = RectF(left.dpToPx(), top.dpToPx(), right.dpToPx(), bottom.dpToPx())
formattedTraceUpdates.add(TraceUpdate(id, rectangle, color))
} catch (ex: Exception) {
when (ex) {
is NoSuchKeyException,
is UnexpectedNativeTypeException -> {
ReactSoftExceptionLogger.logSoftException(
REACT_CLASS,
ReactNoCrashSoftException(
"Unexpected payload for highlighting trace updates: rectangle field should" +
" have x, y, width, height fields"))
successfullyParsedPayload = false
}
else -> throw ex
}
}
}
if (successfullyParsedPayload) {
view.setTraceUpdates(formattedTraceUpdates)
}
}
"highlightElements" -> {
if (args == null) {
return
}
val providedElements = args.getArray(0)
val elementsRectangles = mutableListOf<RectF>()
var successfullyParsedPayload = true
for (i in 0 until providedElements.size()) {
val element = providedElements.getMap(i)
try {
val left = element.getDouble("x").toFloat()
val top = element.getDouble("y").toFloat()
val right = (left + element.getDouble("width")).toFloat()
val bottom = (top + element.getDouble("height")).toFloat()
val rect = RectF(left.dpToPx(), top.dpToPx(), right.dpToPx(), bottom.dpToPx())
elementsRectangles.add(rect)
} catch (ex: Exception) {
when (ex) {
is NoSuchKeyException,
is UnexpectedNativeTypeException -> {
ReactSoftExceptionLogger.logSoftException(
REACT_CLASS,
ReactNoCrashSoftException(
"Unexpected payload for highlighting elements: every element should have x," +
" y, width, height fields"))
successfullyParsedPayload = false
}
else -> throw ex
}
}
}
if (successfullyParsedPayload) {
view.setHighlightedElementsRectangles(elementsRectangles)
}
}
"clearElementsHighlights" -> {
view.clearElementsHighlights()
}
else -> {
ReactSoftExceptionLogger.logSoftException(
REACT_CLASS,
@@ -43,105 +127,6 @@ public class DebuggingOverlayManager :
}
}
public override fun highlightTraceUpdates(view: DebuggingOverlay, args: ReadableArray?): Unit {
if (args == null) {
return
}
val providedTraceUpdates = args.getArray(0)
val formattedTraceUpdates = mutableListOf<TraceUpdate>()
var successfullyParsedPayload = true
for (i in 0 until providedTraceUpdates.size()) {
val traceUpdate = providedTraceUpdates.getMap(i)
val serializedRectangle = traceUpdate.getMap("rectangle")
if (serializedRectangle == null) {
ReactSoftExceptionLogger.logSoftException(
REACT_CLASS,
ReactNoCrashSoftException(
"Unexpected payload for highlighting trace updates: rectangle field is null"))
successfullyParsedPayload = false
break
}
val id = traceUpdate.getInt("id")
val color = traceUpdate.getInt("color")
try {
val left = serializedRectangle.getDouble("x").toFloat()
val top = serializedRectangle.getDouble("y").toFloat()
val right = (left + serializedRectangle.getDouble("width")).toFloat()
val bottom = (top + serializedRectangle.getDouble("height")).toFloat()
val rectangle = RectF(left.dpToPx(), top.dpToPx(), right.dpToPx(), bottom.dpToPx())
formattedTraceUpdates.add(TraceUpdate(id, rectangle, color))
} catch (ex: Exception) {
when (ex) {
is NoSuchKeyException,
is UnexpectedNativeTypeException -> {
ReactSoftExceptionLogger.logSoftException(
REACT_CLASS,
ReactNoCrashSoftException(
"Unexpected payload for highlighting trace updates: rectangle field should" +
" have x, y, width, height fields"))
successfullyParsedPayload = false
}
else -> throw ex
}
}
}
if (successfullyParsedPayload) {
view.setTraceUpdates(formattedTraceUpdates)
}
}
public override fun highlightElements(view: DebuggingOverlay, args: ReadableArray?): Unit {
if (args == null) {
return
}
val providedElements = args.getArray(0)
val elementsRectangles = mutableListOf<RectF>()
var successfullyParsedPayload = true
for (i in 0 until providedElements.size()) {
val element = providedElements.getMap(i)
try {
val left = element.getDouble("x").toFloat()
val top = element.getDouble("y").toFloat()
val right = (left + element.getDouble("width")).toFloat()
val bottom = (top + element.getDouble("height")).toFloat()
val rect = RectF(left.dpToPx(), top.dpToPx(), right.dpToPx(), bottom.dpToPx())
elementsRectangles.add(rect)
} catch (ex: Exception) {
when (ex) {
is NoSuchKeyException,
is UnexpectedNativeTypeException -> {
ReactSoftExceptionLogger.logSoftException(
REACT_CLASS,
ReactNoCrashSoftException(
"Unexpected payload for highlighting elements: every element should have x," +
" y, width, height fields"))
successfullyParsedPayload = false
}
else -> throw ex
}
}
}
if (successfullyParsedPayload) {
view.setHighlightedElementsRectangles(elementsRectangles)
}
}
public override fun clearElementsHighlights(view: DebuggingOverlay): Unit {
view.clearElementsHighlights()
}
public override fun createViewInstance(context: ThemedReactContext): DebuggingOverlay {
return DebuggingOverlay(context)
}
@@ -19,7 +19,6 @@ public object ImageResizeMode {
private const val RESIZE_MODE_STRETCH = "stretch"
private const val RESIZE_MODE_CENTER = "center"
private const val RESIZE_MODE_REPEAT = "repeat"
private const val RESIZE_MODE_NONE = "none"
/** Converts JS resize modes into `ScalingUtils.ScaleType`. See `ImageResizeMode.js`. */
@JvmStatic
@@ -31,7 +30,6 @@ public object ImageResizeMode {
RESIZE_MODE_CENTER -> return ScalingUtils.ScaleType.CENTER_INSIDE
// Handled via a combination of ScaleType and TileMode
RESIZE_MODE_REPEAT -> return ScaleTypeStartInside.INSTANCE
RESIZE_MODE_NONE -> return ScaleTypeStartInside.INSTANCE
}
if (resizeModeValue != null) {
@@ -47,8 +45,7 @@ public object ImageResizeMode {
if (RESIZE_MODE_CONTAIN == resizeModeValue ||
RESIZE_MODE_COVER == resizeModeValue ||
RESIZE_MODE_STRETCH == resizeModeValue ||
RESIZE_MODE_CENTER == resizeModeValue ||
RESIZE_MODE_NONE == resizeModeValue) {
RESIZE_MODE_CENTER == resizeModeValue) {
return TileMode.CLAMP
}
if (RESIZE_MODE_REPEAT == resizeModeValue) {
@@ -57,14 +57,6 @@ public class ReactModalHostManager :
view.statusBarTranslucent = statusBarTranslucent
}
@ReactProp(name = "navigationBarTranslucent")
public override fun setNavigationBarTranslucent(
view: ReactModalHostView,
navigationBarTranslucent: Boolean
) {
view.navigationBarTranslucent = navigationBarTranslucent
}
@ReactProp(name = "hardwareAccelerated")
public override fun setHardwareAccelerated(
view: ReactModalHostView,
@@ -48,7 +48,6 @@ import com.facebook.react.uimanager.events.EventDispatcher
import com.facebook.react.views.common.ContextUtils
import com.facebook.react.views.view.ReactViewGroup
import com.facebook.react.views.view.setStatusBarTranslucency
import com.facebook.react.views.view.setSystemBarsTranslucency
import java.util.Objects
/**
@@ -80,12 +79,6 @@ public class ReactModalHostView(context: ThemedReactContext) :
createNewDialog = true
}
public var navigationBarTranslucent: Boolean = false
set(value) {
field = value
createNewDialog = true
}
public var animationType: String? = null
set(value) {
field = value
@@ -342,12 +335,7 @@ public class ReactModalHostView(context: ThemedReactContext) :
}
}
// Navigation bar cannot be translucent without status bar being translucent too
dialogWindow.setSystemBarsTranslucency(navigationBarTranslucent)
if (!navigationBarTranslucent) {
dialogWindow.setStatusBarTranslucency(statusBarTranslucent)
}
dialogWindow.setStatusBarTranslucency(statusBarTranslucent)
if (transparent) {
dialogWindow.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
@@ -18,7 +18,7 @@ import com.facebook.react.bridge.JSApplicationIllegalArgumentException
* Controls an enclosing [ProgressBar]. Exists so that the [ProgressBar] can be recreated if the
* style would change.
*/
internal class ProgressBarContainerView(context: Context) : FrameLayout(context) {
public class ProgressBarContainerView(context: Context) : FrameLayout(context) {
internal var color: Int? = null
internal var indeterminate = true
@@ -21,7 +21,7 @@ import com.facebook.yoga.YogaNode
* Node responsible for holding the style of the ProgressBar, see under [ ] for possible styles.
* ReactProgressBarViewManager manages how this style is applied to the ProgressBar.
*/
internal class ProgressBarShadowNode : LayoutShadowNode(), YogaMeasureFunction {
public class ProgressBarShadowNode : LayoutShadowNode(), YogaMeasureFunction {
private val height: SparseIntArray = SparseIntArray()
private val width: SparseIntArray = SparseIntArray()
private val measured: MutableSet<Int> = HashSet()
@@ -31,7 +31,7 @@ internal class ProgressBarShadowNode : LayoutShadowNode(), YogaMeasureFunction {
}
@set:ReactProp(name = ReactProgressBarViewManager.PROP_STYLE)
var style: String? = ReactProgressBarViewManager.DEFAULT_STYLE
public var style: String? = ReactProgressBarViewManager.DEFAULT_STYLE
set(value) {
field = value ?: ReactProgressBarViewManager.DEFAULT_STYLE
}
@@ -34,7 +34,7 @@ import java.util.WeakHashMap
* a new one with the style given.
*/
@ReactModule(name = ReactProgressBarViewManager.REACT_CLASS)
internal class ReactProgressBarViewManager :
public class ReactProgressBarViewManager :
BaseViewManager<ProgressBarContainerView, ProgressBarShadowNode>(),
AndroidProgressBarManagerInterface<ProgressBarContainerView> {
private val measuredStyles = WeakHashMap<Int, Pair<Int, Int>>()
@@ -42,60 +42,60 @@ internal class ReactProgressBarViewManager :
private val delegate: ViewManagerDelegate<ProgressBarContainerView> =
AndroidProgressBarManagerDelegate(this)
override fun getName(): String = REACT_CLASS
public override fun getName(): String = REACT_CLASS
override fun createViewInstance(context: ThemedReactContext): ProgressBarContainerView {
protected override fun createViewInstance(context: ThemedReactContext): ProgressBarContainerView {
return ProgressBarContainerView(context)
}
@ReactProp(name = PROP_STYLE)
override fun setStyleAttr(view: ProgressBarContainerView, styleName: String?) {
public override fun setStyleAttr(view: ProgressBarContainerView, styleName: String?) {
view.setStyle(styleName)
}
@ReactProp(name = ViewProps.COLOR, customType = "Color")
override fun setColor(view: ProgressBarContainerView, color: Int?) {
public override fun setColor(view: ProgressBarContainerView, color: Int?) {
view.color = color
}
@ReactProp(name = PROP_INDETERMINATE)
override fun setIndeterminate(view: ProgressBarContainerView, indeterminate: Boolean) {
public override fun setIndeterminate(view: ProgressBarContainerView, indeterminate: Boolean) {
view.indeterminate = indeterminate
}
@ReactProp(name = PROP_PROGRESS)
override fun setProgress(view: ProgressBarContainerView, progress: Double) {
public override fun setProgress(view: ProgressBarContainerView, progress: Double) {
view.progress = progress
}
@ReactProp(name = PROP_ANIMATING)
override fun setAnimating(view: ProgressBarContainerView, animating: Boolean) {
public override fun setAnimating(view: ProgressBarContainerView, animating: Boolean) {
view.animating = animating
}
override fun setTestID(view: ProgressBarContainerView, value: String?) {
public override fun setTestID(view: ProgressBarContainerView, value: String?) {
super.setTestId(view, value)
}
@ReactProp(name = PROP_ATTR)
override fun setTypeAttr(view: ProgressBarContainerView, value: String?): Unit = Unit
public override fun setTypeAttr(view: ProgressBarContainerView, value: String?): Unit = Unit
override fun createShadowNodeInstance(): ProgressBarShadowNode = ProgressBarShadowNode()
public override fun createShadowNodeInstance(): ProgressBarShadowNode = ProgressBarShadowNode()
override fun getShadowNodeClass(): Class<ProgressBarShadowNode> =
public override fun getShadowNodeClass(): Class<ProgressBarShadowNode> =
ProgressBarShadowNode::class.java
override fun updateExtraData(root: ProgressBarContainerView, extraData: Any) {
public override fun updateExtraData(root: ProgressBarContainerView, extraData: Any) {
// do nothing
}
override fun onAfterUpdateTransaction(view: ProgressBarContainerView) {
protected override fun onAfterUpdateTransaction(view: ProgressBarContainerView) {
view.apply()
}
override fun getDelegate(): ViewManagerDelegate<ProgressBarContainerView> = delegate
protected override fun getDelegate(): ViewManagerDelegate<ProgressBarContainerView> = delegate
override fun measure(
public override fun measure(
context: Context,
localData: ReadableMap,
props: ReadableMap,
@@ -119,15 +119,15 @@ internal class ReactProgressBarViewManager :
toDIPFromPixel(value.first.toFloat()), toDIPFromPixel(value.second.toFloat()))
}
companion object {
const val REACT_CLASS: String = "AndroidProgressBar"
public companion object {
public const val REACT_CLASS: String = "AndroidProgressBar"
const val PROP_STYLE: String = "styleAttr"
const val PROP_ATTR: String = "typeAttr"
const val PROP_INDETERMINATE: String = "indeterminate"
const val PROP_PROGRESS: String = "progress"
const val PROP_ANIMATING: String = "animating"
const val DEFAULT_STYLE: String = "Normal"
internal const val PROP_STYLE: String = "styleAttr"
internal const val PROP_ATTR: String = "typeAttr"
internal const val PROP_INDETERMINATE: String = "indeterminate"
internal const val PROP_PROGRESS: String = "progress"
internal const val PROP_ANIMATING: String = "animating"
internal const val DEFAULT_STYLE: String = "Normal"
private val progressBarCtorLock = Any()
@@ -136,7 +136,7 @@ internal class ReactProgressBarViewManager :
* ProgressBar constructor that may cause crashes when two ProgressBars are constructed at the
* same time on two different threads. This static ctor wrapper protects against that.
*/
fun createProgressBar(context: Context?, style: Int): ProgressBar {
public fun createProgressBar(context: Context?, style: Int): ProgressBar {
synchronized(progressBarCtorLock) {
return ProgressBar(context, null, style)
}
@@ -20,7 +20,7 @@ import com.facebook.react.uimanager.StateWrapper
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.uimanager.UIManagerModule
internal class ReactSafeAreaView(public val reactContext: ThemedReactContext) :
public class ReactSafeAreaView(public val reactContext: ThemedReactContext) :
ViewGroup(reactContext) {
internal var stateWrapper: StateWrapper? = null
@@ -19,7 +19,7 @@ import com.facebook.react.viewmanagers.SafeAreaViewManagerInterface
/** View manager for [ReactSafeAreaView] components. */
@ReactModule(name = ReactSafeAreaViewManager.REACT_CLASS)
internal class ReactSafeAreaViewManager() :
public class ReactSafeAreaViewManager() :
ViewGroupManager<ReactSafeAreaView>(), SafeAreaViewManagerInterface<ReactSafeAreaView> {
private val delegate: ViewManagerDelegate<ReactSafeAreaView> = SafeAreaViewManagerDelegate(this)
@@ -45,7 +45,7 @@ internal class ReactSafeAreaViewManager() :
return null
}
internal companion object {
const val REACT_CLASS: String = "RCTSafeAreaView"
public companion object {
public const val REACT_CLASS: String = "RCTSafeAreaView"
}
}

Some files were not shown because too many files have changed in this diff Show More