diff --git a/en/freakycoder-react-native-bounceable.md b/en/freakycoder-react-native-bounceable.md index f7bb1f8869a1ad54914fad7c35334fc86ab7d621..b7a6938822e394665bf673d2b6b0793648423508 100644 --- a/en/freakycoder-react-native-bounceable.md +++ b/en/freakycoder-react-native-bounceable.md @@ -20,6 +20,12 @@ ## Installation and Usage +| Version | Support RN version | +| ------------------------- | -------------------------- | +| 1.0.3 | 0.72/0.77 | + +For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. + Go to the project directory and execute the following instruction: ### npm diff --git a/en/react-native-image-capinsets-next.md b/en/react-native-image-capinsets-next.md index 3d62294337407dfe3762632e2368730a714d6c49..62bd66b58a4b5b31ef6c7d02553b474568655822 100644 --- a/en/react-native-image-capinsets-next.md +++ b/en/react-native-image-capinsets-next.md @@ -16,7 +16,13 @@ ## Installation and Usage -Find the matching version information in the release address of a third-party library: [@react-native-oh-tpl/react-native-image-capinsets-next Releases](https://github.com/react-native-oh-library/react-native-image-capinsets-next/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. +Find the matching version information in the release address of a third-party library: [@react-native-oh-tpl/react-native-image-capinsets-next Releases](https://github.com/react-native-oh-library/react-native-image-capinsets-next/releases). + +| Version | Publish Info | Support RN version | +| ---------- | ------------------------------------------------------------ | ---------- | +| 0.6.1 |[@react-native-oh-tpl/react-native-image-capinsets-next Releases](https://github.com/react-native-oh-library/react-native-image-capinsets-next/releases)| 0.72 | +| 0.6.2 |[@react-native-ohos/react-native-image-capinsets-next Releases]() | 0.77 | +For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. Go to the project directory and execute the following instruction: @@ -27,13 +33,21 @@ Go to the project directory and execute the following instruction: #### **npm** ```bash +# 0.6.1 npm install @react-native-oh-tpl/react-native-image-capinsets-next + +# 0.6.2 +npm install @react-native-ohos/react-native-image-capinsets-next ``` #### **yarn** ```bash +# 0.6.1 yarn add @react-native-oh-tpl/react-native-image-capinsets-next + +# 0.6.2 +yarn add @react-native-ohos/react-native-image-capinsets-next ``` @@ -123,6 +137,8 @@ export default YourImage; ## Use Codegen +V0.6.2 for RN0.77 does not require execution of Codegen. + If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/en/codegen.md). ## Link @@ -152,12 +168,20 @@ Method 1 (recommended): Use the HAR file. Open `entry/oh-package.json5` file and add the following dependencies: +- V0.6.1 ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", "@react-native-oh-tpl/react-native-image-capinsets-next": "file:../../node_modules/@react-native-oh-tpl/react-native-image-capinsets-next/harmony/rn_image_capinsets.har" } ``` +- V0.6.2 +```json +"dependencies": { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony", + "@react-native-ohos/react-native-image-capinsets-next": "file:../../node_modules/@react-native-ohos/react-native-image-capinsets-next/harmony/rn_image_capinsets.har" + } +``` Click the `sync` button in the upper right corner. @@ -172,13 +196,77 @@ Method 2: Directly link to the source code. > [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md). -### 3. Introducing RNCImageCapInsets Component to ArkTS +### 3.Configure CMakeLists and introduce ImageCapinsetsNextPackage + +> [!TIP] If using version 0.6.1, please skip this chapter. + +Open `entry/src/main/cpp/CMakeLists.txt` and add: + +``` +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") ++ set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") +set(LOG_VERBOSITY_LEVEL 1) +set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments") +set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie") +set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) + +# RNOH_BEGIN: manual_package_linking_1 +add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-image-capinsets-next/src/main/cpp" ./rn-image-capinsets) +# RNOH_END: manual_package_linking_1 + +file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") + +add_library(rnoh_app SHARED + ${GENERATED_CPP_FILES} + "./PackageProvider.cpp" + "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp" +) +target_link_libraries(rnoh_app PUBLIC rnoh) + +# RNOH_BEGIN: manual_package_linking_2 +target_link_libraries(rnoh_app PUBLIC rnoh_sample_package) ++ target_link_libraries(rnoh_app PUBLIC rnoh_rn_image_capinsets) +# RNOH_END: manual_package_linking_2 +``` + +Open `entry/src/main/cpp/PackageProvider.cpp` and add: + +``` +#include "RNOH/PackageProvider.h" +#include "generated/RNOHGeneratedPackage.h" +#include "SamplePackage.h" ++ #include "ImageCapinsetsNextPackage.h" + +using namespace rnoh; + +std::vector> PackageProvider::getPackages(Package::Context ctx) { + return { + std::make_shared(ctx), + std::make_shared(ctx), ++ std::make_shared(ctx), + }; +} +``` + +### 4. Introducing RNCImageCapInsets Component to ArkTS (If the code of the repository is written through CAPI, delete this section.)
Find `function buildCustomRNComponent()`, which is usually located in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets`, and add the following code: ```diff ... + // V0.6.1 + import { IMAGE_CAP_INSETS, RNCImageCapInsets } from "@react-native-oh-tpl/react-native-image-capinsets-next" + // V0.6.2 ++ import { IMAGE_CAP_INSETS, RNCImageCapInsets } from "@react-native-ohos/react-native-image-capinsets-next" @Builder export function buildCustomRNComponent(ctx: ComponentBuilderContext) { @@ -207,13 +295,16 @@ const arkTsComponentNames: Array = [ ]; ``` -### 4. Introducing RNCImageCapInsetsPackage to ArkTS +### 5. Introducing RNCImageCapInsetsPackage to ArkTS Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code: ```diff ... + // V0.6.1 + import { RNCImageCapInsetsPackage } from '@react-native-oh-tpl/react-native-image-capinsets-next/ts'; + // V0.6.2 ++ import { RNCImageCapInsetsPackage } from '@react-native-ohos/react-native-image-capinsets-next/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -223,7 +314,7 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 5. Running +### 6. Running Click the `sync` button in the upper right corner. diff --git a/en/react-native-image-colors.md b/en/react-native-image-colors.md index e39f250276f568f9c6983f5d24cf08abeaacae90..b784268d1db83a6bb7de08b228f998891f1aa2cf 100644 --- a/en/react-native-image-colors.md +++ b/en/react-native-image-colors.md @@ -17,7 +17,14 @@ ## Installation and Usage -Find the matching version information in the release address of a third-party library: [@react-native-oh-tpl/react-native-image-colors Releases](https://github.com/react-native-oh-library/react-native-image-colors/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. +Find the matching version information in the release address of a third-party library: [@react-native-oh-tpl/react-native-image-colors Releases](https://github.com/react-native-oh-library/react-native-image-colors/releases). + +| Version | Publish Info | Support RN version | +| ---------- | ------------------------------------------------------------ | ---------- | +| 2.4.0 | [@react-native-oh-tpl/react-native-image-colors Releases](https://github.com/react-native-oh-library/react-native-image-colors/releases) | 0.72 | +| 2.5.1 | [@react-native-ohos/react-native-image-colors Releases]() | 0.77 | + +For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. Go to the project directory and execute the following instruction: @@ -28,13 +35,21 @@ Go to the project directory and execute the following instruction: #### **npm** ```bash +# V2.4.0 npm install @react-native-oh-tpl/react-native-image-colors + +# V2.5.1 +npm install @react-native-ohos/react-native-image-colors ``` #### **yarn** ```bash +# V2.4.0 yarn add @react-native-oh-tpl/react-native-image-colors + +# V2.5.1 +yarn add @react-native-ohos/react-native-image-colors ``` @@ -199,6 +214,8 @@ const styles = StyleSheet.create({ ## Use Codegen +> [!TIP] V2.5.1 does not require execution of Codegen + If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/en/codegen.md). ## Link @@ -222,12 +239,18 @@ Open the `harmony` directory of the HarmonyOS project in DevEco Studio. Currently, two methods are available: +1. Introduced through the har package (this method will be abandoned after the IDE improves its related functions, and is currently the preferred method); + +2. Directly link the source code. + Method 1 (recommended): Use the HAR file. > [!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library. Open `entry/oh-package.json5` file and add the following dependencies: +- V2.4.0 + ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -235,6 +258,15 @@ Open `entry/oh-package.json5` file and add the following dependencies: } ``` +- V2.5.1 + +```json +"dependencies": { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony", + "@react-native-ohos/react-native-image-colors": "file:../../node_modules/@react-native-ohos/react-native-image-colors/harmony/image_colors.har" + } +``` + Click the `sync` button in the upper right corner. Alternatively, run the following instruction on the terminal: @@ -248,14 +280,79 @@ Method 2: Directly link to the source code. > [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md). -### 3. Introducing RNImageColorsPackage to ArkTS +### 3.Configure CMakeLists and introduce ImageColorsPackage + +> [!TIP] If using version 2.4.0, please skip this chapter + +Open `entry/src/main/cpp/CMakeLists.txt` and add: + +```cmake +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") ++ set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") +set(LOG_VERBOSITY_LEVEL 1) +set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments") +set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie") +set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) + +# RNOH_BEGIN: manual_package_linking_1 +add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-image-colors/src/main/cpp" ./image-colors) +# RNOH_END: manual_package_linking_1 + +file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") + +add_library(rnoh_app SHARED + ${GENERATED_CPP_FILES} + "./PackageProvider.cpp" + "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp" +) +target_link_libraries(rnoh_app PUBLIC rnoh) + +# RNOH_BEGIN: manual_package_linking_2 +target_link_libraries(rnoh_app PUBLIC rnoh_sample_package) ++ target_link_libraries(rnoh_app PUBLIC rnoh_image_colors) +# RNOH_END: manual_package_linking_2 +``` + +Open `entry/src/main/cpp/PackageProvider.cpp` and add: + +```c++ +#include "RNOH/PackageProvider.h" +#include "generated/RNOHGeneratedPackage.h" +#include "SamplePackage.h" ++ #include "ImageColorsPackage.h" + +using namespace rnoh; + +std::vector> PackageProvider::getPackages(Package::Context ctx) { + return { + std::make_shared(ctx), + std::make_shared(ctx), ++ std::make_shared(ctx) + }; +} +``` + +### 4. Introducing RNImageColorsPackage to ArkTS Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code: ```diff ... +// V2.4.0 + import { RNImageColorsPackage } from "@react-native-oh-tpl/react-native-image-colors/ts"; +// V2.5.1 ++ import { RNImageColorsPackage } from "@react-native-ohos/react-native-image-colors/ts"; + export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ new SamplePackage(ctx), @@ -264,7 +361,7 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 4. Running +### 5. Running Click the `sync` button in the upper right corner. @@ -350,7 +447,7 @@ HarmonyImageColors ## Known Issues -- [x] harmonyOS 获取颜色值暂时只能得到固定的一种颜色,暂不支持通过传入`pixelSpacing`或`quality`参数来计算获取不同精确度的颜色值。[issue 链接](https://github.com/react-native-oh-library/react-native-image-colors/issues/16) +- [x] HarmonyOS can only obtain a fixed color value temporarily, and does not support calculating and obtaining color values of different accuracies by passing in the 'PixelScaling' or 'Quality' parameters.[issue link](https://github.com/react-native-oh-library/react-native-image-colors/issues/16) ## Others diff --git a/en/react-native-popup-menu.md b/en/react-native-popup-menu.md index c40b44002d64251811727c237b793aa3f7791269..9ecc1cc8567f32eb559910a1960adcb76a9b1863 100644 --- a/en/react-native-popup-menu.md +++ b/en/react-native-popup-menu.md @@ -18,6 +18,13 @@ ## Installation and Usage +| Version | Support RN version | +| ------------------------- | -------------------------- | +| 0.16.1 | 0.72 | +| 0.18.0 | 0.77 | + +For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. + Go to the project directory and execute the following instruction: @@ -25,13 +32,21 @@ Go to the project directory and execute the following instruction: #### **npm** ```bash +# 0.72 npm install react-native-popup-menu@0.16.1 --save + +# 0.77 +npm install react-native-popup-menu@0.18.0 --save ``` #### **yarn** ```bash +# 0.72 yarn add react-native-popup-menu@0.16.1 + +# 0.77 +yarn add react-native-popup-menu@0.18.0 ``` diff --git a/en/react-native-textinput-maxlength-fixed.md b/en/react-native-textinput-maxlength-fixed.md index a912083e413f675b9f6f430148d5a3c565b02f48..dd3ed56e0102d3c38b0100a63fa5c49bb793b32c 100644 --- a/en/react-native-textinput-maxlength-fixed.md +++ b/en/react-native-textinput-maxlength-fixed.md @@ -15,7 +15,12 @@ ## Installation and Usage -Find the matching version information in the release address of a third-party library:[@react-native-oh-tpl/react-native-textinput-maxlength-fixed Releases](https://github.com/react-native-oh-library/react-native-textinput-maxlength-fixed/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. +Find the matching version information in the release address of a third-party library:[@react-native-oh-tpl/react-native-textinput-maxlength-fixed Releases](https://github.com/react-native-oh-library/react-native-textinput-maxlength-fixed/releases). +| Version | Publish Info | Support RN version | +| ---------- | ------------------------------------------------------------ | ---------- | +| 0.1.2 | [@react-native-oh-tpl/react-native-textinput-maxlength-fixed Releases](https://github.com/react-native-oh-library/react-native-textinput-maxlength-fixed/releases) | 0.72 | +| 0.1.3 | [@react-native-ohos/react-native-textinput-maxlength-fixed Releases]() | 0.77 | +For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. Go to the project directory and execute the following instruction: @@ -24,13 +29,19 @@ Go to the project directory and execute the following instruction: #### **npm** ```bash +# 0.1.2 npm install @react-native-oh-tpl/react-native-textinput-maxlength-fixed +# 0.1.3 +npm install @react-native-ohos/react-native-textinput-maxlength-fixed ``` #### **yarn** ```bash +# 0.1.2 yarn add @react-native-oh-tpl/react-native-textinput-maxlength-fixed +# 0.1.3 +yarn add @react-native-ohos/react-native-textinput-maxlength-fixed ``` @@ -82,6 +93,8 @@ const styles = StyleSheet.create({ ## Use Codegen +> [!TIP] V0.1.3 for RN0.77 does not require execution of Codegen. + If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/en/codegen.md). ## Link @@ -102,7 +115,7 @@ Open the `harmony` directory of the HarmonyOS project in DevEco Studio. ``` ### 2.Introducing Native Code -> [!TIP] 引入原生代码之前请确认IDE版本,5.0.3.810及其之后的版本需要在harmony工程中的hvigor-config.json5文件中新增如下配置以解决路径过长导致的编译报错问题 +> [!TIP] Before introducing native code, please confirm the IDE version. For versions 5.0.3.810 and later, the following configuration needs to be added to the hvigor-config.json5 file in the Harmony project to solve the compilation error caused by excessively long paths > "properties":{ > "ohos.nativeResolver":false > } @@ -118,12 +131,24 @@ Method 1 (recommended): Use the HAR file. Open `entry/oh-package.json5` file and add the following dependencies: +- V0.1.2 + ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", "@react-native-oh-tpl/react-native-textinput-maxlength-fixed": "file:../../node_modules/@react-native-oh-tpl/react-native-textinput-maxlength-fixed/harmony/textinput_maxlength_fixed.har" } ``` + +- V0.1.3 + +```json +"dependencies": { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony", + "@react-native-ohos/react-native-textinput-maxlength-fixed": "file:../../node_modules/@react-native-ohos/react-native-textinput-maxlength-fixed/harmony/textinput_maxlength_fixed.har" + } +``` + Click the `sync` button in the upper right corner. Method 2: Directly link to the source code. @@ -138,7 +163,10 @@ Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following co import { RNPackageContext, RNPackage } from '@rnoh/react-native-openharmony'; import { SampleTurboModulePackage } from '../TurboModule/SampleTurboModulePackage'; import { ViewPagerPackage } from '@react-native-oh-tpl/react-native-pager-view/ts'; +// V0.1.2 +import { RNTextinputMaxlengthFixedPackage } from "@react-native-oh-tpl/react-native-textinput-maxlength-fixed/ts"; +// V0.1.3 ++import { RNTextinputMaxlengthFixedPackage } from "@react-native-ohos/react-native-textinput-maxlength-fixed/ts"; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -148,6 +176,7 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { ]; } ``` + ## Constraints ### Compatibility @@ -164,9 +193,10 @@ Check the release version information in the release address of the third-party | Name | Description | Type | Required | Platform | HarmonyOS Support | | ---- | ----------- | ---- | -------- | -------- | ------------------ | -| multiply | Calculate the product of two numbers. | number | no | All | yes | +| multiply | Calculate the product of two numbers. | number | no | All | yes | ## Known Issues + ## Others ## License diff --git a/en/react-native-video-controls.md b/en/react-native-video-controls.md index e04fdc6ce967588dcdacf6fc3d8c3df84d4b1952..044e3086a3fd47ff3c8a9a8ae63cffee33404c03 100644 --- a/en/react-native-video-controls.md +++ b/en/react-native-video-controls.md @@ -17,6 +17,12 @@ ## Installation and Usage +| Version | Support RN version | +| ------------------------- | -------------------------- | +| 2.8.1 | 0.72/0.77 | + +For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. + > [!TIP] Need matching services and third-party dependencies. react-native-video-controls depends on the follow third-party library: diff --git a/zh-cn/freakycoder-react-native-bounceable.md b/zh-cn/freakycoder-react-native-bounceable.md index b510785bd7f30eb0d47c3571172ffbd81a7c123a..e1e02ac749a5d7902719a799a057bd47f1732a9c 100644 --- a/zh-cn/freakycoder-react-native-bounceable.md +++ b/zh-cn/freakycoder-react-native-bounceable.md @@ -20,6 +20,12 @@ ## 安装与使用 +| 三方库版本 | 支持RN版本 | +| ------------------------- | -------------------------- | +| 1.0.3 | 0.72/0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 + 进入到工程目录并输入以下命令: ### npm diff --git a/zh-cn/react-native-image-capinsets-next.md b/zh-cn/react-native-image-capinsets-next.md index a0223878a489aeb4dd21c1462889e707e9b136d2..45097b23a84a73e22f9c4de81c21ef5795af27bb 100644 --- a/zh-cn/react-native-image-capinsets-next.md +++ b/zh-cn/react-native-image-capinsets-next.md @@ -16,12 +16,13 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息,并下载适用版本的 tgz 包: - +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | -| 0.6.1 | [@react-native-oh-tpl/react-native-image-capinsets-next Releases](https://github.com/react-native-oh-library/react-native-image-capinsets-next/releases) | 0.72 | -| 0.6.2 | [@react-native-ohos/react-native-image-capinsets-next Releases Releases]() | 0.77 | +| 0.6.1 |[@react-native-oh-tpl/react-native-image-capinsets-next Releases](https://github.com/react-native-oh-library/react-native-image-capinsets-next/releases)| 0.72 | +| 0.6.2 |[@react-native-ohos/react-native-image-capinsets-next Releases]() | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -30,20 +31,20 @@ #### **npm** ```bash -# V0.6.1 +# 0.6.1 npm install @react-native-oh-tpl/react-native-image-capinsets-next -# V0.6.2 +# 0.6.2 npm install @react-native-ohos/react-native-image-capinsets-next ``` #### **yarn** ```bash -# V0.6.1 +# 0.6.1 yarn add @react-native-oh-tpl/react-native-image-capinsets-next -# V0.6.2 +# 0.6.2 yarn add @react-native-ohos/react-native-image-capinsets-next ``` @@ -134,6 +135,8 @@ export default YourImage; ## 使用 Codegen +> [!TIP] V0.6.2 for RN0.77 不需要执行 Codegen。 + 本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。 ## Link @@ -167,23 +170,19 @@ export default YourImage; 打开 `entry/oh-package.json5`,添加以下依赖 - V0.6.1 - ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", "@react-native-oh-tpl/react-native-image-capinsets-next": "file:../../node_modules/@react-native-oh-tpl/react-native-image-capinsets-next/harmony/rn_image_capinsets.har" } ``` - - V0.6.2 - ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", "@react-native-ohos/react-native-image-capinsets-next": "file:../../node_modules/@react-native-ohos/react-native-image-capinsets-next/harmony/rn_image_capinsets.har" } ``` - 点击右上角的 `sync` 按钮 或者在终端执行: @@ -197,7 +196,68 @@ ohpm install > [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md) -### 3.在 ArkTs 侧引入 RNCImageCapInsets 组件 +### 3.配置 CMakeLists 和引入 ImageCapinsetsNextPackage + +> [!TIP] 若使用的是 0.6.1 版本,请跳过本章。 + +打开 `entry/src/main/cpp/CMakeLists.txt`,添加: + +``` +project(rnapp) +cmake_minimum_required(VERSION 3.4.1) +set(CMAKE_SKIP_BUILD_RPATH TRUE) +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}") +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules") ++ set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules") +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp") +set(LOG_VERBOSITY_LEVEL 1) +set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments") +set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie") +set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use +add_compile_definitions(WITH_HITRACE_SYSTRACE) + +add_subdirectory("${RNOH_CPP_DIR}" ./rn) + +# RNOH_BEGIN: manual_package_linking_1 +add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-image-capinsets-next/src/main/cpp" ./rn-image-capinsets) +# RNOH_END: manual_package_linking_1 + +file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") + +add_library(rnoh_app SHARED + ${GENERATED_CPP_FILES} + "./PackageProvider.cpp" + "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp" +) +target_link_libraries(rnoh_app PUBLIC rnoh) + +# RNOH_BEGIN: manual_package_linking_2 +target_link_libraries(rnoh_app PUBLIC rnoh_sample_package) ++ target_link_libraries(rnoh_app PUBLIC rnoh_rn_image_capinsets) +# RNOH_END: manual_package_linking_2 +``` + +打开 `entry/src/main/cpp/PackageProvider.cpp`,添加: + +``` +#include "RNOH/PackageProvider.h" +#include "generated/RNOHGeneratedPackage.h" +#include "SamplePackage.h" ++ #include "ImageCapinsetsNextPackage.h" + +using namespace rnoh; + +std::vector> PackageProvider::getPackages(Package::Context ctx) { + return { + std::make_shared(ctx), + std::make_shared(ctx), ++ std::make_shared(ctx), + }; +} +``` + +### 4.在 ArkTs 侧引入 RNCImageCapInsets 组件 找到 `function buildCustomRNComponent()`,一般位于 `entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets`,添加: @@ -205,7 +265,6 @@ ohpm install ... // V0.6.1 + import { IMAGE_CAP_INSETS, RNCImageCapInsets } from "@react-native-oh-tpl/react-native-image-capinsets-next" - // V0.6.2 + import { IMAGE_CAP_INSETS, RNCImageCapInsets } from "@react-native-ohos/react-native-image-capinsets-next" @@ -236,16 +295,15 @@ const arkTsComponentNames: Array = [ ]; ``` -### 4.在 ArkTs 侧引入 xxx Package +### 5.在 ArkTs 侧引入 RNCImageCapInsetsPackage 打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加: ```diff ... - // V0.6.1 + // V0.6.1 + import { RNCImageCapInsetsPackage } from '@react-native-oh-tpl/react-native-image-capinsets-next/ts'; - - // V0.6.2 + // V0.6.2 + import { RNCImageCapInsetsPackage } from '@react-native-ohos/react-native-image-capinsets-next/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -256,7 +314,7 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 5.运行 +### 6.运行 点击右上角的 `sync` 按钮 @@ -275,12 +333,11 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库的 Releases 发布地址查看配套的版本信息,并下载适用版本的 tgz 包: - +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: | 三方库版本 | 发布信息 | 支持RN版本 | | ---------- | ------------------------------------------------------------ | ---------- | -| 0.6.1 | [@react-native-oh-tpl/react-native-image-capinsets-next Releases](https://github.com/react-native-oh-library/react-native-image-capinsets-next/releases) | 0.72 | -| 0.6.2 | [@react-native-ohos/react-native-image-capinsets-next Releases Releases]() | 0.77 | +| 0.6.1 |[@react-native-oh-tpl/react-native-image-capinsets-next Releases](https://github.com/react-native-oh-library/react-native-image-capinsets-next/releases)| 0.72 | +| 0.6.2 |[@react-native-ohos/react-native-image-capinsets-next Releases]() | 0.77 | ## 属性 diff --git a/zh-cn/react-native-image-colors.md b/zh-cn/react-native-image-colors.md index 352244f8459a44ac86adec5143d486f69cbb11b4..0afc7ce5e35fc2b510f3cc5ae6fd1712f54a5f23 100644 --- a/zh-cn/react-native-image-colors.md +++ b/zh-cn/react-native-image-colors.md @@ -214,7 +214,7 @@ const styles = StyleSheet.create({ > [!TIP] V2.5.1 不需要执行Codegen -本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。 +本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[Codegen 使用文档](/zh-cn/codegen.md)。 ## Link diff --git a/zh-cn/react-native-popup-menu.md b/zh-cn/react-native-popup-menu.md index 8ad400202f3e6366ca570caa7746c6497f4a9739..12de91a0a9d7155ab4fcfc14941e376bb365d6c6 100644 --- a/zh-cn/react-native-popup-menu.md +++ b/zh-cn/react-native-popup-menu.md @@ -18,6 +18,13 @@ ## 安装与使用 +| 三方库版本 | 支持RN版本 | +| ------------------------- | -------------------------- | +| 0.16.1 | 0.72 | +| 0.18.0 | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 + 进入到工程目录并输入以下命令: @@ -25,13 +32,21 @@ #### **npm** ```bash +# 0.72 npm install react-native-popup-menu@0.16.1 --save + +# 0.77 +npm install react-native-popup-menu@0.18.0 --save ``` #### **yarn** ```bash +# 0.72 yarn add react-native-popup-menu@0.16.1 + +# 0.77 +yarn add react-native-popup-menu@0.18.0 ``` diff --git a/zh-cn/react-native-textinput-maxlength-fixed.md b/zh-cn/react-native-textinput-maxlength-fixed.md index ab90c971ae6f8c3f2c45979b18642c8145ce4ae8..7a0459407b76824f0cc18845d6b2904736a4ef60 100644 --- a/zh-cn/react-native-textinput-maxlength-fixed.md +++ b/zh-cn/react-native-textinput-maxlength-fixed.md @@ -132,6 +132,7 @@ const styles = StyleSheet.create({ 打开 `entry/oh-package.json5`,添加以下依赖 - V0.1.2 + ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -140,12 +141,14 @@ const styles = StyleSheet.create({ ``` - V0.1.3 + ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", "@react-native-ohos/react-native-textinput-maxlength-fixed": "file:../../node_modules/@react-native-ohos/react-native-textinput-maxlength-fixed/harmony/textinput_maxlength_fixed.har" } ``` + 点击右上角的 `sync` 按钮 方法二:直接链接源码 @@ -173,6 +176,7 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { ]; } ``` + ## 约束与限制 ### 兼容性 diff --git a/zh-cn/react-native-video-controls.md b/zh-cn/react-native-video-controls.md index b04981bbd00a5c8e5dd28215a11fb5aa0afe650e..25844d137aea20200a5f29fcd397b56c98e934ed 100644 --- a/zh-cn/react-native-video-controls.md +++ b/zh-cn/react-native-video-controls.md @@ -17,6 +17,12 @@ ## 安装与使用 +| 三方库版本 | 支持RN版本 | +| ------------------------- | -------------------------- | +| 2.8.1 | 0.72/0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 + > [!TIP] 需要配套的服务和三方依赖 react-native-video-controls依赖于以下三方库