mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
28
Commits
@@ -0,0 +1,44 @@
|
||||
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
|
||||
@@ -48,96 +48,84 @@ module.exports = async (github, context, labelWithContext) => {
|
||||
switch (labelWithContext.label) {
|
||||
case 'Type: Invalid':
|
||||
await addComment(
|
||||
`| :warning: | Issue is Invalid |\n` +
|
||||
`| --- | --- |\n` +
|
||||
`| :information_source: | This issue doesn't match any of the expected types for this repository - closing. |`,
|
||||
`> [!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.`,
|
||||
);
|
||||
await closeIssue();
|
||||
return;
|
||||
case 'Type: Question':
|
||||
await addComment(
|
||||
`| :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(
|
||||
`| :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. |`,
|
||||
`> [!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(
|
||||
`| :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. |`,
|
||||
`> [!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 '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.`,
|
||||
);
|
||||
await closeIssue();
|
||||
return;
|
||||
case 'Type: Expo':
|
||||
await addComment(
|
||||
`| :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. |`,
|
||||
`> [!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.`,
|
||||
);
|
||||
await closeIssue();
|
||||
return;
|
||||
case 'Needs: Issue Template':
|
||||
await addComment(
|
||||
`| :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. |`,
|
||||
`> [!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.`,
|
||||
);
|
||||
await requestAuthorFeedback();
|
||||
return;
|
||||
case 'Needs: Environment Info':
|
||||
await addComment(
|
||||
`| :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. |`,
|
||||
`> [!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.`,
|
||||
);
|
||||
await requestAuthorFeedback();
|
||||
return;
|
||||
case 'Newer Patch Available':
|
||||
await addComment(
|
||||
`| :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. |`,
|
||||
`> [!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.`,
|
||||
);
|
||||
return;
|
||||
case 'Needs: Version Info':
|
||||
await addComment(
|
||||
`| :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 |`,
|
||||
`> [!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.`,
|
||||
);
|
||||
await requestAuthorFeedback();
|
||||
return;
|
||||
case 'Needs: Repro':
|
||||
await addComment(
|
||||
`| :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> |`,
|
||||
`> [!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>`,
|
||||
);
|
||||
await requestAuthorFeedback();
|
||||
return;
|
||||
case 'Type: Unsupported Version':
|
||||
await addComment(
|
||||
`| :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. |`,
|
||||
`> [!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.`,
|
||||
);
|
||||
await requestAuthorFeedback();
|
||||
return;
|
||||
case 'Type: Too Old Version':
|
||||
await addComment(
|
||||
`| :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. |`,
|
||||
`> [!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.`,
|
||||
);
|
||||
await closeIssue();
|
||||
return;
|
||||
|
||||
@@ -9,11 +9,6 @@
|
||||
|
||||
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) => {
|
||||
@@ -25,7 +20,6 @@ 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;
|
||||
@@ -43,10 +37,6 @@ 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
|
||||
@@ -74,25 +64,11 @@ 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,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -101,7 +77,7 @@ function containsPattern(body, pattern) {
|
||||
return body.search(regexp) !== -1;
|
||||
}
|
||||
|
||||
// Prevents the bot from responding when maintainer has changed Needs: Repro the label
|
||||
// Prevents the bot from responding when maintainer has changed the 'Needs: Repro' label
|
||||
async function hasMaintainerChangedLabel(github, issueData, author) {
|
||||
const timeline = await github.rest.issues.listEventsForTimeline(issueData);
|
||||
|
||||
|
||||
@@ -10,11 +10,6 @@
|
||||
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);
|
||||
|
||||
@@ -24,3 +24,5 @@ jobs:
|
||||
else
|
||||
echo 'Nightly Worked, All Good!'
|
||||
fi
|
||||
- name: Test Libraries
|
||||
uses: ./.github/workflows/test-libraries-on-nightlies.yml
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
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
|
||||
@@ -26,7 +26,6 @@
|
||||
#import <React/RCTFabricSurface.h>
|
||||
#import <React/RCTSurfaceHostingProxyRootView.h>
|
||||
#import <React/RCTSurfacePresenter.h>
|
||||
#import <ReactCommon/RCTContextContainerHandling.h>
|
||||
#if USE_HERMES
|
||||
#import <ReactCommon/RCTHermesInstance.h>
|
||||
#else
|
||||
@@ -35,7 +34,6 @@
|
||||
#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>
|
||||
@@ -99,13 +97,8 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
|
||||
|
||||
@end
|
||||
|
||||
@interface RCTRootViewFactory () <RCTContextContainerHandling> {
|
||||
std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
|
||||
facebook::react::ContextContainer::Shared _contextContainer;
|
||||
}
|
||||
@end
|
||||
|
||||
@interface RCTRootViewFactory () <RCTCxxBridgeDelegate> {
|
||||
facebook::react::ContextContainer::Shared _contextContainer;
|
||||
std::shared_ptr<facebook::react::RuntimeScheduler> _runtimeScheduler;
|
||||
}
|
||||
@end
|
||||
@@ -124,8 +117,6 @@ 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;
|
||||
@@ -281,7 +272,6 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
|
||||
[reactHost setBundleURLProvider:^NSURL *() {
|
||||
return [weakSelf bundleURL];
|
||||
}];
|
||||
[reactHost setContextContainerHandler:self];
|
||||
[reactHost start];
|
||||
return reactHost;
|
||||
}
|
||||
@@ -289,18 +279,12 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
|
||||
- (std::shared_ptr<facebook::react::JSRuntimeFactory>)createJSRuntimeFactory
|
||||
{
|
||||
#if USE_HERMES
|
||||
return std::make_shared<facebook::react::RCTHermesInstance>(
|
||||
_reactNativeConfig, nullptr, /* allocInOldGenBeforeTTI */ false);
|
||||
return std::make_shared<facebook::react::RCTHermesInstance>(nullptr, 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) {
|
||||
|
||||
@@ -211,4 +211,11 @@ 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;
|
||||
}
|
||||
|
||||
@@ -200,6 +200,8 @@ 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;
|
||||
|
||||
|
||||
+2
-1
@@ -19,6 +19,7 @@ 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';
|
||||
|
||||
@@ -234,7 +235,7 @@ export type ImageProps = $ReadOnly<{|
|
||||
*
|
||||
* See https://reactnative.dev/docs/image#resizemode
|
||||
*/
|
||||
resizeMode?: ?('cover' | 'contain' | 'stretch' | 'repeat' | 'center'),
|
||||
resizeMode?: ?ImageResizeMode,
|
||||
|
||||
/**
|
||||
* A unique identifier for this element to be used in UI Automation
|
||||
|
||||
@@ -12,7 +12,8 @@ export type ImageResizeMode =
|
||||
| 'contain'
|
||||
| 'stretch'
|
||||
| 'repeat'
|
||||
| 'center';
|
||||
| 'center'
|
||||
| 'none';
|
||||
|
||||
/**
|
||||
* @see ImageResizeMode.js
|
||||
@@ -46,4 +47,10 @@ 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;
|
||||
}
|
||||
|
||||
@@ -33,4 +33,7 @@ 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';
|
||||
| 'stretch'
|
||||
|
||||
// The image will not be resized at all.
|
||||
| 'none';
|
||||
|
||||
+6
-3
@@ -8,15 +8,18 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
type ResizeMode = 'cover' | 'contain' | 'stretch' | 'repeat' | 'center';
|
||||
import type {ImageResizeMode} from './ImageResizeMode';
|
||||
|
||||
const objectFitMap: {[string]: ResizeMode} = {
|
||||
const objectFitMap: {[string]: ImageResizeMode} = {
|
||||
contain: 'contain',
|
||||
cover: 'cover',
|
||||
fill: 'stretch',
|
||||
'scale-down': 'contain',
|
||||
none: 'none',
|
||||
};
|
||||
|
||||
export function convertObjectFitToResizeMode(objectFit: ?string): ?ResizeMode {
|
||||
export function convertObjectFitToResizeMode(
|
||||
objectFit: ?string,
|
||||
): ?ImageResizeMode {
|
||||
return objectFit != null ? objectFitMap[objectFit] : undefined;
|
||||
}
|
||||
|
||||
@@ -477,10 +477,7 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image, CGSize size, CGFloat scal
|
||||
|
||||
// Add missing png extension
|
||||
if (request.URL.fileURL && request.URL.pathExtension.length == 0) {
|
||||
NSURL *pngRequestURL = [request.URL URLByAppendingPathExtension:@"png"];
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:pngRequestURL.path]) {
|
||||
mutableRequest.URL = pngRequestURL;
|
||||
}
|
||||
mutableRequest.URL = [request.URL URLByAppendingPathExtension:@"png"];
|
||||
}
|
||||
if (_redirectDelegate != nil) {
|
||||
mutableRequest.URL = [_redirectDelegate redirectAssetsURL:mutableRequest.URL];
|
||||
|
||||
@@ -85,6 +85,7 @@ CGRect RCTTargetRect(CGSize sourceSize, CGSize destSize, CGFloat destScale, RCTR
|
||||
switch (resizeMode) {
|
||||
case RCTResizeModeStretch:
|
||||
case RCTResizeModeRepeat:
|
||||
case RCTResizeModeNone:
|
||||
|
||||
return (CGRect){CGPointZero, RCTCeilSize(destSize, destScale)};
|
||||
|
||||
@@ -249,6 +250,7 @@ BOOL RCTUpscalingRequired(
|
||||
|
||||
case RCTResizeModeRepeat:
|
||||
case RCTResizeModeCenter:
|
||||
case RCTResizeModeNone:
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ 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)
|
||||
@@ -30,12 +31,14 @@ 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,6 +17,7 @@ RCT_ENUM_CONVERTER(
|
||||
@"stretch" : @(RCTResizeModeStretch),
|
||||
@"center" : @(RCTResizeModeCenter),
|
||||
@"repeat" : @(RCTResizeModeRepeat),
|
||||
@"none" : @(RCTResizeModeNone),
|
||||
}),
|
||||
RCTResizeModeStretch,
|
||||
integerValue)
|
||||
|
||||
@@ -434,6 +434,12 @@ 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 =
|
||||
@@ -562,6 +568,6 @@ export interface ImageStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
|
||||
overlayColor?: ColorValue | undefined;
|
||||
tintColor?: ColorValue | undefined;
|
||||
opacity?: AnimatableNumericValue | undefined;
|
||||
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | undefined;
|
||||
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none' | undefined;
|
||||
cursor?: CursorValue | undefined;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
'use strict';
|
||||
|
||||
import type AnimatedNode from '../Animated/nodes/AnimatedNode';
|
||||
import type {ImageResizeMode} from './../Image/ImageResizeMode';
|
||||
import type {
|
||||
____DangerouslyImpreciseStyle_InternalOverrides,
|
||||
____ImageStyle_InternalOverrides,
|
||||
@@ -941,8 +942,8 @@ export type ____TextStyle_Internal = $ReadOnly<{
|
||||
|
||||
export type ____ImageStyle_InternalCore = $ReadOnly<{
|
||||
...$Exact<____ViewStyle_Internal>,
|
||||
resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat',
|
||||
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down',
|
||||
resizeMode?: ImageResizeMode,
|
||||
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none',
|
||||
tintColor?: ____ColorValue_Internal,
|
||||
overlayColor?: string,
|
||||
}>;
|
||||
@@ -954,8 +955,8 @@ export type ____ImageStyle_Internal = $ReadOnly<{
|
||||
|
||||
export type ____DangerouslyImpreciseStyle_InternalCore = $ReadOnly<{
|
||||
...$Exact<____TextStyle_Internal>,
|
||||
resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat',
|
||||
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down',
|
||||
resizeMode?: ImageResizeMode,
|
||||
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none',
|
||||
tintColor?: ____ColorValue_Internal,
|
||||
overlayColor?: string,
|
||||
}>;
|
||||
|
||||
@@ -4869,7 +4869,7 @@ export type ImageProps = $ReadOnly<{|
|
||||
| \\"strict-origin-when-cross-origin\\"
|
||||
| \\"unsafe-url\\"
|
||||
),
|
||||
resizeMode?: ?(\\"cover\\" | \\"contain\\" | \\"stretch\\" | \\"repeat\\" | \\"center\\"),
|
||||
resizeMode?: ?ImageResizeMode,
|
||||
testID?: ?string,
|
||||
tintColor?: ColorValue,
|
||||
src?: ?string,
|
||||
@@ -4892,7 +4892,8 @@ exports[`public API should not change unintentionally Libraries/Image/ImageResiz
|
||||
| \\"contain\\"
|
||||
| \\"cover\\"
|
||||
| \\"repeat\\"
|
||||
| \\"stretch\\";
|
||||
| \\"stretch\\"
|
||||
| \\"none\\";
|
||||
"
|
||||
`;
|
||||
|
||||
@@ -4989,10 +4990,9 @@ export type { ImageProps } from \\"./ImageProps\\";
|
||||
`;
|
||||
|
||||
exports[`public API should not change unintentionally Libraries/Image/ImageUtils.js 1`] = `
|
||||
"type ResizeMode = \\"cover\\" | \\"contain\\" | \\"stretch\\" | \\"repeat\\" | \\"center\\";
|
||||
declare export function convertObjectFitToResizeMode(
|
||||
"declare export function convertObjectFitToResizeMode(
|
||||
objectFit: ?string
|
||||
): ?ResizeMode;
|
||||
): ?ImageResizeMode;
|
||||
"
|
||||
`;
|
||||
|
||||
@@ -8261,8 +8261,8 @@ export type ____TextStyle_Internal = $ReadOnly<{
|
||||
}>;
|
||||
export type ____ImageStyle_InternalCore = $ReadOnly<{
|
||||
...$Exact<____ViewStyle_Internal>,
|
||||
resizeMode?: \\"contain\\" | \\"cover\\" | \\"stretch\\" | \\"center\\" | \\"repeat\\",
|
||||
objectFit?: \\"cover\\" | \\"contain\\" | \\"fill\\" | \\"scale-down\\",
|
||||
resizeMode?: ImageResizeMode,
|
||||
objectFit?: \\"cover\\" | \\"contain\\" | \\"fill\\" | \\"scale-down\\" | \\"none\\",
|
||||
tintColor?: ____ColorValue_Internal,
|
||||
overlayColor?: string,
|
||||
}>;
|
||||
@@ -8272,8 +8272,8 @@ export type ____ImageStyle_Internal = $ReadOnly<{
|
||||
}>;
|
||||
export type ____DangerouslyImpreciseStyle_InternalCore = $ReadOnly<{
|
||||
...$Exact<____TextStyle_Internal>,
|
||||
resizeMode?: \\"contain\\" | \\"cover\\" | \\"stretch\\" | \\"center\\" | \\"repeat\\",
|
||||
objectFit?: \\"cover\\" | \\"contain\\" | \\"fill\\" | \\"scale-down\\",
|
||||
resizeMode?: ImageResizeMode,
|
||||
objectFit?: \\"cover\\" | \\"contain\\" | \\"fill\\" | \\"scale-down\\" | \\"none\\",
|
||||
tintColor?: ____ColorValue_Internal,
|
||||
overlayColor?: string,
|
||||
}>;
|
||||
|
||||
@@ -207,7 +207,7 @@ class RCTBridgeHostTargetDelegate : public facebook::react::jsinspector_modern::
|
||||
void onReload(const PageReloadRequest &request) override
|
||||
{
|
||||
RCTAssertMainQueue();
|
||||
[bridge_ reload];
|
||||
RCTTriggerReloadCommandListeners(@"Reloading due to PageReloadRequest from DevTools.");
|
||||
}
|
||||
|
||||
void onSetPausedInDebuggerMessage(const OverlaySetPausedInDebuggerMessageRequest &request) override
|
||||
|
||||
@@ -19,6 +19,9 @@ 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,6 +83,7 @@ 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
|
||||
@@ -91,6 +92,7 @@ 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
|
||||
@@ -103,15 +105,24 @@ RCT_EXPORT_METHOD(dismissRedbox) {}
|
||||
|
||||
RCT_EXPORT_METHOD(reportException : (JS::NativeExceptionsManager::ExceptionData &)data)
|
||||
{
|
||||
NSString *message = data.message();
|
||||
double exceptionId = data.id_();
|
||||
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();
|
||||
}
|
||||
|
||||
// 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 *> *stackArray = [NSMutableArray<NSDictionary *> new];
|
||||
NSMutableArray<NSDictionary<NSString *, id> *> *stackArray = [NSMutableArray<NSDictionary<NSString *, id> *> new];
|
||||
for (auto frame : data.stack()) {
|
||||
NSMutableDictionary *frameDict = [NSMutableDictionary new];
|
||||
NSMutableDictionary<NSString *, id> *frameDict = [NSMutableDictionary new];
|
||||
if (frame.column().has_value()) {
|
||||
frameDict[@"column"] = @(frame.column().value());
|
||||
}
|
||||
@@ -126,13 +137,28 @@ RCT_EXPORT_METHOD(reportException : (JS::NativeExceptionsManager::ExceptionData
|
||||
[stackArray addObject:frameDict];
|
||||
}
|
||||
|
||||
NSDictionary *extraData = (NSDictionary *)data.extraData();
|
||||
NSString *extraDataAsJSON = RCTJSONStringify(extraData, NULL);
|
||||
mutableErrorData[@"stack"] = stackArray;
|
||||
mutableErrorData[@"id"] = @(data.id_());
|
||||
mutableErrorData[@"isFatal"] = @(data.isFatal());
|
||||
|
||||
if (data.isFatal()) {
|
||||
[self reportFatal:message stack:stackArray exceptionId:exceptionId extraDataAsJSON:extraDataAsJSON];
|
||||
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"]) {
|
||||
[self reportFatal:message stack:stack exceptionId:exceptionId extraDataAsJSON:extraDataAsJSON];
|
||||
} else {
|
||||
[self reportSoft:message stack:stackArray exceptionId:exceptionId extraDataAsJSON:extraDataAsJSON];
|
||||
[self reportSoft:message stack:stack exceptionId:exceptionId extraDataAsJSON:extraDataAsJSON];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,11 @@
|
||||
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.adjustsImageWhenDisabled = NO;
|
||||
|
||||
resumeButton.configurationUpdateHandler = ^(UIButton *button) {
|
||||
button.imageView.tintAdjustmentMode = UIViewTintAdjustmentModeNormal;
|
||||
};
|
||||
|
||||
resumeButton.enabled = NO;
|
||||
[NSLayoutConstraint activateConstraints:@[
|
||||
[resumeButton.widthAnchor constraintEqualToConstant:48],
|
||||
|
||||
@@ -956,6 +956,7 @@ public class com/facebook/react/bridge/JavaOnlyMap : com/facebook/react/bridge/R
|
||||
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 fun remove (Ljava/lang/String;)V
|
||||
public fun toHashMap ()Ljava/util/HashMap;
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
@@ -3303,17 +3304,6 @@ 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
|
||||
@@ -3673,18 +3663,6 @@ 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
|
||||
@@ -3774,22 +3752,6 @@ 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
|
||||
}
|
||||
@@ -4296,13 +4258,6 @@ 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
|
||||
@@ -4956,13 +4911,6 @@ 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
|
||||
@@ -5016,13 +4964,6 @@ 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 {
|
||||
}
|
||||
|
||||
@@ -5658,11 +5599,6 @@ 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
|
||||
}
|
||||
@@ -6399,24 +6335,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 {
|
||||
public final class com/facebook/react/views/debuggingoverlay/DebuggingOverlayManager : com/facebook/react/uimanager/SimpleViewManager, com/facebook/react/viewmanagers/DebuggingOverlayManagerInterface {
|
||||
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 {
|
||||
}
|
||||
|
||||
@@ -6478,13 +6414,6 @@ 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 {
|
||||
}
|
||||
|
||||
@@ -6646,13 +6575,6 @@ 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 {
|
||||
}
|
||||
|
||||
@@ -6734,13 +6656,6 @@ 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;
|
||||
@@ -6775,13 +6690,6 @@ 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 {
|
||||
}
|
||||
|
||||
@@ -6847,13 +6755,6 @@ public final class com/facebook/react/views/progressbar/ProgressBarShadowNode :
|
||||
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;
|
||||
@@ -6883,52 +6784,10 @@ public final class com/facebook/react/views/progressbar/ReactProgressBarViewMana
|
||||
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
|
||||
@@ -6942,21 +6801,16 @@ public final class com/facebook/react/views/scroll/OnScrollDispatchHelper {
|
||||
public final fun onScrollChanged (II)Z
|
||||
}
|
||||
|
||||
public final class com/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager : com/facebook/react/views/view/ReactViewManager {
|
||||
public final class com/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager : com/facebook/react/views/view/ReactViewManager, com/facebook/react/viewmanagers/AndroidHorizontalScrollContentViewManagerInterface {
|
||||
public static final field Companion Lcom/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager$Companion;
|
||||
public static final field REACT_CLASS Ljava/lang/String;
|
||||
public fun <init> ()V
|
||||
public synthetic fun createViewInstance (ILcom/facebook/react/uimanager/ThemedReactContext;Lcom/facebook/react/uimanager/ReactStylesDiffMap;Lcom/facebook/react/uimanager/StateWrapper;)Landroid/view/View;
|
||||
public synthetic fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Landroid/view/View;
|
||||
public fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Lcom/facebook/react/views/view/ReactViewGroup;
|
||||
public fun getDelegate ()Lcom/facebook/react/uimanager/ViewManagerDelegate;
|
||||
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 synthetic fun setRemoveClippedSubviews (Landroid/view/View;Z)V
|
||||
}
|
||||
|
||||
public final class com/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager$Companion {
|
||||
@@ -7088,13 +6942,6 @@ 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
|
||||
@@ -7336,13 +7183,6 @@ 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
|
||||
@@ -7416,13 +7256,6 @@ public class com/facebook/react/views/swiperefresh/SwipeRefreshLayoutManager : c
|
||||
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
|
||||
@@ -7462,20 +7295,6 @@ 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;
|
||||
@@ -7575,13 +7394,6 @@ 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;
|
||||
@@ -7590,13 +7402,6 @@ 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
|
||||
@@ -7631,13 +7436,6 @@ 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
|
||||
@@ -7721,13 +7519,6 @@ 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
|
||||
}
|
||||
@@ -7740,35 +7531,6 @@ 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
|
||||
@@ -7925,13 +7687,6 @@ public final class com/facebook/react/views/text/TextTransform : java/lang/Enum
|
||||
public static fun values ()[Lcom/facebook/react/views/text/TextTransform;
|
||||
}
|
||||
|
||||
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 {
|
||||
public static final field REACT_CLASS Ljava/lang/String;
|
||||
public fun <init> ()V
|
||||
@@ -7944,13 +7699,6 @@ 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
|
||||
}
|
||||
@@ -8138,20 +7886,6 @@ 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
|
||||
}
|
||||
@@ -8288,13 +8022,6 @@ 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 {
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,10 @@ android.useAndroidX=true
|
||||
react.internal.disableJavaVersionAlignment=true
|
||||
|
||||
# Binary Compatibility Validator properties
|
||||
binaryCompatibilityValidator.ignoredClasses=com.facebook.react.BuildConfig,\
|
||||
com.facebook.react.views.unimplementedview.ReactUnimplementedViewManager$$PropsSetter
|
||||
|
||||
# We ignore:
|
||||
# - BuildConfig classes because they are generated and not part of the public API
|
||||
binaryCompatibilityValidator.ignoredClasses=com.facebook.react.BuildConfig
|
||||
|
||||
binaryCompatibilityValidator.ignoredPackages=com.facebook.debug,\
|
||||
com.facebook.fbreact,\
|
||||
|
||||
+4
@@ -246,6 +246,10 @@ public class JavaOnlyMap implements ReadableMap, WritableMap {
|
||||
return mBackingMap.toString();
|
||||
}
|
||||
|
||||
public void remove(@NonNull String key) {
|
||||
mBackingMap.remove(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ import com.facebook.react.module.annotations.ReactModule
|
||||
|
||||
/** [NativeModule] that allows JS to show dev loading view. */
|
||||
@ReactModule(name = NativeDevLoadingViewSpec.NAME)
|
||||
public class DevLoadingModule(reactContext: ReactApplicationContext) :
|
||||
internal class DevLoadingModule(reactContext: ReactApplicationContext) :
|
||||
NativeDevLoadingViewSpec(reactContext) {
|
||||
|
||||
private val jsExceptionHandler: JSExceptionHandler? = reactContext.jsExceptionHandler
|
||||
|
||||
+6
-6
@@ -20,10 +20,10 @@ import com.facebook.react.module.annotations.ReactModule
|
||||
|
||||
@SuppressLint("MissingPermission")
|
||||
@ReactModule(name = NativeVibrationSpec.NAME)
|
||||
public class VibrationModule(reactContext: ReactApplicationContext) :
|
||||
internal class VibrationModule(reactContext: ReactApplicationContext) :
|
||||
NativeVibrationSpec(reactContext) {
|
||||
|
||||
public override fun vibrate(durationDouble: Double) {
|
||||
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 @@ public class VibrationModule(reactContext: ReactApplicationContext) :
|
||||
}
|
||||
}
|
||||
|
||||
public override fun vibrateByPattern(pattern: ReadableArray, repeatDouble: Double) {
|
||||
override fun vibrateByPattern(pattern: ReadableArray, repeatDouble: Double) {
|
||||
val repeat = repeatDouble.toInt()
|
||||
val v = getVibrator() ?: return
|
||||
val patternLong = LongArray(pattern.size())
|
||||
@@ -47,7 +47,7 @@ public class VibrationModule(reactContext: ReactApplicationContext) :
|
||||
}
|
||||
}
|
||||
|
||||
public override fun cancel() {
|
||||
override fun cancel() {
|
||||
getVibrator()?.cancel()
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class VibrationModule(reactContext: ReactApplicationContext) :
|
||||
getReactApplicationContext().getSystemService(Context.VIBRATOR_SERVICE) as Vibrator?
|
||||
}
|
||||
|
||||
public companion object {
|
||||
public const val NAME: String = NativeVibrationSpec.NAME
|
||||
companion object {
|
||||
const val NAME: String = NativeVibrationSpec.NAME
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -19,6 +19,7 @@ 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;
|
||||
@@ -268,6 +269,7 @@ public class ReactPropertyProcessor extends ProcessorBase {
|
||||
TypeSpec holderClass =
|
||||
TypeSpec.classBuilder(holderClassName)
|
||||
.addSuperinterface(superType)
|
||||
.addAnnotation(UnstableReactNativeAPI.class)
|
||||
.addModifiers(PUBLIC)
|
||||
.addMethod(generateSetPropertySpec(classInfo, properties))
|
||||
.addMethod(getMethods)
|
||||
|
||||
+11
-11
@@ -9,7 +9,7 @@ package com.facebook.react.reactperflogger
|
||||
|
||||
import com.facebook.jni.HybridData
|
||||
|
||||
public abstract class NativeModulePerfLogger protected constructor() {
|
||||
internal abstract class NativeModulePerfLogger protected constructor() {
|
||||
|
||||
@Suppress("NoHungarianNotation") private val mHybridData: HybridData
|
||||
|
||||
@@ -20,25 +20,25 @@ public abstract class NativeModulePerfLogger protected constructor() {
|
||||
|
||||
protected abstract fun initHybrid(): HybridData
|
||||
|
||||
public abstract fun moduleDataCreateStart(moduleName: String, id: Int)
|
||||
abstract fun moduleDataCreateStart(moduleName: String, id: Int)
|
||||
|
||||
public abstract fun moduleDataCreateEnd(moduleName: String, id: Int)
|
||||
abstract fun moduleDataCreateEnd(moduleName: String, id: Int)
|
||||
|
||||
public abstract fun moduleCreateStart(moduleName: String, id: Int)
|
||||
abstract fun moduleCreateStart(moduleName: String, id: Int)
|
||||
|
||||
public abstract fun moduleCreateCacheHit(moduleName: String, id: Int)
|
||||
abstract fun moduleCreateCacheHit(moduleName: String, id: Int)
|
||||
|
||||
public abstract fun moduleCreateConstructStart(moduleName: String, id: Int)
|
||||
abstract fun moduleCreateConstructStart(moduleName: String, id: Int)
|
||||
|
||||
public abstract fun moduleCreateConstructEnd(moduleName: String, id: Int)
|
||||
abstract fun moduleCreateConstructEnd(moduleName: String, id: Int)
|
||||
|
||||
public abstract fun moduleCreateSetUpStart(moduleName: String, id: Int)
|
||||
abstract fun moduleCreateSetUpStart(moduleName: String, id: Int)
|
||||
|
||||
public abstract fun moduleCreateSetUpEnd(moduleName: String, id: Int)
|
||||
abstract fun moduleCreateSetUpEnd(moduleName: String, id: Int)
|
||||
|
||||
public abstract fun moduleCreateEnd(moduleName: String, id: Int)
|
||||
abstract fun moduleCreateEnd(moduleName: String, id: Int)
|
||||
|
||||
public abstract fun moduleCreateFail(moduleName: String, id: Int)
|
||||
abstract fun moduleCreateFail(moduleName: String, id: Int)
|
||||
|
||||
/** Subclasses will override this method to load their own SO libraries. */
|
||||
@Synchronized
|
||||
|
||||
+9
-8
@@ -21,14 +21,15 @@ 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
|
||||
@DeprecatedInNewArchitecture
|
||||
@Deprecated(
|
||||
message =
|
||||
"This class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.")
|
||||
public class BridgelessCatalystInstance(private val reactHost: ReactHostImpl) : CatalystInstance {
|
||||
|
||||
override fun handleMemoryPressure(level: Int) {
|
||||
@@ -147,23 +148,23 @@ public class BridgelessCatalystInstance(private val reactHost: ReactHostImpl) :
|
||||
throw UnsupportedOperationException("Unimplemented method 'setGlobalVariable'")
|
||||
}
|
||||
|
||||
@DeprecatedInNewArchitecture(
|
||||
@Deprecated(
|
||||
message =
|
||||
"This method will be deprecated later as part of Stable APIs with bridge removal and not encouraged usage.")
|
||||
"This class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.")
|
||||
override fun setTurboModuleRegistry(turboModuleRegistry: TurboModuleRegistry) {
|
||||
throw UnsupportedOperationException("Unimplemented method 'setTurboModuleRegistry'")
|
||||
}
|
||||
|
||||
@DeprecatedInNewArchitecture(
|
||||
@Deprecated(
|
||||
message =
|
||||
"This method will be deprecated later as part of Stable APIs with bridge removal and not encouraged usage.")
|
||||
"This class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.")
|
||||
override fun setFabricUIManager(fabricUIManager: UIManager) {
|
||||
throw UnsupportedOperationException("Unimplemented method 'setFabricUIManager'")
|
||||
}
|
||||
|
||||
@DeprecatedInNewArchitecture(
|
||||
@Deprecated(
|
||||
message =
|
||||
"This method will be deprecated later as part of Stable APIs with bridge removal and not encouraged usage.")
|
||||
"This class is deprecated, please to migrate to new architecture using [com.facebook.react.defaults.DefaultReactHost] instead.")
|
||||
override fun getFabricUIManager(): UIManager {
|
||||
throw UnsupportedOperationException("Unimplemented method 'getFabricUIManager'")
|
||||
}
|
||||
|
||||
+2
@@ -774,6 +774,8 @@ 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);
|
||||
|
||||
+2
@@ -687,6 +687,8 @@ 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);
|
||||
|
||||
+2
@@ -609,6 +609,8 @@ 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;
|
||||
|
||||
+7
-11
@@ -5,26 +5,22 @@
|
||||
* 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.uimanager.UIManagerModule;
|
||||
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* <p>NB: while onViewHierarchyUpdateFinished will always be called from the UI thread, there are no
|
||||
* NB: while [onViewHierarchyUpdateFinished] will always be called from the UI thread, there are no
|
||||
* guarantees what thread onViewHierarchyUpdateEnqueued is called on.
|
||||
*/
|
||||
@DeprecatedInNewArchitecture
|
||||
public interface NotThreadSafeViewHierarchyUpdateDebugListener {
|
||||
|
||||
/**
|
||||
* Called when {@link UIManagerModule} enqueues a UI batch to be dispatched to the main thread.
|
||||
*/
|
||||
void onViewHierarchyUpdateEnqueued();
|
||||
internal interface NotThreadSafeViewHierarchyUpdateDebugListener {
|
||||
/** Called when `UIManagerModule` enqueues a UI batch to be dispatched to the main thread. */
|
||||
fun onViewHierarchyUpdateEnqueued()
|
||||
|
||||
/** Called from the main thread after a UI batch has been applied to all root views. */
|
||||
void onViewHierarchyUpdateFinished();
|
||||
fun onViewHierarchyUpdateFinished()
|
||||
}
|
||||
+113
-98
@@ -17,108 +17,24 @@ 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>() {
|
||||
public class DebuggingOverlayManager :
|
||||
SimpleViewManager<DebuggingOverlay>(), DebuggingOverlayManagerInterface<DebuggingOverlay> {
|
||||
|
||||
private val delegate: ViewManagerDelegate<DebuggingOverlay> =
|
||||
DebuggingOverlayManagerDelegate(this)
|
||||
|
||||
public override fun getDelegate(): ViewManagerDelegate<DebuggingOverlay> = delegate
|
||||
|
||||
override fun receiveCommand(view: DebuggingOverlay, commandId: String, args: ReadableArray?) {
|
||||
when (commandId) {
|
||||
"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()
|
||||
}
|
||||
"highlightTraceUpdates" -> highlightTraceUpdates(view, args)
|
||||
"highlightElements" -> highlightElements(view, args)
|
||||
"clearElementsHighlights" -> clearElementsHighlights(view)
|
||||
else -> {
|
||||
ReactSoftExceptionLogger.logSoftException(
|
||||
REACT_CLASS,
|
||||
@@ -127,6 +43,105 @@ public class DebuggingOverlayManager : SimpleViewManager<DebuggingOverlay>() {
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
+4
-1
@@ -19,6 +19,7 @@ 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
|
||||
@@ -30,6 +31,7 @@ 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) {
|
||||
@@ -45,7 +47,8 @@ public object ImageResizeMode {
|
||||
if (RESIZE_MODE_CONTAIN == resizeModeValue ||
|
||||
RESIZE_MODE_COVER == resizeModeValue ||
|
||||
RESIZE_MODE_STRETCH == resizeModeValue ||
|
||||
RESIZE_MODE_CENTER == resizeModeValue) {
|
||||
RESIZE_MODE_CENTER == resizeModeValue ||
|
||||
RESIZE_MODE_NONE == resizeModeValue) {
|
||||
return TileMode.CLAMP
|
||||
}
|
||||
if (RESIZE_MODE_REPEAT == resizeModeValue) {
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import com.facebook.react.uimanager.StateWrapper
|
||||
import com.facebook.react.uimanager.ThemedReactContext
|
||||
import com.facebook.react.uimanager.UIManagerModule
|
||||
|
||||
public class ReactSafeAreaView(public val reactContext: ThemedReactContext) :
|
||||
internal class ReactSafeAreaView(public val reactContext: ThemedReactContext) :
|
||||
ViewGroup(reactContext) {
|
||||
internal var stateWrapper: StateWrapper? = null
|
||||
|
||||
|
||||
+3
-3
@@ -19,7 +19,7 @@ import com.facebook.react.viewmanagers.SafeAreaViewManagerInterface
|
||||
|
||||
/** View manager for [ReactSafeAreaView] components. */
|
||||
@ReactModule(name = ReactSafeAreaViewManager.REACT_CLASS)
|
||||
public class ReactSafeAreaViewManager() :
|
||||
internal class ReactSafeAreaViewManager() :
|
||||
ViewGroupManager<ReactSafeAreaView>(), SafeAreaViewManagerInterface<ReactSafeAreaView> {
|
||||
|
||||
private val delegate: ViewManagerDelegate<ReactSafeAreaView> = SafeAreaViewManagerDelegate(this)
|
||||
@@ -45,7 +45,7 @@ public class ReactSafeAreaViewManager() :
|
||||
return null
|
||||
}
|
||||
|
||||
public companion object {
|
||||
public const val REACT_CLASS: String = "RCTSafeAreaView"
|
||||
internal companion object {
|
||||
const val REACT_CLASS: String = "RCTSafeAreaView"
|
||||
}
|
||||
}
|
||||
|
||||
+10
-1
@@ -11,16 +11,25 @@ import com.facebook.react.module.annotations.ReactModule
|
||||
import com.facebook.react.uimanager.ReactStylesDiffMap
|
||||
import com.facebook.react.uimanager.StateWrapper
|
||||
import com.facebook.react.uimanager.ThemedReactContext
|
||||
import com.facebook.react.uimanager.ViewManagerDelegate
|
||||
import com.facebook.react.uimanager.common.UIManagerType
|
||||
import com.facebook.react.uimanager.common.ViewUtil
|
||||
import com.facebook.react.viewmanagers.AndroidHorizontalScrollContentViewManagerDelegate
|
||||
import com.facebook.react.viewmanagers.AndroidHorizontalScrollContentViewManagerInterface
|
||||
import com.facebook.react.views.view.ReactViewGroup
|
||||
import com.facebook.react.views.view.ReactViewManager
|
||||
|
||||
/** View manager for {@link ReactHorizontalScrollContainerView} components. */
|
||||
@ReactModule(name = ReactHorizontalScrollContainerViewManager.REACT_CLASS)
|
||||
public class ReactHorizontalScrollContainerViewManager : ReactViewManager() {
|
||||
public class ReactHorizontalScrollContainerViewManager :
|
||||
ReactViewManager(), AndroidHorizontalScrollContentViewManagerInterface<ReactViewGroup> {
|
||||
override public fun getName(): String = REACT_CLASS
|
||||
|
||||
private val delegate: ViewManagerDelegate<ReactViewGroup> =
|
||||
AndroidHorizontalScrollContentViewManagerDelegate(this)
|
||||
|
||||
public override fun getDelegate(): ViewManagerDelegate<ReactViewGroup> = delegate
|
||||
|
||||
protected override fun createViewInstance(
|
||||
reactTag: Int,
|
||||
context: ThemedReactContext,
|
||||
|
||||
+3
-8
@@ -5,15 +5,10 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.views.text;
|
||||
package com.facebook.react.views.text
|
||||
|
||||
/** A virtual text node. */
|
||||
public class ReactVirtualTextShadowNode extends ReactBaseTextShadowNode {
|
||||
internal class ReactVirtualTextShadowNode : ReactBaseTextShadowNode() {
|
||||
|
||||
@Override
|
||||
public boolean isVirtual() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public ReactVirtualTextShadowNode() {}
|
||||
override fun isVirtual(): Boolean = true
|
||||
}
|
||||
-47
@@ -1,47 +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.views.text;
|
||||
|
||||
import android.view.View;
|
||||
import com.facebook.react.common.annotations.VisibleForTesting;
|
||||
import com.facebook.react.module.annotations.ReactModule;
|
||||
import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.ThemedReactContext;
|
||||
|
||||
/**
|
||||
* Manages raw text nodes. Since they are used only as a virtual nodes any type of native view
|
||||
* operation will throw an {@link IllegalStateException}
|
||||
*/
|
||||
@ReactModule(name = ReactVirtualTextViewManager.REACT_CLASS)
|
||||
public class ReactVirtualTextViewManager extends BaseViewManager<View, ReactVirtualTextShadowNode> {
|
||||
|
||||
@VisibleForTesting public static final String REACT_CLASS = "RCTVirtualText";
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return REACT_CLASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View createViewInstance(ThemedReactContext context) {
|
||||
throw new IllegalStateException("Attempt to create a native view for RCTVirtualText");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateExtraData(View view, Object extraData) {}
|
||||
|
||||
@Override
|
||||
public Class<ReactVirtualTextShadowNode> getShadowNodeClass() {
|
||||
return ReactVirtualTextShadowNode.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReactVirtualTextShadowNode createShadowNodeInstance() {
|
||||
return new ReactVirtualTextShadowNode();
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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.views.text
|
||||
|
||||
import android.view.View
|
||||
import com.facebook.react.module.annotations.ReactModule
|
||||
import com.facebook.react.uimanager.BaseViewManager
|
||||
import com.facebook.react.uimanager.ThemedReactContext
|
||||
|
||||
/**
|
||||
* Manages raw text nodes. Since they are used only as a virtual nodes any type of native view
|
||||
* operation will throw an [IllegalStateException]
|
||||
*/
|
||||
@ReactModule(name = ReactVirtualTextViewManager.REACT_CLASS)
|
||||
internal class ReactVirtualTextViewManager : BaseViewManager<View, ReactVirtualTextShadowNode>() {
|
||||
|
||||
public override fun getName(): String = REACT_CLASS
|
||||
|
||||
protected override fun createViewInstance(context: ThemedReactContext): View {
|
||||
throw IllegalStateException("Attempt to create a native view for RCTVirtualText")
|
||||
}
|
||||
|
||||
public override fun updateExtraData(view: View, extraData: Any): Unit {}
|
||||
|
||||
public override fun getShadowNodeClass(): Class<ReactVirtualTextShadowNode> =
|
||||
ReactVirtualTextShadowNode::class.java
|
||||
|
||||
override fun createShadowNodeInstance(): ReactVirtualTextShadowNode = ReactVirtualTextShadowNode()
|
||||
|
||||
internal companion object {
|
||||
public const val REACT_CLASS: String = "RCTVirtualText"
|
||||
}
|
||||
}
|
||||
+2
@@ -11,6 +11,7 @@ import android.view.View;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.facebook.drawee.backends.pipeline.Fresco;
|
||||
import com.facebook.drawee.controller.AbstractDraweeControllerBuilder;
|
||||
import com.facebook.infer.annotation.Nullsafe;
|
||||
import com.facebook.react.module.annotations.ReactModule;
|
||||
import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.ThemedReactContext;
|
||||
@@ -19,6 +20,7 @@ import com.facebook.react.uimanager.ThemedReactContext;
|
||||
* Manages Images embedded in Text nodes using Fresco. Since they are used only as a virtual nodes
|
||||
* any type of native view operation will throw an {@link IllegalStateException}.
|
||||
*/
|
||||
@Nullsafe(Nullsafe.Mode.LOCAL)
|
||||
@ReactModule(name = FrescoBasedReactTextInlineImageViewManager.REACT_CLASS)
|
||||
public class FrescoBasedReactTextInlineImageViewManager
|
||||
extends BaseViewManager<View, FrescoBasedReactTextInlineImageShadowNode> {
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@ import android.view.Gravity
|
||||
import android.widget.LinearLayout
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
|
||||
public class ReactUnimplementedView(context: Context) : LinearLayout(context) {
|
||||
internal class ReactUnimplementedView(context: Context) : LinearLayout(context) {
|
||||
|
||||
private val textView: AppCompatTextView
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ReactUnimplementedView(context: Context) : LinearLayout(context) {
|
||||
addView(textView)
|
||||
}
|
||||
|
||||
public fun setName(name: String) {
|
||||
internal fun setName(name: String) {
|
||||
textView.setText("'$name' is not Fabric compatible yet.")
|
||||
}
|
||||
}
|
||||
|
||||
+13
-3
@@ -10,11 +10,21 @@ package com.facebook.react.views.unimplementedview
|
||||
import com.facebook.react.module.annotations.ReactModule
|
||||
import com.facebook.react.uimanager.ThemedReactContext
|
||||
import com.facebook.react.uimanager.ViewGroupManager
|
||||
import com.facebook.react.uimanager.ViewManagerDelegate
|
||||
import com.facebook.react.uimanager.annotations.ReactProp
|
||||
import com.facebook.react.viewmanagers.UnimplementedNativeViewManagerDelegate
|
||||
import com.facebook.react.viewmanagers.UnimplementedNativeViewManagerInterface
|
||||
|
||||
/** ViewManager for [ReactUnimplementedView] to represent a component that is not yet supported. */
|
||||
@ReactModule(name = ReactUnimplementedViewManager.REACT_CLASS)
|
||||
internal class ReactUnimplementedViewManager : ViewGroupManager<ReactUnimplementedView>() {
|
||||
internal class ReactUnimplementedViewManager :
|
||||
ViewGroupManager<ReactUnimplementedView>(),
|
||||
UnimplementedNativeViewManagerInterface<ReactUnimplementedView> {
|
||||
|
||||
private val delegate: ViewManagerDelegate<ReactUnimplementedView> =
|
||||
UnimplementedNativeViewManagerDelegate(this)
|
||||
|
||||
public override fun getDelegate(): ViewManagerDelegate<ReactUnimplementedView> = delegate
|
||||
|
||||
protected override fun createViewInstance(
|
||||
reactContext: ThemedReactContext
|
||||
@@ -23,8 +33,8 @@ internal class ReactUnimplementedViewManager : ViewGroupManager<ReactUnimplement
|
||||
public override fun getName(): String = REACT_CLASS
|
||||
|
||||
@ReactProp(name = "name")
|
||||
public fun setName(view: ReactUnimplementedView, name: String) {
|
||||
view.setName(name)
|
||||
public override fun setName(view: ReactUnimplementedView, name: String?): Unit {
|
||||
view.setName(name ?: "<null component name>")
|
||||
}
|
||||
|
||||
internal companion object {
|
||||
|
||||
+7
-1
@@ -143,7 +143,13 @@ public class ReactViewGroup extends ViewGroup
|
||||
private float mBackfaceOpacity;
|
||||
private String mBackfaceVisibility;
|
||||
|
||||
public ReactViewGroup(Context context) {
|
||||
/**
|
||||
* Creates a new `ReactViewGroup` instance.
|
||||
*
|
||||
* @param context A {@link Context} instance. It's Nullable to not break compatibility with OSS
|
||||
* users (could be made non-null in the future but requires proper comms).
|
||||
*/
|
||||
public ReactViewGroup(@Nullable Context context) {
|
||||
super(context);
|
||||
initView();
|
||||
}
|
||||
|
||||
-1
@@ -473,7 +473,6 @@ void FabricUIManagerBinding::installFabricUIManager(
|
||||
globalJavaUiManager);
|
||||
};
|
||||
|
||||
contextContainer->insert("ReactNativeConfig", config);
|
||||
contextContainer->insert("FabricUIManager", globalJavaUiManager);
|
||||
|
||||
// Keep reference to config object and cache some feature flags here
|
||||
|
||||
+1
@@ -71,6 +71,7 @@ class BridgelessReactContextTest {
|
||||
assertThat(bridgelessReactContext.getFabricUIManager()).isEqualTo(fabricUiManager)
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
@Test
|
||||
fun getCatalystInstanceTest() {
|
||||
assertThat(bridgelessReactContext.getCatalystInstance())
|
||||
|
||||
+2
@@ -28,6 +28,8 @@ class ImageResizeModeTest {
|
||||
.isEqualTo(ScalingUtils.ScaleType.FIT_XY)
|
||||
Assertions.assertThat(ImageResizeMode.toScaleType("center"))
|
||||
.isEqualTo(ScalingUtils.ScaleType.CENTER_INSIDE)
|
||||
Assertions.assertThat(ImageResizeMode.toScaleType("none"))
|
||||
.isEqualTo(ScaleTypeStartInside.INSTANCE)
|
||||
|
||||
// No resizeMode set
|
||||
Assertions.assertThat(ImageResizeMode.defaultValue())
|
||||
|
||||
@@ -78,6 +78,43 @@ class SetFalseOnDestruct {
|
||||
}
|
||||
};
|
||||
|
||||
void logErrorWhileReporting(
|
||||
std::string message,
|
||||
jsi::JSError& error,
|
||||
jsi::JSError& originalError) {
|
||||
LOG(ERROR) << "JsErrorHandler::" << message << std::endl
|
||||
<< "Js error message: " << error.getMessage() << std::endl
|
||||
<< "Original js error message: " << originalError.getMessage()
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
jsi::Value getBundleMetadata(jsi::Runtime& runtime, jsi::JSError& error) {
|
||||
auto jsGetBundleMetadataValue =
|
||||
runtime.global().getProperty(runtime, "__getBundleMetadata");
|
||||
|
||||
if (!jsGetBundleMetadataValue.isObject() ||
|
||||
!jsGetBundleMetadataValue.asObject(runtime).isFunction(runtime)) {
|
||||
return jsi::Value::null();
|
||||
}
|
||||
|
||||
auto jsGetBundleMetadataValueFn =
|
||||
jsGetBundleMetadataValue.asObject(runtime).asFunction(runtime);
|
||||
|
||||
try {
|
||||
auto bundleMetadataValue = jsGetBundleMetadataValueFn.call(runtime);
|
||||
if (bundleMetadataValue.isObject()) {
|
||||
return bundleMetadataValue;
|
||||
}
|
||||
return bundleMetadataValue;
|
||||
} catch (jsi::JSError& ex) {
|
||||
logErrorWhileReporting(
|
||||
"getBundleMetadata(): Error raised while calling __getBundleMetadata(). Returning null.",
|
||||
ex,
|
||||
error);
|
||||
}
|
||||
|
||||
return jsi::Value::null();
|
||||
}
|
||||
} // namespace
|
||||
|
||||
namespace facebook::react {
|
||||
@@ -199,12 +236,11 @@ void JsErrorHandler::handleError(
|
||||
try {
|
||||
handleJSError(runtime, error, isFatal);
|
||||
return;
|
||||
} catch (jsi::JSError& e) {
|
||||
LOG(ERROR)
|
||||
<< "JsErrorHandler: Failed to report js error using js pipeline. Using C++ pipeline instead."
|
||||
<< std::endl
|
||||
<< "Reporting failure: " << e.getMessage() << std::endl
|
||||
<< "Original js error: " << error.getMessage() << std::endl;
|
||||
} catch (jsi::JSError& ex) {
|
||||
logErrorWhileReporting(
|
||||
"handleError(): Error raised while reporting using js pipeline. Using c++ pipeline instead.",
|
||||
ex,
|
||||
error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,8 +285,14 @@ void JsErrorHandler::handleErrorWithCppPipeline(
|
||||
objectAssign(runtime, extraData, extraDataValue.asObject(runtime));
|
||||
}
|
||||
|
||||
auto isDEV =
|
||||
isTruthy(runtime, runtime.global().getProperty(runtime, "__DEV__"));
|
||||
|
||||
extraData.setProperty(runtime, "jsEngine", jsEngineValue);
|
||||
extraData.setProperty(runtime, "rawStack", error.getStack());
|
||||
extraData.setProperty(runtime, "__DEV__", isDEV);
|
||||
extraData.setProperty(
|
||||
runtime, "bundleMetadata", getBundleMetadata(runtime, error));
|
||||
|
||||
auto cause = errorObj.getProperty(runtime, "cause");
|
||||
if (cause.isObject()) {
|
||||
@@ -324,7 +366,14 @@ void JsErrorHandler::handleErrorWithCppPipeline(
|
||||
data.setProperty(runtime, "preventDefault", preventDefault);
|
||||
|
||||
for (auto& errorListener : _errorListeners) {
|
||||
errorListener(runtime, jsi::Value(runtime, data));
|
||||
try {
|
||||
errorListener(runtime, jsi::Value(runtime, data));
|
||||
} catch (jsi::JSError& ex) {
|
||||
logErrorWhileReporting(
|
||||
"handleErrorWithCppPipeline(): Error raised inside an error listener. Executing next listener.",
|
||||
ex,
|
||||
error);
|
||||
}
|
||||
}
|
||||
|
||||
if (*shouldPreventDefault) {
|
||||
|
||||
@@ -258,7 +258,7 @@ std::u16string Runtime::utf16(const String& str) {
|
||||
return convertUTF8ToUTF16(utf8Str);
|
||||
}
|
||||
|
||||
Pointer& Pointer::operator=(Pointer&& other) {
|
||||
Pointer& Pointer::operator=(Pointer&& other) noexcept {
|
||||
if (ptr_) {
|
||||
ptr_->invalidate();
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ class JSI_EXPORT Runtime {
|
||||
// Base class for pointer-storing types.
|
||||
class JSI_EXPORT Pointer {
|
||||
protected:
|
||||
explicit Pointer(Pointer&& other) : ptr_(other.ptr_) {
|
||||
explicit Pointer(Pointer&& other) noexcept : ptr_(other.ptr_) {
|
||||
other.ptr_ = nullptr;
|
||||
}
|
||||
|
||||
@@ -428,7 +428,7 @@ class JSI_EXPORT Pointer {
|
||||
}
|
||||
}
|
||||
|
||||
Pointer& operator=(Pointer&& other);
|
||||
Pointer& operator=(Pointer&& other) noexcept;
|
||||
|
||||
friend class Runtime;
|
||||
friend class Value;
|
||||
|
||||
@@ -148,6 +148,8 @@ inline void fromRawValue(
|
||||
result = ImageResizeMode::Center;
|
||||
} else if (stringValue == "repeat") {
|
||||
result = ImageResizeMode::Repeat;
|
||||
} else if (stringValue == "none") {
|
||||
result = ImageResizeMode::None;
|
||||
} else {
|
||||
LOG(ERROR) << "Unsupported ImageResizeMode value: " << stringValue;
|
||||
react_native_expect(false);
|
||||
@@ -168,6 +170,8 @@ inline std::string toString(const ImageResizeMode& value) {
|
||||
return "center";
|
||||
case ImageResizeMode::Repeat:
|
||||
return "repeat";
|
||||
case ImageResizeMode::None:
|
||||
return "none";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
@@ -26,6 +26,8 @@ inline static UIViewContentMode RCTContentModeFromImageResizeMode(facebook::reac
|
||||
// Repeat resize mode is handled by the UIImage. Use scale to fill
|
||||
// so the repeated image fills the UIImageView.
|
||||
return UIViewContentModeScaleToFill;
|
||||
case facebook::react::ImageResizeMode::None:
|
||||
return UIViewContentModeTopLeft;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +44,8 @@ inline std::string toString(const facebook::react::ImageResizeMode &value)
|
||||
return "center";
|
||||
case facebook::react::ImageResizeMode::Repeat:
|
||||
return "repeat";
|
||||
case facebook::react::ImageResizeMode::None:
|
||||
return "none";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ enum class ImageResizeMode {
|
||||
Stretch,
|
||||
Center,
|
||||
Repeat,
|
||||
None,
|
||||
};
|
||||
|
||||
class ImageErrorInfo {
|
||||
|
||||
+2
@@ -15,4 +15,6 @@
|
||||
- (void)setBundleURLProvider:(RCTHostBundleURLProvider)bundleURLProvider;
|
||||
- (void)setContextContainerHandler:(id<RCTContextContainerHandling>)contextContainerHandler;
|
||||
|
||||
@property (nonatomic, readonly) RCTBundleManager *bundleManager;
|
||||
|
||||
@end
|
||||
|
||||
@@ -273,6 +273,11 @@ class RCTHostHostTargetDelegate : public facebook::react::jsinspector_modern::Ho
|
||||
return [_instance surfacePresenter];
|
||||
}
|
||||
|
||||
- (RCTBundleManager *)bundleManager
|
||||
{
|
||||
return _bundleManager;
|
||||
}
|
||||
|
||||
- (void)callFunctionOnJSModule:(NSString *)moduleName method:(NSString *)method args:(NSArray *)args
|
||||
{
|
||||
[_instance callFunctionOnJSModule:moduleName method:method args:args];
|
||||
|
||||
@@ -540,7 +540,7 @@ static float computeFlexBasisForChildren(
|
||||
const uint32_t generationCount) {
|
||||
float totalOuterFlexBasis = 0.0f;
|
||||
YGNodeRef singleFlexChild = nullptr;
|
||||
const auto& children = node->getLayoutChildren();
|
||||
auto children = node->getLayoutChildren();
|
||||
SizingMode sizingModeMainDim =
|
||||
isRow(mainAxis) ? widthSizingMode : heightSizingMode;
|
||||
// If there is only one child with flexGrow + flexShrink it means we can set
|
||||
|
||||
@@ -29,8 +29,7 @@ FlexLine calculateFlexLine(
|
||||
float totalFlexGrowFactors = 0.0f;
|
||||
float totalFlexShrinkScaledFactors = 0.0f;
|
||||
size_t numberOfAutoMargins = 0;
|
||||
size_t endOfLineIndex = iterator.index();
|
||||
size_t firstElementInLineIndex = iterator.index();
|
||||
yoga::Node* firstElementInLine = nullptr;
|
||||
|
||||
float sizeConsumedIncludingMinConstraint = 0;
|
||||
const Direction direction = node->resolveDirection(ownerDirection);
|
||||
@@ -40,19 +39,19 @@ FlexLine calculateFlexLine(
|
||||
const float gap =
|
||||
node->style().computeGapForAxis(mainAxis, availableInnerMainDim);
|
||||
|
||||
const auto childrenEnd = node->getLayoutChildren().end();
|
||||
// Add items to the current line until it's full or we run out of items.
|
||||
for (; iterator != node->getLayoutChildren().end();
|
||||
iterator++, endOfLineIndex = iterator.index()) {
|
||||
for (; iterator != childrenEnd; iterator++) {
|
||||
auto child = *iterator;
|
||||
if (child->style().display() == Display::None ||
|
||||
child->style().positionType() == PositionType::Absolute) {
|
||||
if (firstElementInLineIndex == endOfLineIndex) {
|
||||
// We haven't found the first contributing element in the line yet.
|
||||
firstElementInLineIndex++;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (firstElementInLine == nullptr) {
|
||||
firstElementInLine = child;
|
||||
}
|
||||
|
||||
if (child->style().flexStartMarginIsAuto(mainAxis, ownerDirection)) {
|
||||
numberOfAutoMargins++;
|
||||
}
|
||||
@@ -60,13 +59,11 @@ FlexLine calculateFlexLine(
|
||||
numberOfAutoMargins++;
|
||||
}
|
||||
|
||||
const bool isFirstElementInLine =
|
||||
(endOfLineIndex - firstElementInLineIndex) == 0;
|
||||
|
||||
child->setLineIndex(lineCount);
|
||||
const float childMarginMainAxis =
|
||||
child->style().computeMarginForAxis(mainAxis, availableInnerWidth);
|
||||
const float childLeadingGapMainAxis = isFirstElementInLine ? 0.0f : gap;
|
||||
const float childLeadingGapMainAxis =
|
||||
child == firstElementInLine ? 0.0f : gap;
|
||||
const float flexBasisWithMinAndMaxConstraints =
|
||||
boundAxisWithinMinAndMax(
|
||||
child,
|
||||
@@ -117,7 +114,6 @@ FlexLine calculateFlexLine(
|
||||
return FlexLine{
|
||||
.itemsInFlow = std::move(itemsInFlow),
|
||||
.sizeConsumed = sizeConsumed,
|
||||
.endOfLineIndex = endOfLineIndex,
|
||||
.numberOfAutoMargins = numberOfAutoMargins,
|
||||
.layout = FlexLineRunningLayout{
|
||||
totalFlexGrowFactors,
|
||||
|
||||
@@ -49,9 +49,6 @@ struct FlexLine {
|
||||
// the flexible children.
|
||||
const float sizeConsumed{0.0f};
|
||||
|
||||
// The index of the first item beyond the current line.
|
||||
const size_t endOfLineIndex{0};
|
||||
|
||||
// Number of edges along the line flow with an auto margin.
|
||||
const size_t numberOfAutoMargins{0};
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ void roundLayoutResultsToPixelGrid(
|
||||
Dimension::Height);
|
||||
}
|
||||
|
||||
for (yoga::Node* child : node->getLayoutChildren()) {
|
||||
for (yoga::Node* child : node->getChildren()) {
|
||||
roundLayoutResultsToPixelGrid(child, absoluteNodeLeft, absoluteNodeTop);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,10 +4,12 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
#include <forward_list>
|
||||
#include <utility>
|
||||
|
||||
#include <yoga/enums/Display.h>
|
||||
|
||||
@@ -18,7 +20,6 @@ class Node;
|
||||
template <typename T>
|
||||
class LayoutableChildren {
|
||||
public:
|
||||
using Backtrack = std::vector<std::pair<const T*, size_t>>;
|
||||
struct Iterator {
|
||||
using iterator_category = std::input_iterator_tag;
|
||||
using difference_type = std::ptrdiff_t;
|
||||
@@ -30,10 +31,6 @@ class LayoutableChildren {
|
||||
|
||||
Iterator(const T* node, size_t childIndex)
|
||||
: node_(node), childIndex_(childIndex) {}
|
||||
Iterator(const T* node, size_t childIndex, Backtrack&& backtrack)
|
||||
: node_(node),
|
||||
childIndex_(childIndex),
|
||||
backtrack_(std::move(backtrack)) {}
|
||||
|
||||
T* operator*() const {
|
||||
return node_->getChild(childIndex_);
|
||||
@@ -41,7 +38,6 @@ class LayoutableChildren {
|
||||
|
||||
Iterator& operator++() {
|
||||
next();
|
||||
currentNodeIndex_++;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -51,10 +47,6 @@ class LayoutableChildren {
|
||||
return tmp;
|
||||
}
|
||||
|
||||
size_t index() const {
|
||||
return currentNodeIndex_;
|
||||
}
|
||||
|
||||
friend bool operator==(const Iterator& a, const Iterator& b) {
|
||||
return a.node_ == b.node_ && a.childIndex_ == b.childIndex_;
|
||||
}
|
||||
@@ -68,16 +60,16 @@ class LayoutableChildren {
|
||||
if (childIndex_ + 1 >= node_->getChildCount()) {
|
||||
// if the current node has no more children, try to backtrack and
|
||||
// visit its successor
|
||||
if (backtrack_.empty()) {
|
||||
if (backtrack_.empty()) [[likely]] {
|
||||
// if there are no nodes to backtrack to, the last node has been
|
||||
// visited
|
||||
*this = Iterator{};
|
||||
} else {
|
||||
// pop and restore the latest backtrack entry
|
||||
const auto back = backtrack_.back();
|
||||
backtrack_.pop_back();
|
||||
const auto& back = backtrack_.front();
|
||||
node_ = back.first;
|
||||
childIndex_ = back.second;
|
||||
backtrack_.pop_front();
|
||||
|
||||
// go to the next node
|
||||
next();
|
||||
@@ -87,7 +79,10 @@ class LayoutableChildren {
|
||||
++childIndex_;
|
||||
// skip all display: contents nodes, possibly going deeper into the
|
||||
// tree
|
||||
skipContentsNodes();
|
||||
if (node_->getChild(childIndex_)->style().display() ==
|
||||
Display::Contents) [[unlikely]] {
|
||||
skipContentsNodes();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +94,7 @@ class LayoutableChildren {
|
||||
// if it has display: contents set, it shouldn't be returned but its
|
||||
// children should in its place push the current node and child index
|
||||
// so that the current state can be restored when backtracking
|
||||
backtrack_.push_back({node_, childIndex_});
|
||||
backtrack_.push_front({node_, childIndex_});
|
||||
// traverse the child
|
||||
node_ = currentNode;
|
||||
childIndex_ = 0;
|
||||
@@ -117,8 +112,7 @@ class LayoutableChildren {
|
||||
|
||||
const T* node_{nullptr};
|
||||
size_t childIndex_{0};
|
||||
size_t currentNodeIndex_{0};
|
||||
Backtrack backtrack_;
|
||||
std::forward_list<std::pair<const T*, size_t>> backtrack_;
|
||||
|
||||
friend LayoutableChildren;
|
||||
};
|
||||
@@ -133,7 +127,10 @@ class LayoutableChildren {
|
||||
Iterator begin() const {
|
||||
if (node_->getChildCount() > 0) {
|
||||
auto result = Iterator(node_, 0);
|
||||
result.skipContentsNodes();
|
||||
if (node_->getChild(0)->style().display() == Display::Contents)
|
||||
[[unlikely]] {
|
||||
result.skipContentsNodes();
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
return Iterator{};
|
||||
|
||||
-59
@@ -1,59 +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.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
/**
|
||||
* These are types for things that are present for New Architecture enabled apps
|
||||
* which is currently considered experimental.
|
||||
*
|
||||
* To load the types declared here in an actual project, there are three ways.
|
||||
*
|
||||
* 1. If your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
|
||||
* is to add `"react-native/types/experimental"` to the `"types"` array.
|
||||
*
|
||||
* 2. Alternatively, a specific import syntax can to be used from a typescript file.
|
||||
* This module does not exist in reality, which is why the {} is important:
|
||||
*
|
||||
* ```ts
|
||||
* import {} from 'react-native/types/experimental'
|
||||
* ```
|
||||
*
|
||||
* 3. It is also possible to include it through a triple-slash reference:
|
||||
*
|
||||
* ```ts
|
||||
* /// <reference types="react-native/types/experimental" />
|
||||
* ```
|
||||
*
|
||||
* Either the import or the reference only needs to appear once, anywhere in the project.
|
||||
*/
|
||||
|
||||
import {
|
||||
GradientValue,
|
||||
BlendMode,
|
||||
} from 'react-native/Libraries/StyleSheet/StyleSheetTypes';
|
||||
|
||||
export {};
|
||||
|
||||
declare module '.' {
|
||||
export interface ViewProps {
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
export interface ViewStyle {
|
||||
mixBlendMode?: BlendMode | undefined;
|
||||
experimental_backgroundImage?:
|
||||
| ReadonlyArray<GradientValue>
|
||||
| string
|
||||
| undefined;
|
||||
}
|
||||
}
|
||||
@@ -825,6 +825,9 @@ const styles = StyleSheet.create({
|
||||
objectFitScaleDown: {
|
||||
objectFit: 'scale-down',
|
||||
},
|
||||
objectFitNone: {
|
||||
objectFit: 'none',
|
||||
},
|
||||
imageInBundle: {
|
||||
borderColor: 'yellow',
|
||||
borderWidth: 4,
|
||||
@@ -1466,6 +1469,17 @@ exports.examples = [
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
<View style={styles.horizontal}>
|
||||
<View>
|
||||
<RNTesterText style={styles.resizeModeText}>
|
||||
None
|
||||
</RNTesterText>
|
||||
<Image
|
||||
style={[styles.resizeMode, styles.objectFitNone]}
|
||||
source={image}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
})}
|
||||
@@ -1537,6 +1551,18 @@ exports.examples = [
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
<View style={styles.horizontal}>
|
||||
<View>
|
||||
<RNTesterText style={styles.resizeModeText}>
|
||||
None
|
||||
</RNTesterText>
|
||||
<Image
|
||||
style={styles.resizeMode}
|
||||
resizeMode="none"
|
||||
source={image}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -10,125 +10,69 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import type {
|
||||
GestureState,
|
||||
PanResponderInstance,
|
||||
} from 'react-native/Libraries/Interaction/PanResponder';
|
||||
import type {PressEvent} from 'react-native/Libraries/Types/CoreEventTypes';
|
||||
|
||||
const RNTesterPage = require('../../components/RNTesterPage');
|
||||
const React = require('react');
|
||||
const {PanResponder, StyleSheet, View} = require('react-native');
|
||||
import * as React from 'react';
|
||||
import {useMemo, useRef, useState} from 'react';
|
||||
import {PanResponder, StyleSheet, View} from 'react-native';
|
||||
|
||||
const CIRCLE_SIZE = 80;
|
||||
|
||||
type Props = $ReadOnly<{||}>;
|
||||
type State = {|
|
||||
left: number,
|
||||
top: number,
|
||||
pressed: boolean,
|
||||
|};
|
||||
|
||||
class PanResponderExample extends React.Component<Props, State> {
|
||||
_previousLeft: number = 20;
|
||||
_previousTop: number = 84;
|
||||
circle: ?React.ElementRef<typeof View> = null;
|
||||
|
||||
state: State = {
|
||||
left: 20,
|
||||
top: 84,
|
||||
pressed: false,
|
||||
};
|
||||
|
||||
_handleStartShouldSetPanResponder = (
|
||||
event: PressEvent,
|
||||
gestureState: GestureState,
|
||||
): boolean => {
|
||||
// Should we become active when the user presses down on the circle?
|
||||
return true;
|
||||
};
|
||||
|
||||
_handleMoveShouldSetPanResponder = (
|
||||
event: PressEvent,
|
||||
gestureState: GestureState,
|
||||
): boolean => {
|
||||
// Should we become active when the user moves a touch over the circle?
|
||||
return true;
|
||||
};
|
||||
|
||||
_handlePanResponderGrant = (
|
||||
event: PressEvent,
|
||||
gestureState: GestureState,
|
||||
) => {
|
||||
this.setState({
|
||||
pressed: true,
|
||||
});
|
||||
};
|
||||
|
||||
_handlePanResponderMove = (event: PressEvent, gestureState: GestureState) => {
|
||||
this.setState({
|
||||
left: this._previousLeft + gestureState.dx,
|
||||
top: this._previousTop + gestureState.dy,
|
||||
});
|
||||
};
|
||||
|
||||
_handlePanResponderEnd = (event: PressEvent, gestureState: GestureState) => {
|
||||
this.setState({
|
||||
pressed: false,
|
||||
});
|
||||
this._previousLeft += gestureState.dx;
|
||||
this._previousTop += gestureState.dy;
|
||||
};
|
||||
|
||||
_panResponder: PanResponderInstance = PanResponder.create({
|
||||
onStartShouldSetPanResponder: this._handleStartShouldSetPanResponder,
|
||||
onMoveShouldSetPanResponder: this._handleMoveShouldSetPanResponder,
|
||||
onPanResponderGrant: this._handlePanResponderGrant,
|
||||
onPanResponderMove: this._handlePanResponderMove,
|
||||
onPanResponderRelease: this._handlePanResponderEnd,
|
||||
onPanResponderTerminate: this._handlePanResponderEnd,
|
||||
});
|
||||
|
||||
render(): React.Node {
|
||||
return (
|
||||
<RNTesterPage noScroll={true} title="Basic gesture handling">
|
||||
<View style={styles.container}>
|
||||
<View
|
||||
ref={circle => {
|
||||
this.circle = circle;
|
||||
}}
|
||||
style={[
|
||||
styles.circle,
|
||||
{
|
||||
transform: [
|
||||
{translateX: this.state.left},
|
||||
{translateY: this.state.top},
|
||||
],
|
||||
backgroundColor: this.state.pressed ? 'blue' : 'green',
|
||||
},
|
||||
]}
|
||||
{...this._panResponder.panHandlers}
|
||||
/>
|
||||
</View>
|
||||
</RNTesterPage>
|
||||
);
|
||||
}
|
||||
function PanResponderExample() {
|
||||
const [position, setPosition] = useState({left: 20, top: 84});
|
||||
const [pressed, setPressed] = useState(false);
|
||||
const circleRef = useRef<?React.ElementRef<typeof View>>(null);
|
||||
const panResponder = useMemo(
|
||||
() =>
|
||||
PanResponder.create({
|
||||
onStartShouldSetPanResponder: () => true,
|
||||
onMoveShouldSetPanResponder: () => true,
|
||||
onPanResponderGrant: () => {
|
||||
setPressed(true);
|
||||
},
|
||||
onPanResponderMove: (evt, gestureState) => {
|
||||
setPosition({
|
||||
left: position.left + gestureState.dx,
|
||||
top: position.top + gestureState.dy,
|
||||
});
|
||||
},
|
||||
onPanResponderRelease: () => {
|
||||
setPressed(false);
|
||||
},
|
||||
}),
|
||||
[position],
|
||||
);
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<View
|
||||
ref={circleRef}
|
||||
style={[
|
||||
styles.circle,
|
||||
{
|
||||
transform: [
|
||||
{translateX: position.left},
|
||||
{translateY: position.top},
|
||||
],
|
||||
backgroundColor: pressed ? 'blue' : 'green',
|
||||
},
|
||||
]}
|
||||
{...panResponder.panHandlers}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
height: 500,
|
||||
},
|
||||
circle: {
|
||||
width: CIRCLE_SIZE,
|
||||
height: CIRCLE_SIZE,
|
||||
backgroundColor: 'green',
|
||||
borderRadius: CIRCLE_SIZE / 2,
|
||||
position: 'absolute',
|
||||
left: 0,
|
||||
top: 0,
|
||||
},
|
||||
container: {
|
||||
flex: 1,
|
||||
height: 500,
|
||||
},
|
||||
});
|
||||
|
||||
exports.title = 'PanResponder Sample';
|
||||
@@ -139,6 +83,7 @@ exports.description =
|
||||
exports.examples = [
|
||||
{
|
||||
title: 'Basic gesture handling',
|
||||
description: 'Press and drag circle around',
|
||||
render(): React.MixedElement {
|
||||
return <PanResponderExample />;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user