diff --git a/_sidebar.md b/_sidebar.md
index c9e42e32c71f908eea7c83f2debe0d2411b23fca..552bf43ba20a50b04f5be6446aef42a71892554a 100644
--- a/_sidebar.md
+++ b/_sidebar.md
@@ -3,6 +3,7 @@
- [首页](/zh-cn/README.md)
- [贡献文档](/zh-cn/contribute.md)
- [文档模板](/zh-cn/model.md)
+- [链接源码](/zh-cn/link-source-code.md)
- 三方库说明文档合集
- RN原生库
- [@react-native-async-storage/async-storage](/zh-cn/react-native-async-storage-async-storage.md)
diff --git a/zh-cn/link-source-code.md b/zh-cn/link-source-code.md
new file mode 100644
index 0000000000000000000000000000000000000000..f4f7f34ba9cb4ca4c2fa70c1923d61a3e4bb701a
--- /dev/null
+++ b/zh-cn/link-source-code.md
@@ -0,0 +1,44 @@
+### 引入原生端代码
+
+#### 直接链接源码情况说明
+
+目前 DevEco Studio 不支持通过源码引入外部 module,我们推荐使用 har 包的方式引入,如需要直接链接源码,请按照以下步骤操作,将源码通过操作改成 harmony 工程的内部模块。
+
+> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
+
+把`/node_modules/@react-native-oh-tpl//harmony/`目录下的源码``复制到`harmony`工程根目录下
+
+在`harmony`工程根目录的 `build-profile.template.json5`(若存在)和`build-profile.json5` 添加以下模块
+
+```json
+modules:[
+ ...
+ {
+ name: '',
+ srcPath: './',
+ }
+ //提示:{
+ // name: 'safe_area',
+ // srcPath: './safe_area',
+ // }
+]
+```
+
+打开 `entry/oh-package.json5`,添加以下依赖
+
+```json
+"dependencies": {
+ "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
+ "@react-native-oh-tpl/": "file:../"
+ // 提示: "@react-native-oh-tpl/react-native-safe-area-context": "file:../safe_area"
+ }
+```
+
+点击右上角的 `sync` 按钮
+
+或者在终端执行:
+
+```bash
+cd entry
+ohpm install
+```
diff --git a/zh-cn/lottie-react-native.md b/zh-cn/lottie-react-native.md
index b3b85b9dfe7e2b5e071fcab76625e685a29e4d7c..c36b2fbd3b492e837f889344399cd041f4337fbd 100644
--- a/zh-cn/lottie-react-native.md
+++ b/zh-cn/lottie-react-native.md
@@ -86,24 +86,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-lottie": "file:../../node_modules/@react-native-oh-tpl/lottie-react-native/harmony/lottie"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 LottieAnimationViewPackage
diff --git a/zh-cn/model.md b/zh-cn/model.md
index 95a60250870652ace884dbed71ff390c8d789449..f8f24ee91bc54c9e94e3b5ffbd69fc1a4e26a9ce 100644
--- a/zh-cn/model.md
+++ b/zh-cn/model.md
@@ -127,44 +127,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-把`tester/node_modules/@react-native-oh-tpl//harmony/`目录下的源码``复制到`harmony`工程根目录下
-
-在`harmony`工程根目录的 `build-profile.template.json5`(若存在)和`build-profile.json5` 添加以下模块
-
-```json
-modules:[
- ...
- {
- name: '',
- srcPath: './',
- }
- //提示:{
- // name: 'safe_area',
- // srcPath: './safe_area',
- // } (删除)
-]
-```
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
- "@react-native-oh-tpl/": "file:../"
- // 提示: "@react-native-oh-tpl/react-native-safe-area-context": "file:../safe_area"(删除)
- }
-```
-
-点击右上角的 `sync` 按钮
-
-或者在终端执行:
-
-```bash
-cd entry
-ohpm install
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 xxxPackge
diff --git a/zh-cn/react-native-MJRefresh.md b/zh-cn/react-native-MJRefresh.md
index 6c31e339092bb55550fb672a2c71f1db139c0338..09351a7c167b0d5486ec464af2f7a42c82e243ea 100644
--- a/zh-cn/react-native-MJRefresh.md
+++ b/zh-cn/react-native-MJRefresh.md
@@ -134,24 +134,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-mjrefresh": "file:../../node_modules/@react-native-oh-tpl/react-native-mjrefresh/harmony/mjrefresh"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 MJRefreshPackge
@@ -201,7 +184,7 @@ std::vector> PackageProvider::getPackages(Package::Cont
}
```
-### 在 ArkTs 侧引入 MJRefresh组件
+### 在 ArkTs 侧引入 MJRefresh 组件
找到 **function buildCustomComponent()**,一般位于 `entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets`,添加:
diff --git a/zh-cn/react-native-SmartRefreshLayout.md b/zh-cn/react-native-SmartRefreshLayout.md
index 4e63e1f486cd1648282b65239b94c50c06895e92..f54712ec07152cda4a88ead3e3298b99402980f0 100644
--- a/zh-cn/react-native-SmartRefreshLayout.md
+++ b/zh-cn/react-native-SmartRefreshLayout.md
@@ -214,24 +214,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-smart-refresh-layout": "file:../../node_modules/@react-native-oh-tpl/react-native-smartrefreshlayout/harmony/smart_refresh_layout"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 SmartRefreshLayoutPackage
diff --git a/zh-cn/react-native-async-storage-async-storage.md b/zh-cn/react-native-async-storage-async-storage.md
index ddab4f8c70d9d8a97fbf95639c156bfa59cd514f..f5599bbd6135bdae0190bfe929b09fa2eec44e99 100644
--- a/zh-cn/react-native-async-storage-async-storage.md
+++ b/zh-cn/react-native-async-storage-async-storage.md
@@ -105,24 +105,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-async-storage": "file:../../node_modules/@react-native-oh-tpl/async-storage/harmony/async-storage"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 AsynStoragePackge
diff --git a/zh-cn/react-native-blob-util.md b/zh-cn/react-native-blob-util.md
index 5949959463624c46598320b675770b1af1fc3237..ec8e6cc3e03f44ce432a9f70fea520dca09158ad 100644
--- a/zh-cn/react-native-blob-util.md
+++ b/zh-cn/react-native-blob-util.md
@@ -13,7 +13,6 @@
-
> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-blob-util)
## 安装与使用
@@ -22,7 +21,7 @@
进入到工程目录并输入以下命令:
->[!TIP] # 处替换为 tgz 包的路径
+> [!TIP] # 处替换为 tgz 包的路径
@@ -42,303 +41,372 @@ yarn add @react-native-oh-tpl/react-native-blob-util@file:#
下面的代码展示了这个库的基本使用场景:
->[!WARNING] 使用时 import 的库名不变。
+> [!WARNING] 使用时 import 的库名不变。
```js
-import React, { useState } from 'react';
-import { ScrollView, StyleSheet, Button, View, Text,NativeEventEmitter} from 'react-native';
-import ReactNativeBlobUtil from 'react-native-blob-util';
+import React, { useState } from "react";
+import {
+ ScrollView,
+ StyleSheet,
+ Button,
+ View,
+ Text,
+ NativeEventEmitter,
+} from "react-native";
+import ReactNativeBlobUtil from "react-native-blob-util";
export default function BlobUtilDemo() {
- const [result, setResult] = useState(null);
- const [mkdirParam, setMkdirParam] = useState('');
-
- const createFile = async () => {
- await ReactNativeBlobUtil.fs.createFile(result + "/text.txt", '123456', 'utf8');
- }
-
- const ls = async () => {
- await ReactNativeBlobUtil.fs.ls(ReactNativeBlobUtil.fs.dirs.CacheDir);
- }
-
- const createFileASCII = async () => {
- await ReactNativeBlobUtil.fs.createFile(result + "/text.txt", [102, 111, 111], "ascii");
- }
-
- const unlink = () => {
- ReactNativeBlobUtil.fs.unlink(result + '/text.txt')
- }
-
- const getConstants = () => {
- let obj = ReactNativeBlobUtil.fs.dirs.CacheDir;
- setResult(obj)
- }
-
- const writeFile = () => {
- ReactNativeBlobUtil.fs.writeFile(result + "/text.txt", "Try to write str", 'utf8')
- }
-
- const writeStream = () => {
- ReactNativeBlobUtil.fs.writeStream(result + "/text.txt", "utf8", false)
- }
-
- const writeArrayChunk = () => {
- ReactNativeBlobUtil.fs.writeStream(result + "/text.txt", "ascii", false).then(reactNativeBlobUtilWriteStream => {
- reactNativeBlobUtilWriteStream.encoding = 'ascii'
- reactNativeBlobUtilWriteStream.write(['101', '32', '97'])
- })
- }
-
- const writeChunk = () => {
- ReactNativeBlobUtil.fs.writeStream(result + "/text.txt", "utf8", false).then(reactNativeBlobUtilWriteStream => {
- reactNativeBlobUtilWriteStream.write('Zm9vIChXcml0ZSBCYXNlNjQpMQ==')
- })
- }
-
- const closeStream = () => {
- ReactNativeBlobUtil.fs.writeStream(result + "/text.txt", "utf8", false).then(reactNativeBlobUtilWriteStream => {
- setTimeout(() => {
- reactNativeBlobUtilWriteStream.close();
- }, 1000)
- })
- }
- const readStream = () => {
- ReactNativeBlobUtil.fs.readStream(result + '/text.txt', "utf8", 4000, 200)
- }
-
- const mkdir = () => {
- ReactNativeBlobUtil.fs.mkdir(ReactNativeBlobUtil.fs.dirs.DocumentDir + '/' + mkdirParam)
- };
-
- const stat = () => {
- ReactNativeBlobUtil.fs.stat(result + "/text.txt")
- }
-
- const copyFileToCache = () => {
- ReactNativeBlobUtil.fs.cp(result + "/text.txt", result + "/text1.txt")
- }
-
- const writeFileArray = () => {
- ReactNativeBlobUtil.fs.writeFile(result + "/text.txt", [102, 111, 111], "ascii")
- }
-
- const exists = () => {
- ReactNativeBlobUtil.fs.exists(result + "/text.txt")
- }
-
- const lstat = () => {
- ReactNativeBlobUtil.fs.lstat(result + "/text.txt")
- }
-
- const mv = () => {
- ReactNativeBlobUtil.fs.mv(result + "/text.txt", result + "/text1.txt")
- }
-
- const hash = () => {
- ReactNativeBlobUtil.fs.hash(result + "/text.txt", "md5")
- }
-
- const readFile = () => {
- ReactNativeBlobUtil.fs.readFile(result + "/text.txt", 'utf8', 4000)
- }
-
- const slice = () => {
- ReactNativeBlobUtil.fs.slice(result + "/text.txt", result + "/text1.txt", 2, 5)
- }
-
- const df = () => {
- ReactNativeBlobUtil.fs.df()
- }
-
- const addListener = () => {
- let obj = 'addListener是空实现';
- setResult(obj)
- }
-
- const removeListeners = () => {
- let obj = 'removeListeners是空实现';
- setResult(obj)
- }
-
- const emitExpiredEvent = () => {
- let obj = 'emitExpiredEvent是空实现,三方库没有调用';
- setResult(obj)
- }
-
-
- return (
-
-
- BlobUtil
-
-
-
- {result}
-
-
-
-
-
- BlobUtilTurboModule.getConstants()
-
-
-
- BlobUtilTurboModule.createFile()
-
-
-
- BlobUtilTurboModule.unlink()
-
-
-
- BlobUtilTurboModule.copyFileToCache()
-
-
-
- BlobUtilTurboModule.writeFile()
-
-
-
- BlobUtilTurboModule.stat()
-
-
-
- BlobUtilTurboModule.mkdir()
-
-
-
- BlobUtilTurboModule.writeStream()
-
-
-
- BlobUtilTurboModule.ls()
-
-
-
- BlobUtilTurboModule.createFileASCII()
-
-
-
- BlobUtilTurboModule.writeFileArray()
-
-
-
- BlobUtilTurboModule.exists()
-
-
-
- BlobUtilTurboModule.lstat()
-
-
-
- BlobUtilTurboModule.hash()
-
-
-
- BlobUtilTurboModule.readFile()
-
-
-
- BlobUtilTurboModule.slice()
-
-
-
- BlobUtilTurboModule.df()
-
-
-
- BlobUtilTurboModule.closeStream()
-
-
-
- BlobUtilTurboModule.writeArrayChunk()
-
-
-
- BlobUtilTurboModule.writeChunk()
-
-
-
- BlobUtilTurboModule.readStream()
-
-
-
- BlobUtilTurboModule.mv()
-
-
-
- addListener()
-
-
-
- removeListeners()
-
-
-
- emitExpiredEvent()
-
-
-
-
+ const [result, setResult] = (useState < string) | (null > null);
+ const [mkdirParam, setMkdirParam] = useState("");
+
+ const createFile = async () => {
+ await ReactNativeBlobUtil.fs.createFile(
+ result + "/text.txt",
+ "123456",
+ "utf8"
+ );
+ };
+
+ const ls = async () => {
+ await ReactNativeBlobUtil.fs.ls(ReactNativeBlobUtil.fs.dirs.CacheDir);
+ };
+
+ const createFileASCII = async () => {
+ await ReactNativeBlobUtil.fs.createFile(
+ result + "/text.txt",
+ [102, 111, 111],
+ "ascii"
+ );
+ };
+
+ const unlink = () => {
+ ReactNativeBlobUtil.fs.unlink(result + "/text.txt");
+ };
+
+ const getConstants = () => {
+ let obj = ReactNativeBlobUtil.fs.dirs.CacheDir;
+ setResult(obj);
+ };
+
+ const writeFile = () => {
+ ReactNativeBlobUtil.fs.writeFile(
+ result + "/text.txt",
+ "Try to write str",
+ "utf8"
+ );
+ };
+
+ const writeStream = () => {
+ ReactNativeBlobUtil.fs.writeStream(result + "/text.txt", "utf8", false);
+ };
+
+ const writeArrayChunk = () => {
+ ReactNativeBlobUtil.fs
+ .writeStream(result + "/text.txt", "ascii", false)
+ .then((reactNativeBlobUtilWriteStream) => {
+ reactNativeBlobUtilWriteStream.encoding = "ascii";
+ reactNativeBlobUtilWriteStream.write(["101", "32", "97"]);
+ });
+ };
+
+ const writeChunk = () => {
+ ReactNativeBlobUtil.fs
+ .writeStream(result + "/text.txt", "utf8", false)
+ .then((reactNativeBlobUtilWriteStream) => {
+ reactNativeBlobUtilWriteStream.write("Zm9vIChXcml0ZSBCYXNlNjQpMQ==");
+ });
+ };
+
+ const closeStream = () => {
+ ReactNativeBlobUtil.fs
+ .writeStream(result + "/text.txt", "utf8", false)
+ .then((reactNativeBlobUtilWriteStream) => {
+ setTimeout(() => {
+ reactNativeBlobUtilWriteStream.close();
+ }, 1000);
+ });
+ };
+ const readStream = () => {
+ ReactNativeBlobUtil.fs.readStream(result + "/text.txt", "utf8", 4000, 200);
+ };
+
+ const mkdir = () => {
+ ReactNativeBlobUtil.fs.mkdir(
+ ReactNativeBlobUtil.fs.dirs.DocumentDir + "/" + mkdirParam
+ );
+ };
+
+ const stat = () => {
+ ReactNativeBlobUtil.fs.stat(result + "/text.txt");
+ };
+
+ const copyFileToCache = () => {
+ ReactNativeBlobUtil.fs.cp(result + "/text.txt", result + "/text1.txt");
+ };
+
+ const writeFileArray = () => {
+ ReactNativeBlobUtil.fs.writeFile(
+ result + "/text.txt",
+ [102, 111, 111],
+ "ascii"
+ );
+ };
+
+ const exists = () => {
+ ReactNativeBlobUtil.fs.exists(result + "/text.txt");
+ };
+
+ const lstat = () => {
+ ReactNativeBlobUtil.fs.lstat(result + "/text.txt");
+ };
+
+ const mv = () => {
+ ReactNativeBlobUtil.fs.mv(result + "/text.txt", result + "/text1.txt");
+ };
+
+ const hash = () => {
+ ReactNativeBlobUtil.fs.hash(result + "/text.txt", "md5");
+ };
+
+ const readFile = () => {
+ ReactNativeBlobUtil.fs.readFile(result + "/text.txt", "utf8", 4000);
+ };
+
+ const slice = () => {
+ ReactNativeBlobUtil.fs.slice(
+ result + "/text.txt",
+ result + "/text1.txt",
+ 2,
+ 5
+ );
+ };
+
+ const df = () => {
+ ReactNativeBlobUtil.fs.df();
+ };
+
+ const addListener = () => {
+ let obj = "addListener是空实现";
+ setResult(obj);
+ };
+
+ const removeListeners = () => {
+ let obj = "removeListeners是空实现";
+ setResult(obj);
+ };
+
+ const emitExpiredEvent = () => {
+ let obj = "emitExpiredEvent是空实现,三方库没有调用";
+ setResult(obj);
+ };
+
+ return (
+
+
+ BlobUtil
- );
+
+ {result}
+
+
+
+
+ BlobUtilTurboModule.getConstants()
+
+
+
+ BlobUtilTurboModule.createFile()
+
+
+
+ BlobUtilTurboModule.unlink()
+
+
+
+
+ BlobUtilTurboModule.copyFileToCache()
+
+
+
+
+ BlobUtilTurboModule.writeFile()
+
+
+
+ BlobUtilTurboModule.stat()
+
+
+
+ BlobUtilTurboModule.mkdir()
+
+
+
+ BlobUtilTurboModule.writeStream()
+
+
+
+ BlobUtilTurboModule.ls()
+
+
+
+
+ BlobUtilTurboModule.createFileASCII()
+
+
+
+
+
+ BlobUtilTurboModule.writeFileArray()
+
+
+
+
+ BlobUtilTurboModule.exists()
+
+
+
+ BlobUtilTurboModule.lstat()
+
+
+
+ BlobUtilTurboModule.hash()
+
+
+
+ BlobUtilTurboModule.readFile()
+
+
+
+ BlobUtilTurboModule.slice()
+
+
+
+ BlobUtilTurboModule.df()
+
+
+
+ BlobUtilTurboModule.closeStream()
+
+
+
+
+ BlobUtilTurboModule.writeArrayChunk()
+
+
+
+
+ BlobUtilTurboModule.writeChunk()
+
+
+
+ BlobUtilTurboModule.readStream()
+
+
+
+ BlobUtilTurboModule.mv()
+
+
+
+ addListener()
+
+
+
+ removeListeners()
+
+
+
+ emitExpiredEvent()
+
+
+
+
+
+ );
}
const styles = StyleSheet.create({
- container: {
- width: '100%',
- height: '100%',
- flexDirection: 'column',
- alignItems: 'center',
- backgroundColor: '#F1F3F5',
- },
- baseText: {
- width: '100%',
- height: '100%',
- fontWeight: 'bold',
- textAlign: 'center',
- fontSize: 16,
- ellipsizeMode: 'tail',
- numberOfLines: 2
- },
- titleArea: {
- width: '90%',
- height: '8%',
- alignItems: 'center',
- flexDirection: 'row',
- },
- title: {
- width: '90%',
- color: '#000000',
- textAlign: 'left',
- fontSize: 30,
- },
- scrollView: {
- width: '90%',
- marginHorizontal: 10,
- },
-
- inputArea: {
- width: '90%',
- height: '10%',
- borderWidth: 2,
- borderColor: '#000000',
- marginTop: 8,
- justifyContent: 'center',
- alignItems: 'center',
- },
- baseArea: {
- width: '100%',
- height: 60,
- borderRadius: 4,
- borderColor: '#000000',
- marginTop: 6,
- backgroundColor: '#FFFFFF',
- flexDirection: 'row',
- alignItems: 'center',
- paddingLeft: 8,
- paddingRight: 8
- }
+ container: {
+ width: "100%",
+ height: "100%",
+ flexDirection: "column",
+ alignItems: "center",
+ backgroundColor: "#F1F3F5",
+ },
+ baseText: {
+ width: "100%",
+ height: "100%",
+ fontWeight: "bold",
+ textAlign: "center",
+ fontSize: 16,
+ ellipsizeMode: "tail",
+ numberOfLines: 2,
+ },
+ titleArea: {
+ width: "90%",
+ height: "8%",
+ alignItems: "center",
+ flexDirection: "row",
+ },
+ title: {
+ width: "90%",
+ color: "#000000",
+ textAlign: "left",
+ fontSize: 30,
+ },
+ scrollView: {
+ width: "90%",
+ marginHorizontal: 10,
+ },
+
+ inputArea: {
+ width: "90%",
+ height: "10%",
+ borderWidth: 2,
+ borderColor: "#000000",
+ marginTop: 8,
+ justifyContent: "center",
+ alignItems: "center",
+ },
+ baseArea: {
+ width: "100%",
+ height: 60,
+ borderRadius: 4,
+ borderColor: "#000000",
+ marginTop: 6,
+ backgroundColor: "#FFFFFF",
+ flexDirection: "row",
+ alignItems: "center",
+ paddingLeft: 8,
+ paddingRight: 8,
+ },
});
```
@@ -348,7 +416,7 @@ const styles = StyleSheet.create({
首先需要使用 DevEco Studio 打开项目里的鸿蒙工程 `harmony`
-### 在工程根目录的 `oh-package.json` 添加 overrides字段
+### 在工程根目录的 `oh-package.json` 添加 overrides 字段
```
{
@@ -390,37 +458,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-把`tester/node_modules/@react-native-oh-tpl/react-native-blob-util/harmony/`目录下的源码``复制到`harmony`工程根目录下
-
-在`harmony`工程根目录的 `build-profile.template.json5`(若存在)和`build-profile.json5` 添加以下模块
-
-```
-modules:[
- ...
- {
- name: 'blobUtil',
- srcPath: './blobUtil',
- }
-]
-```
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
- "@react-native-oh-tpl/rnoh-blob-util": "file:../../node_modules/@react-native-oh-tpl/react-native-blob-util/harmony/blobUtil"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 BlobUtilPackage
@@ -519,7 +557,7 @@ ohpm install
#### Android API
-##### ReactNativeBlobUtil.android
+##### ReactNativeBlobUtil.android
| Name | Description | Required | Platform | HarmonyOS Support |
| :-----------------: | :----------: | :------: | :------: | :---------------: |
@@ -529,7 +567,7 @@ ohpm install
#### File System Access API
-##### ReactNativeBlobUtil.fs
+##### ReactNativeBlobUtil.fs
| Name | Description | Required | Platform | HarmonyOS Support |
| :---------: | :--------------------------------: | :------: | :---------: | :---------------: |
@@ -556,7 +594,7 @@ ohpm install
#### iOS API
-#### ReactNativeBlobUtil.ios
+#### ReactNativeBlobUtil.ios
| Name | Description | Required | Platform | HarmonyOS Support |
| --------------- | -------------------------------------- | -------- | -------- | ----------------- |
@@ -565,26 +603,24 @@ ohpm install
#### Network Utils
-##### ReactNativeBlobUtil.net
+##### ReactNativeBlobUtil.net
| Name | Description | Required | Platform | HarmonyOS Support |
| ------------- | ----------- | -------- | ----------- | ----------------- |
-| getCookies | 获取cookie | No | IOS/Android | No |
-| removeCookies | 删除cookie | No | IOS/Android | No |
+| getCookies | 获取 cookie | No | IOS/Android | No |
+| removeCookies | 删除 cookie | No | IOS/Android | No |
#### Session API
-##### ReactNativeBlobUtil.session
+##### ReactNativeBlobUtil.session
| Name | Description | Required | Platform | HarmonyOS Support |
| ------- | ----------- | -------- | ----------- | ----------------- |
| session | 会话 | No | IOS/Android | No |
-
-
#### MediaStore(Android Media Storage)
-##### ReactNativeBlobUtil.MediaCollection
+##### ReactNativeBlobUtil.MediaCollection
| Name | Description | Required | Platform | HarmonyOS Support |
| ---------------- | -------------- | -------- | -------- | ----------------- |
diff --git a/zh-cn/react-native-cameraroll.md b/zh-cn/react-native-cameraroll.md
index e3c436488218af6b277292dcfc7674eb02e9be87..87fb2a5e4170b2b195a7f3afe28794c84171c6b2 100644
--- a/zh-cn/react-native-cameraroll.md
+++ b/zh-cn/react-native-cameraroll.md
@@ -128,24 +128,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-camera-roll": "file:../../node_modules/@react-native-oh-tpl/camera-roll/harmony/camera_roll"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 CameraRollPackage
@@ -213,7 +196,7 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
### 应用权限申请
-> [!tip] "ohos.permission.READ_IMAGEVIDEO","ohos.permission.WRITE_IMAGEVIDEO"权限等级为system_basic ,授权方式为user_grant ,[使用ACL签名的配置指导](https://developer.harmonyos.com/cn/docs/documentation/doc-guides-V3/signing-0000001587684945-V3#section157591551175916)
+> [!tip] "ohos.permission.READ_IMAGEVIDEO","ohos.permission.WRITE_IMAGEVIDEO"权限等级为system_basic ,授权方式为user_grant ,[使用 ACL 签名的配置指导](https://developer.harmonyos.com/cn/docs/documentation/doc-guides-V3/signing-0000001587684945-V3#section157591551175916)
在 `YourProject/entry/src/main/module.json5`补上配置
@@ -293,7 +276,7 @@ ohpm install
- [ ] harmony 查找图片/视频部分查询条件和返回字段需要使用系统接口
- [ ] harmony 纯图片相册暂未对外开放,系统相册不返回相册名
- [ ] harmony 删除图片/视频需要使用系统接口
-- [ ] harmony 暂无对标ios图片列表刷新的方法
+- [ ] harmony 暂无对标 ios 图片列表刷新的方法
## 其他
diff --git a/zh-cn/react-native-clipboard-clipboard.md b/zh-cn/react-native-clipboard-clipboard.md
index cb10310ddca9e51d2754407f4fd5ddada279f804..4465373379b564f8785e107ff66b30e5c4e96830 100644
--- a/zh-cn/react-native-clipboard-clipboard.md
+++ b/zh-cn/react-native-clipboard-clipboard.md
@@ -106,24 +106,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-clipboard": "file:../../node_modules/@react-native-oh-tpl/clipboard/harmony/clipboard"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 ClipboardPackage
diff --git a/zh-cn/react-native-clippath.md b/zh-cn/react-native-clippath.md
index 67e8abbd4982ac06a9747c522cfaf9ffe3b40227..76ab8d9f89d17d4b9eb63f926739eac088422f75 100644
--- a/zh-cn/react-native-clippath.md
+++ b/zh-cn/react-native-clippath.md
@@ -9,7 +9,6 @@
-
> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-clippath)
## 安装与使用
@@ -39,23 +38,24 @@ yarn add @react-native-oh-tpl/clip-path@file:#
下面的代码展示了这个库的基本使用场景:
```jsx
-import { View, Text, ScrollView } from 'react-native'
-import React from 'react'
-import { ClipPathView } from 'react-native-clippathview'
+import { View, Text, ScrollView } from "react-native";
+import React from "react";
+import { ClipPathView } from "react-native-clippathview";
export default function index() {
- const viewBox = [0, 0, 400, 400]
- const path = "M 0 0 L 400 0 L 0 400 L 400 400 Z"
+ const viewBox = [0, 0, 400, 400];
+ const path = "M 0 0 L 400 0 L 0 400 L 400 400 Z";
return (
-
-
- MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
+
+
+
+ MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
+
- )
+ );
}
-
```
## 兼容性
@@ -66,7 +66,7 @@ export default function index() {
本文档内容基于以下版本验证通过:
-1. RNOH: 0.72.26; SDK: HarmonyOS-NEXT-DP2; IDE: DevEco Studio 5.0.3.29; ROM: 205.0.0.18;
+1. RNOH: 0.72.26; SDK: HarmonyOS-NEXT-DP2; IDE: DevEco Studio 5.0.3.29; ROM: 205.0.0.18;
2. RNOH: 0.72.26; SDK: armonyOS NEXT Developer preview2、5.0.0.22(API Version 12 Canary3); IDE: DevEco Studio: 5.0.3.300;ROM: 3.0.0.22;
## Link
@@ -106,23 +106,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "rnoh": "file:../rnoh",
- "rnoh-clip-path": "file:../../node_modules/@react-native-oh-tpl/clip-path/harmony/clip_path",
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 在 ArkTs 侧引入 ClipPath 组件
@@ -188,39 +172,38 @@ ohpm install
> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| -------------------- | ------------------------------------------------------------ | ----------------- | -------- | ----------- | ----------------- |
-| svgKey | 唯一key | string | No | IOS/Android | Yes |
-| d | 形状由一系列命令定义(svg path data) | string | No | IOS/Android | Yes |
-| viewBox | 定义用户空间中的位置和维度 | Array(4) | No | IOS/Android | Yes |
-| align | preserveAspectRatio 属性的 align | string | No | IOS/Android | No |
-| aspect | preserveAspectRatio 属性的 meetOrSlice | meet/slice/none | No | IOS/Android | No |
-| fillRule | 路径内部填充规则 | nonzero/evenodd | No | IOS/Android | No |
-| strokeWidth | 路径描边宽度 | number | No | IOS/Android | Yes |
-| strokeCap | 开放路径两端的形状 | butt/round/square | No | IOS/Android | Yes |
-| strokeJoin | 路径转角处使用的形状 | bevel/miter/round | No | IOS/Android | Yes |
-| strokeMiter | strokeJoin值是miter,设置夹角延伸 | number | No | IOS/Android | Yes |
-| strokeStart | IOS CAShapeLayer 描线开始的地方占总路径的百分比。默认值是0。 | number | No | IOS/Android | No |
-| strokeEnd | IOS CAShapeLayer 表示绘制结束的地方站总路径的百分比。默认值是1,如果小于等于strokeStart 则绘制不出任何内容。 | number | No | IOS/Android | No |
-| translateZ | 设置定位层级,相当于index | number | No | IOS/Android | Yes |
-| transX | 在二维平面上水平方向移动元素 | number | No | IOS/Android | Yes |
-| transY | 在二维平面上垂直方向移动元素 | number | No | IOS/Android | Yes |
-| transPercentageValue | transX、transY 使用百分比 | boolean | No | IOS/Android | Yes |
-| rot | 元素围绕一个定点旋转 | number | No | IOS/Android | Yes |
-| rotOx | 旋转中心点水平位置 | number | No | IOS/Android | Yes |
-| rotOy | 旋转中心点垂直位置 | number | No | IOS/Android | Yes |
-| rotPercentageValue | rotOx、rotOy 使用百分比 | boolean | No | IOS/Android | Yes |
-| sc | 放大或缩小元素 | number | No | IOS/Android | Yes |
-| scX | 水平缩放 | number | No | IOS/Android | Yes |
-| scY | 垂直缩放 | number | No | IOS/Android | Yes |
-| scO | 缩放中心点位置 | number | No | IOS/Android | Yes |
-| scOx | 缩放中心点水平位置 | number | No | IOS/Android | Yes |
-| scOy | 缩放中心点垂直位置 | number | No | IOS/Android | Yes |
-| scPercentageValue | scO、scOx、scOy使用百分比 | boolean | No | IOS/Android | Yes |
-
-
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| -------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------- | -------- | ----------- | ----------------- |
+| svgKey | 唯一 key | string | No | IOS/Android | Yes |
+| d | 形状由一系列命令定义(svg path data) | string | No | IOS/Android | Yes |
+| viewBox | 定义用户空间中的位置和维度 | Array(4) | No | IOS/Android | Yes |
+| align | preserveAspectRatio 属性的 align | string | No | IOS/Android | No |
+| aspect | preserveAspectRatio 属性的 meetOrSlice | meet/slice/none | No | IOS/Android | No |
+| fillRule | 路径内部填充规则 | nonzero/evenodd | No | IOS/Android | No |
+| strokeWidth | 路径描边宽度 | number | No | IOS/Android | Yes |
+| strokeCap | 开放路径两端的形状 | butt/round/square | No | IOS/Android | Yes |
+| strokeJoin | 路径转角处使用的形状 | bevel/miter/round | No | IOS/Android | Yes |
+| strokeMiter | strokeJoin 值是 miter,设置夹角延伸 | number | No | IOS/Android | Yes |
+| strokeStart | IOS CAShapeLayer 描线开始的地方占总路径的百分比。默认值是 0。 | number | No | IOS/Android | No |
+| strokeEnd | IOS CAShapeLayer 表示绘制结束的地方站总路径的百分比。默认值是 1,如果小于等于 strokeStart 则绘制不出任何内容。 | number | No | IOS/Android | No |
+| translateZ | 设置定位层级,相当于 index | number | No | IOS/Android | Yes |
+| transX | 在二维平面上水平方向移动元素 | number | No | IOS/Android | Yes |
+| transY | 在二维平面上垂直方向移动元素 | number | No | IOS/Android | Yes |
+| transPercentageValue | transX、transY 使用百分比 | boolean | No | IOS/Android | Yes |
+| rot | 元素围绕一个定点旋转 | number | No | IOS/Android | Yes |
+| rotOx | 旋转中心点水平位置 | number | No | IOS/Android | Yes |
+| rotOy | 旋转中心点垂直位置 | number | No | IOS/Android | Yes |
+| rotPercentageValue | rotOx、rotOy 使用百分比 | boolean | No | IOS/Android | Yes |
+| sc | 放大或缩小元素 | number | No | IOS/Android | Yes |
+| scX | 水平缩放 | number | No | IOS/Android | Yes |
+| scY | 垂直缩放 | number | No | IOS/Android | Yes |
+| scO | 缩放中心点位置 | number | No | IOS/Android | Yes |
+| scOx | 缩放中心点水平位置 | number | No | IOS/Android | Yes |
+| scOy | 缩放中心点垂直位置 | number | No | IOS/Android | Yes |
+| scPercentageValue | scO、scOx、scOy 使用百分比 | boolean | No | IOS/Android | Yes |
## 遗留问题
+
部分属性目前版本暂不支持,具体参考属性表格 `HarmonyOS ` 列。
## 其他
@@ -229,5 +212,4 @@ ohpm install
本项目基于 [MIT License](https://github.com/react-native-oh-library/react-native-clippath/blob/sig/LICENSE) ,请自由地享受和参与开源。
-------------------------------------------------------------
-
+---
diff --git a/zh-cn/react-native-community-blur.md b/zh-cn/react-native-community-blur.md
index 8a3650468eea21c71cff97b39c46bc774ec49840..f1f75422d45e3f29fccc012f7165fbb231f3a3e6 100644
--- a/zh-cn/react-native-community-blur.md
+++ b/zh-cn/react-native-community-blur.md
@@ -236,24 +236,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-blur": "file:../../node_modules/@react-native-oh-tpl/blur/harmony/blur"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 BlurPackage
@@ -410,8 +393,8 @@ ohpm install
## 遗留问题
-- [x] blurTypes设置为ios/android平台定义枚举值,闪退[issue#755](https://gl.swmansion.com/rnoh/react-native-harmony/-/issues/755)
-- [ ] harmony 暂不支持VibrancyView组件
+- [x] blurTypes 设置为 ios/android 平台定义枚举值,闪退[issue#755](https://gl.swmansion.com/rnoh/react-native-harmony/-/issues/755)
+- [ ] harmony 暂不支持 VibrancyView 组件
## 其他
diff --git a/zh-cn/react-native-community-checkbox.md b/zh-cn/react-native-community-checkbox.md
index dc870d2532e4256d67d23df123b6c29bc1eb40a2..e4d444a16cca3f220687a6843367e0a88767f2a4 100644
--- a/zh-cn/react-native-community-checkbox.md
+++ b/zh-cn/react-native-community-checkbox.md
@@ -104,24 +104,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-checkbox": "file:../../node_modules/@react-native-oh-tpl/checkbox/harmony/checkbox"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 CheckboxPackge
diff --git a/zh-cn/react-native-community-datetimepicker.md b/zh-cn/react-native-community-datetimepicker.md
index 293af18cc31752da088ee6aa23aaf7fd9c3baf69..3624af5ea9f77c1ce1729180242da67a8fe9fd7a 100644
--- a/zh-cn/react-native-community-datetimepicker.md
+++ b/zh-cn/react-native-community-datetimepicker.md
@@ -126,24 +126,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-datetimepicker": "file:../../node_modules/@react-native-oh-tpl/datetimepicker/harmony/datetimepicker"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 datetimepicker
@@ -263,7 +246,7 @@ ohpm install
## 遗留问题
-- [x] 已解决:textColor属性在compact和inline模式改变值后使用禁用操作,颜色会变白色[issue#17](https://github.com/react-native-oh-library/datetimepicker/issues/17)
+- [x] 已解决:textColor 属性在 compact 和 inline 模式改变值后使用禁用操作,颜色会变白色[issue#17](https://github.com/react-native-oh-library/datetimepicker/issues/17)
- [ ] 部分接口,未适配
diff --git a/zh-cn/react-native-community-netinfo.md b/zh-cn/react-native-community-netinfo.md
index 8f237cb2ffd7cc0c7138e4eab810ba615181246a..e7fc61ca2748f1ce2205fcce5deefd59a6ef378a 100644
--- a/zh-cn/react-native-community-netinfo.md
+++ b/zh-cn/react-native-community-netinfo.md
@@ -110,24 +110,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-netinfo": "file:../../node_modules/@react-native-oh-tpl/netinfo/harmony/netinfo"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 RNCNetInfoPackage
diff --git a/zh-cn/react-native-community-progress-bar-android.md b/zh-cn/react-native-community-progress-bar-android.md
index 82dbde1c9271bd82f2bc0eea8771dbc52130e22b..aa005743c9aa0ef9b094164ca83c70c79d92268f 100644
--- a/zh-cn/react-native-community-progress-bar-android.md
+++ b/zh-cn/react-native-community-progress-bar-android.md
@@ -87,24 +87,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-progress-bar-android": "file:../../node_modules/@react-native-oh-tpl/progress-bar-android/harmony/progress_bar_android"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 ProgressBarAndroidPackage
diff --git a/zh-cn/react-native-community-progress-view.md b/zh-cn/react-native-community-progress-view.md
index 21efa0852494013d2cb88a9a36cbbf9893f65b6d..fd7b002303739b8e88222678c6e62d8ecc7835a0 100644
--- a/zh-cn/react-native-community-progress-view.md
+++ b/zh-cn/react-native-community-progress-view.md
@@ -90,24 +90,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-progress-view": "file:../../node_modules/@react-native-oh-tpl/progress-view/harmony/progress-view"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 ProgressViewPackage
diff --git a/zh-cn/react-native-community-push-notification-ios.md b/zh-cn/react-native-community-push-notification-ios.md
index b5d86b30b41facda111542875cc2b5efa59d5a33..c999e3539b98587d5ff8b7a9c312da7fbb0a654f 100644
--- a/zh-cn/react-native-community-push-notification-ios.md
+++ b/zh-cn/react-native-community-push-notification-ios.md
@@ -200,24 +200,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-push-notification": "file:../../node_modules/@react-native-oh-tpl/push-notification-ios/harmony/push_notification"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 PushNotificationPackage
@@ -328,7 +311,7 @@ RNOH:0.72.13; SDK:HarmonyOS NEXT Developer Preview1; IDE:DevEco Studio 4.1
> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-以下属性已验证,更多属性详情请查看 [react-native-push-notification-ios的文档介绍](https://github.com/react-native-oh-library/react-native-push-notification)
+以下属性已验证,更多属性详情请查看 [react-native-push-notification-ios 的文档介绍](https://github.com/react-native-oh-library/react-native-push-notification)
**Parameters:**
@@ -350,8 +333,8 @@ _NotificationRequest:_
## 遗留问题
-- [ ] HarmonyOS的NotificationManager的规格和IOS不一致,其NotificationRequest所含参数,在HarmonyOS上部分没有适配对应参数,问题: [issue#1](https://github.com/react-native-oh-library/react-native-push-notification/issues/1)
-- [ ] 原库部分接口在HarmonyOS中没有对应接口处理相关逻辑,问题: [issue#2](https://github.com/react-native-oh-library/react-native-push-notification/issues/2)
+- [ ] HarmonyOS 的 NotificationManager 的规格和 IOS 不一致,其 NotificationRequest 所含参数,在 HarmonyOS 上部分没有适配对应参数,问题: [issue#1](https://github.com/react-native-oh-library/react-native-push-notification/issues/1)
+- [ ] 原库部分接口在 HarmonyOS 中没有对应接口处理相关逻辑,问题: [issue#2](https://github.com/react-native-oh-library/react-native-push-notification/issues/2)
## 其他
diff --git a/zh-cn/react-native-community-slider.md b/zh-cn/react-native-community-slider.md
index bf64fe9e30c01a11c6db3bf07085e98bd852ef3f..8df8cda218443b53d19e2d882c5149ee5f909787 100644
--- a/zh-cn/react-native-community-slider.md
+++ b/zh-cn/react-native-community-slider.md
@@ -92,24 +92,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-slider": "file:../../node_modules/@react-native-oh-tpl/slider/harmony/slider"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 SliderPackge
diff --git a/zh-cn/react-native-cookies.md b/zh-cn/react-native-cookies.md
index 256f5dcc12123043e9c7c5fa33da7ad43f7abb3f..774b2eb99044ccbf9e6d8cc475e273f342f17778 100644
--- a/zh-cn/react-native-cookies.md
+++ b/zh-cn/react-native-cookies.md
@@ -35,17 +35,23 @@ yarn add @react-native-oh-tpl/cookies@file:#
-HarmonyOS中使用react-native-cookies需要配合react-native-webview使用,具体请参考[@react-native-oh-tpl/react-native-webview](/zh-cn/react-native-webview.md)
+HarmonyOS 中使用 react-native-cookies 需要配合 react-native-webview 使用,具体请参考[@react-native-oh-tpl/react-native-webview](/zh-cn/react-native-webview.md)
下面的代码展示了这个库的基本使用场景:
> [!WARNING] 使用时 import 的库名不变。
```ts
-import React, { useState, useRef } from 'react';
-import {ScrollView, StyleSheet, Text ,View, TouchableOpacity} from 'react-native';
-import CookieManager from '@react-native-cookies/cookies';
-import { WebView } from 'react-native-webview';
+import React, { useState, useRef } from "react";
+import {
+ ScrollView,
+ StyleSheet,
+ Text,
+ View,
+ TouchableOpacity,
+} from "react-native";
+import CookieManager from "@react-native-cookies/cookies";
+import { WebView } from "react-native-webview";
export interface Cookie {
name: string;
@@ -63,67 +69,97 @@ export interface Cookies {
}
export function CookiesPage() {
- const httpUrl = 'https://www.baidu.com';
- const [result, setResult] = useState('请点击按钮,进行操作');
+ const httpUrl = "https://www.baidu.com";
+ const [result, setResult] = useState("请点击按钮,进行操作");
const webViewRef = useRef(null);
return (
- ;
+ ;
{result}
- {
- let cookieResult = await CookieManager.clearAll(true);
- let result = cookieResult ? '清除所有cookie成功' : '清除所有cookie失败';
- setResult(result + '');
- }} >
+ {
+ let cookieResult = await CookieManager.clearAll(true);
+ let result = cookieResult
+ ? "清除所有cookie成功"
+ : "清除所有cookie失败";
+ setResult(result + "");
+ }}
+ >
clearAll()【清除所有cookie】
- {
- let cookieResult = await CookieManager.get(httpUrl, true);
- setResult(JSON.stringify(cookieResult));
- }} >
+ {
+ let cookieResult = await CookieManager.get(httpUrl, true);
+ setResult(JSON.stringify(cookieResult));
+ }}
+ >
get()【根据url获取cookie】
- {
- let curCookie: Cookie = {name: 'myAddCookie', value: 'myNewCookie'};
- let cookieResult = await CookieManager.set(httpUrl, curCookie, true);
- let result = cookieResult ? '根据url设置cookie成功' : '根据url设置cookie失败';
- setResult(result);
- }} >
+ {
+ let curCookie: Cookie = { name: "myAddCookie", value: "myNewCookie" };
+ let cookieResult = await CookieManager.set(httpUrl, curCookie, true);
+ let result = cookieResult
+ ? "根据url设置cookie成功"
+ : "根据url设置cookie失败";
+ setResult(result);
+ }}
+ >
set()【根据url设置cookie】
- {
- let cookieResult = await CookieManager.clearByName(httpUrl, 'myAddCookie', true);
- let result = cookieResult ? '根据名称删除cookie成功' : '根据名称删除cookie失败';
- setResult(result);
- }} >
+ {
+ let cookieResult = await CookieManager.clearByName(
+ httpUrl,
+ "myAddCookie",
+ true
+ );
+ let result = cookieResult
+ ? "根据名称删除cookie成功"
+ : "根据名称删除cookie失败";
+ setResult(result);
+ }}
+ >
clearByName()【根据名称删除cookie】
- {
- CookieManager.flushForHarmony(() => {
- if (webViewRef.current) {
- webViewRef.current.reload();
- }
- });
- setResult('刷新cookie成功');
- }} >
+ {
+ CookieManager.flushForHarmony(() => {
+ if (webViewRef.current) {
+ webViewRef.current.reload();
+ }
+ });
+ setResult("刷新cookie成功");
+ }}
+ >
flush()【刷新cookie】
- {
- let cookieResult = await CookieManager.removeSessionCookies();
- let result = cookieResult ? '清除会话cookie成功' : '清除会话cookie失败';
- setResult(result);
- }} >
+ {
+ let cookieResult = await CookieManager.removeSessionCookies();
+ let result = cookieResult
+ ? "清除会话cookie成功"
+ : "清除会话cookie失败";
+ setResult(result);
+ }}
+ >
removeSessionCookies()【清除会话cookie】
@@ -132,31 +168,31 @@ export function CookiesPage() {
const styles = StyleSheet.create({
container: {
- width: '100%',
- height: '100%',
- alignItems: 'center'
+ width: "100%",
+ height: "100%",
+ alignItems: "center",
},
pageArea: {
- width: '95%',
- height: 80
+ width: "95%",
+ height: 80,
},
resultArea: {
- width: '95%',
+ width: "95%",
borderWidth: 2,
- borderColor: 'gray',
+ borderColor: "gray",
borderRadius: 10,
- marginTop: 5
+ marginTop: 5,
},
button: {
- backgroundColor: '#FF0000',
+ backgroundColor: "#FF0000",
paddingHorizontal: 16,
paddingVertical: 10,
borderRadius: 24,
- alignItems: 'center',
- justifyContent: 'center',
+ alignItems: "center",
+ justifyContent: "center",
elevation: 4,
- width: '80%',
- marginTop: 5
+ width: "80%",
+ marginTop: 5,
},
});
```
@@ -200,25 +236,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-cookies": "file:../../node_modules/@react-native-oh-tpl/cookies/harmony/rn_cookies",
- ...
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 cookies、webview
@@ -276,7 +294,7 @@ std::vector> PackageProvider::getPackages(Package::Cont
}
```
-### 在 ArkTs 侧引入 webView组件
+### 在 ArkTs 侧引入 webView 组件
找到 **function buildCustomComponent()**,一般位于 `entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets`,添加:
@@ -306,7 +324,7 @@ std::vector> PackageProvider::getPackages(Package::Cont
...
```
-### 在 ArkTs 侧引入 CookiesPackage和WebViewPackage
+### 在 ArkTs 侧引入 CookiesPackage 和 WebViewPackage
打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
diff --git a/zh-cn/react-native-exception-handler.md b/zh-cn/react-native-exception-handler.md
index c8024f8b7e7f4f3f20e229c86646c717e3afb6a1..4c5c7689705e68aae19b80e4f2018ef733cd452e 100644
--- a/zh-cn/react-native-exception-handler.md
+++ b/zh-cn/react-native-exception-handler.md
@@ -94,7 +94,7 @@ const exceptionhandler = (exceptionString) => {
setNativeExceptionHandler(
exceptionhandler,
forceAppQuit,
- executeDefaultHandler,
+ executeDefaultHandler
);
// - exceptionhandler is the exception handler function
// - forceAppQuit is an optional ANDROID specific parameter that defines
@@ -144,24 +144,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```diff
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
-+ "rnoh-exception-handler": "file:../../node_modules/@react-native-oh-tpl/react-native-exception-handler/harmony/exception_handler"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 ExceptionHandlerPackage
diff --git a/zh-cn/react-native-fast-image.md b/zh-cn/react-native-fast-image.md
index 077ccb83e3f6173cffc7191004352992e007acfc..26b9c3263cde5c6f73744569e718961eccf63558 100644
--- a/zh-cn/react-native-fast-image.md
+++ b/zh-cn/react-native-fast-image.md
@@ -96,24 +96,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-fast-image": "file:../../node_modules/@react-native-oh-tpl/react-native-fast-image/harmony/fast_image"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 FastImagePackage
diff --git a/zh-cn/react-native-fs.md b/zh-cn/react-native-fs.md
index 71a85a13041a8c016ef08ee623eff1c0e27aabf7..398de747018f7e9a9062f909412c2ea5ca443ae1 100644
--- a/zh-cn/react-native-fs.md
+++ b/zh-cn/react-native-fs.md
@@ -69,7 +69,7 @@ function App(): React.JSX.Element {
},
(err) => {
console.error("file mkdir: " + err.message);
- },
+ }
);
};
// 组件
@@ -181,24 +181,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-fs": "file:../../node_modules/@react-native-oh-tpl/react-native-fs/harmony/fs"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 FsPackge
@@ -357,8 +340,8 @@ ohpm install
## 遗留问题
-- HarmonyOS的hash哈希API中关于算法参数algorithm目前仅支持"md5"、"sha1"、 "sha256",其他相关算法参数目前不支持,问题: [issue#1](https://github.com/react-native-oh-library/react-native-fs/issues/1)
-- 原库部分接口在HarmonyOS中没有对应文件路径常量及接口处理相关逻辑,问题: [issue#2](https://github.com/react-native-oh-library/react-native-fs/issues/2)
+- HarmonyOS 的 hash 哈希 API 中关于算法参数 algorithm 目前仅支持"md5"、"sha1"、 "sha256",其他相关算法参数目前不支持,问题: [issue#1](https://github.com/react-native-oh-library/react-native-fs/issues/1)
+- 原库部分接口在 HarmonyOS 中没有对应文件路径常量及接口处理相关逻辑,问题: [issue#2](https://github.com/react-native-oh-library/react-native-fs/issues/2)
## 其他
diff --git a/zh-cn/react-native-geolocation.md b/zh-cn/react-native-geolocation.md
index 0e1b3b7f0794260402f9d4b4a5f68fef6e9f69e2..1374e306eeb2765497d79f112deb619e2791d1e4 100644
--- a/zh-cn/react-native-geolocation.md
+++ b/zh-cn/react-native-geolocation.md
@@ -92,24 +92,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-geolocation": "file:../../node_modules/@react-native-oh-tpl/react-native-geolocation/harmony/geolocation"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 geolocation
diff --git a/zh-cn/react-native-gesture-handler.md b/zh-cn/react-native-gesture-handler.md
index 3e554b32e5808020dee9bb0a871e25187dd2ba16..15d68ef54dce0175f605b5f55ab9eb876bac9382 100644
--- a/zh-cn/react-native-gesture-handler.md
+++ b/zh-cn/react-native-gesture-handler.md
@@ -83,7 +83,7 @@ class Circle extends Component {
{
translateX: Animated.add(
this._touchX,
- new Animated.Value(-circleRadius),
+ new Animated.Value(-circleRadius)
),
},
],
@@ -140,24 +140,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-gesture-handler": "file:../../node_modules/@react-native-oh-tpl/react-native-gesture-handler/harmony/gesture_handler"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 GestureHandlerPackage
@@ -330,7 +313,7 @@ Creates a new instance of [PanGesture](https://docs.swmansion.com/react-native-g
### Touchables
-Gesture Handler 库提供了一种基于原生按钮的 React Native touchable 组件的实现,它不依赖于 React Native 的 JS responder system。这些组件的实现遵循相同的API,旨在替代 React Native 中的 touchable 组件
+Gesture Handler 库提供了一种基于原生按钮的 React Native touchable 组件的实现,它不依赖于 React Native 的 JS responder system。这些组件的实现遵循相同的 API,旨在替代 React Native 中的 touchable 组件
目前支持:
diff --git a/zh-cn/react-native-image-editor.md b/zh-cn/react-native-image-editor.md
index eab475a908569b0d43f3e22eeb52cc98e17825f3..b263ddd0fa3e11af5532a4383b19df92371284c4 100644
--- a/zh-cn/react-native-image-editor.md
+++ b/zh-cn/react-native-image-editor.md
@@ -13,7 +13,7 @@
-> [Github 地址](https://github.com/react-native-oh-library/react-native-image-editor)
+> [Github 地址](https://github.com/react-native-oh-library/react-native-image-editor)
## 安装与使用
@@ -36,10 +36,10 @@ yarn add @react-native-oh-tpl/image-editor@file:#
> [!TIP] 使用时 import 的库名不变。
```js
-import ImageEditor from '@react-native-community/image-editor';
+import ImageEditor from "@react-native-community/image-editor";
ImageEditor.cropImage(uri, cropData).then((result) => {
- console.log('Cropped image uri:', result);
+ console.log("Cropped image uri:", result);
});
```
@@ -80,25 +80,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
- "@react-native-oh-tpl/image-editor": "file:../../node_modules/@react-native-oh-tpl/image-editor/harmony/image_editor"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
-
-
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 在 ArkTs 侧引入 ImageEditorPackage
@@ -141,22 +123,22 @@ RNOH:0.72.20; SDK:HarmonyOS-NEXT-DB1; IDE:DevEco Studio 5.0.3.200; ROM:2
## API
-| Name | Description | Platform | HarmonyOS Support |
-| --------- | ------------------------------------------------------------ | ----------- | ----------------- |
+| Name | Description | Platform | HarmonyOS Support |
+| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | ----------------- |
| cropImage | Crop the image specified by the URI param. If URI points to a remote image, it will be downloaded automatically. If the image cannot be loaded/downloaded, the promise will be rejected. If the cropping process is successful, the resultant cropped image will be stored in the cache path, and the CropResult returned in the promise will point to the image in the cache path. ⚠️ Remember to delete the cropped image from the cache path when you are done with it. | ios/Android | yes |
cropData
-| 名称 | 类型 | 说明 | 是否必填 | 原库平台 | 鸿蒙支持 |
-| ------------- | --------------------------------- | ------------------------------------------------------------ | -------- | -------- | -------- |
-| `offset` | { x: number, y: number } | The top-left corner of the cropped image, specified in the original image's coordinate space | yes | All | yes |
-| `size` | { width: number, height: number } | Size (dimensions) of the cropped image | yes | All | yes |
-| `displaySize` | { width: number, height: number } | Size to which you want to scale the cropped image | no | All | yes |
-| `resizeMode` | 'contain' \| 'cover' \| 'stretch' | Resizing mode to use when scaling the image**Default value**: `'cover'` | no | All | yes |
+| 名称 | 类型 | 说明 | 是否必填 | 原库平台 | 鸿蒙支持 |
+| ------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | -------- |
+| `offset` | { x: number, y: number } | The top-left corner of the cropped image, specified in the original image's coordinate space | yes | All | yes |
+| `size` | { width: number, height: number } | Size (dimensions) of the cropped image | yes | All | yes |
+| `displaySize` | { width: number, height: number } | Size to which you want to scale the cropped image | no | All | yes |
+| `resizeMode` | 'contain' \| 'cover' \| 'stretch' | Resizing mode to use when scaling the image**Default value**: `'cover'` | no | All | yes |
| `quality` | number | A value in range `0.0` - `1.0` specifying compression level of the result image. `1` means no compression (highest quality) and `0` the highest compression (lowest quality) **Default value**: `0.9` | no | All | yes |
-| `format` | 'jpeg' \| 'png' \| 'webp' | The format of the resulting image. **Default value**: based on the provided image; if value determination is not possible, `'jpeg'` will be used as a fallback. | no | All | yes |
+| `format` | 'jpeg' \| 'png' \| 'webp' | The format of the resulting image. **Default value**: based on the provided image; if value determination is not possible, `'jpeg'` will be used as a fallback. | no | All | yes |
-##
+##
## 遗留问题
@@ -165,4 +147,3 @@ cropData
## 开源协议
本项目基于 [ [The MIT License (MIT)]](https://github.com/callstack/react-native-image-editor/blob/master/LICENSE) ,请自由地享受和参与开源。
-
diff --git a/zh-cn/react-native-image-picker.md b/zh-cn/react-native-image-picker.md
index 4cb5f5c6afec0b8026fead4c05ae170d4c8b10e4..75852971c6c381ba2c253549a28ad58983af16f0 100644
--- a/zh-cn/react-native-image-picker.md
+++ b/zh-cn/react-native-image-picker.md
@@ -113,24 +113,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-image-picker": "file:../../node_modules/@react-native-oh-tpl/react-native-image-picker/harmony/image_picker"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 ImagePickerViewPackage
diff --git a/zh-cn/react-native-image-sequence-2.md b/zh-cn/react-native-image-sequence-2.md
index 1b836d62f39caf1b2ed45bf9d6d190c3ac0e185c..7697fe418abfcb0499f82cf1a6b3082f814472af 100644
--- a/zh-cn/react-native-image-sequence-2.md
+++ b/zh-cn/react-native-image-sequence-2.md
@@ -46,7 +46,7 @@ import TestDemo2 from "./TestDemo2";
const images = [
{ uri: "https://octodex.github.com/images/stormtroopocat.jpg" },
- {uri: 'https://octodex.github.com/images/saint_nictocat.jpg'},
+ { uri: "https://octodex.github.com/images/saint_nictocat.jpg" },
require("./assets/2.jpg"),
require("./assets/3.jpg"),
require("./assets/4.jpg"),
@@ -173,12 +173,22 @@ const ImageSequenceDemo = (props: any) => {
keyboardType="numeric"
/>
- 采样宽度/高度:
-
- inputSampleWidth(value)} defaultValue='-1' keyboardType='default' />
- inputSampleHeight(value)} defaultValue='-1' keyboardType='default' />
-
-
+ 采样宽度/高度:
+
+ inputSampleWidth(value)}
+ defaultValue="-1"
+ keyboardType="default"
+ />
+ inputSampleHeight(value)}
+ defaultValue="-1"
+ keyboardType="default"
+ />
+
+
{!isShow ? (
buttonIsShow()} />
@@ -276,7 +286,7 @@ export default TestDemo2
首先需要使用 DevEco Studio 打开项目里的鸿蒙工程 `harmony`
-### 在工程根目录的 `oh-package.json` 添加 overrides 字段
+### 在工程根目录的 `oh-package.json` 添加 overrides 字段
```
{
@@ -318,38 +328,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-把`tester/node_modules/@react-native-oh-tpl/react-native-image-sequence-2/harmony/`目录下的源码image_sequence复制到`harmony`工程根目录下
-
-在`harmony`工程根目录的 `build-profile.template.json5`(若存在)和`build-profile.json5` 添加以下模块
-
-```
-modules:[
- ...
- {
- name: 'image_sequence',
- srcPath: './image_sequence',
- }
-]
-```
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-image-sequence": "file:../image_sequence"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 ImageSequencePackage
diff --git a/zh-cn/react-native-linear-gradient.md b/zh-cn/react-native-linear-gradient.md
index 3e86688460c5b73e4e19df13e0558d0cdcfdd525..fead4a9801073aef68b4f309cd0a5fc9569932ae 100644
--- a/zh-cn/react-native-linear-gradient.md
+++ b/zh-cn/react-native-linear-gradient.md
@@ -43,7 +43,7 @@ yarn add @react-native-oh-tpl/react-native-linear-gradient@file:#
> [!WARNING] 使用时 import 的库名不变。
```js
-import React, { ReactNode } from 'react';
+import React, { ReactNode } from "react";
import {
SafeAreaView,
ScrollView,
@@ -51,19 +51,20 @@ import {
StyleSheet,
Text,
View,
-} from 'react-native';
+} from "react-native";
import LinearGradient from "react-native-linear-gradient";
// Within your render function
export const App = () => {
return (
-
- Sign in with Facebook
- ;
+
+ Sign in with Facebook
+
+ ;
);
};
@@ -125,24 +126,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-linear-gradient": "file:../../node_modules/@react-native-oh-tpl/react-native-linear-gradient/harmony/linear_gradient"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 LinearGradientPackage
diff --git a/zh-cn/react-native-maps.md b/zh-cn/react-native-maps.md
index 49bfeadd593032a4ac168934582e6478fa799748..7437c7b1e044fb0c3c20608f543029cfa593de2e 100644
--- a/zh-cn/react-native-maps.md
+++ b/zh-cn/react-native-maps.md
@@ -43,14 +43,14 @@ yarn add @react-native-oh-tpl/react-native-maps@file:#
> [!WARNING] 使用时 import 的库名不变。
```js
-import React from 'react';
-import {StyleSheet, View, Text, Dimensions} from 'react-native';
+import React from "react";
+import { StyleSheet, View, Text, Dimensions } from "react-native";
-import MapView, {Circle, Polygon, Polyline} from 'react-native-maps';
-import flagBlueImg from './assets/flag-blue.png';
-import flagPinkImg from './assets/flag-pink.png';
+import MapView, { Circle, Polygon, Polyline } from "react-native-maps";
+import flagBlueImg from "./assets/flag-blue.png";
+import flagPinkImg from "./assets/flag-pink.png";
-const {width, height} = Dimensions.get('window');
+const { width, height } = Dimensions.get("window");
const ASPECT_RATIO = width / height;
const LATITUDE = 39.9;
@@ -64,7 +64,7 @@ class Overlays extends React.Component {
super(props);
this.state = {
- marker1: true,
+ marker1: true,
region: {
latitude: LATITUDE,
longitude: LONGITUDE,
@@ -114,21 +114,22 @@ class Overlays extends React.Component {
}
render() {
- const {region, circle, polygon, polyline} = this.state;
+ const { region, circle, polygon, polyline } = this.state;
return (
+ initialRegion={region}
+ >
this.setState({marker1: !this.state.marker1})}
+ onPress={() => this.setState({ marker1: !this.state.marker1 })}
coordinate={{
latitude: LATITUDE + SPACE,
longitude: LONGITUDE - SPACE,
}}
- centerOffset={{x: -42, y: -60}}
- anchor={{x: 0.84, y: 1}}
+ centerOffset={{ x: -42, y: -60 }}
+ anchor={{ x: 0.84, y: 1 }}
opacity={0.6}
image={this.state.marker1 ? flagBlueImg : flagPinkImg}
/>
@@ -166,33 +167,33 @@ class Overlays extends React.Component {
const styles = StyleSheet.create({
container: {
...StyleSheet.absoluteFillObject,
- justifyContent: 'flex-end',
- alignItems: 'center',
+ justifyContent: "flex-end",
+ alignItems: "center",
},
map: {
...StyleSheet.absoluteFillObject,
},
bubble: {
flex: 1,
- backgroundColor: 'rgba(255,255,255,0.7)',
+ backgroundColor: "rgba(255,255,255,0.7)",
paddingHorizontal: 18,
paddingVertical: 12,
borderRadius: 20,
},
latlng: {
width: 200,
- alignItems: 'stretch',
+ alignItems: "stretch",
},
button: {
width: 80,
paddingHorizontal: 12,
- alignItems: 'center',
+ alignItems: "center",
marginHorizontal: 10,
},
buttonContainer: {
- flexDirection: 'row',
+ flexDirection: "row",
marginVertical: 20,
- backgroundColor: 'transparent',
+ backgroundColor: "transparent",
},
});
```
@@ -235,24 +236,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-maps": "file:../../node_modules/@react-native-oh-tpl/react-native-maps/harmony/maps"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 MapsPackge
@@ -302,7 +286,7 @@ std::vector> PackageProvider::getPackages(Package::Cont
}
```
-### 在 ArkTs 侧引入 AIRMap等 组件
+### 在 ArkTs 侧引入 AIRMap 等 组件
找到 **function buildCustomComponent()**,一般位于 `entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets`,添加:
@@ -503,7 +487,7 @@ ohpm install
]
```
-3.打开 `工程目录/build-profile.json5` 在app节点下修改
+3.打开 `工程目录/build-profile.json5` 在 app 节点下修改
```
signingConfigs: [
@@ -581,7 +565,7 @@ ohpm install
| isAccessibilityElement | Determines whether the MapView captures VoiceOver touches or forwards them to children. When `true`, map markers are not visible to VoiceOver. **Note:** iOS Maps only. | Boolean | false | no | ios | no |
| cameraZoomRange | Map camera distance limits. `minCenterCoordinateDistance` for minimum distance, `maxCenterCoordinateDistance` for maximum, `animated` for animated zoom range changes. Takes precedence if conflicting with `minZoomLevel`, `maxZoomLevel`. **Note**: iOS 13.0+ only. | cameraZoomRange | | no | ios | no |
-注:HarmonyOS侧的mapType支持以下字符串值
+注:HarmonyOS 侧的 mapType 支持以下字符串值
'none' \ 'standard' \ 'terrain'
@@ -681,7 +665,7 @@ ohpm install
| lineDashPattern | An array of numbers specifying the dash pattern to use for the path. The array contains one or more numbers that indicate the lengths (measured in points) of the line segments and gaps in the pattern. The values in the array alternate, starting with the first line segment length, followed by the first gap length, followed by the second line segment length, and so on. | Array | | no | ios/android | yes |
| tappable | Boolean to allow a polyline to be tappable and use the onPress function. | Bool | | no | ios/android | yes |
-注:HarmonyOS侧的lineJoin支持以下字符串值
+注:HarmonyOS 侧的 lineJoin 支持以下字符串值
'default' \ 'bevel' \ 'round'
@@ -709,7 +693,7 @@ ohpm install
| tappable | Boolean to allow a polygon to be tappable and use the onPress function. | Bool | false | no | ios/android | yes |
| zIndex | (Android Only) The order in which this polygon overlay is drawn with respect to other overlays. An overlay with a larger z-index is drawn over overlays with smaller z-indices. The order of overlays with the same z-index is arbitrary. The default zIndex is 0. | Number | 0 | no | ios/android | yes |
-注:HarmonyOS侧的lineJoin支持以下字符串值
+注:HarmonyOS 侧的 lineJoin 支持以下字符串值
'default' \ 'bevel' \ 'round'
@@ -850,9 +834,9 @@ ohpm install
## 遗留问题
- [ ] AIRMap 和 AIRMapMarker 中 Animated 未实现 [issues#1](https://github.com/react-native-oh-library/react-native-maps/issues/1)
-- [ ] AIRMapOverlay 组件目前华为地图中不支持往地图组件中添加自定义view [issues#2](https://github.com/react-native-oh-library/react-native-maps/issues/2)
-- [ ] AIRMap AIRMapMarker AIRMapPolyline AIRMapPolygon AIRMapCircle 组件在HarmonyOS中的不支持属性是因为华为地图没提供对应的属性 [issues#3](https://github.com/react-native-oh-library/react-native-maps/issues/3)
-- [ ] AIRMapCallout AIRMapCalloutSubview 组件为 marker 子组件,华为地图中marker有自带的,但是目前不支持自定义样式显示 [issues#4](https://github.com/react-native-oh-library/react-native-maps/issues/4)
+- [ ] AIRMapOverlay 组件目前华为地图中不支持往地图组件中添加自定义 view [issues#2](https://github.com/react-native-oh-library/react-native-maps/issues/2)
+- [ ] AIRMap AIRMapMarker AIRMapPolyline AIRMapPolygon AIRMapCircle 组件在 HarmonyOS 中的不支持属性是因为华为地图没提供对应的属性 [issues#3](https://github.com/react-native-oh-library/react-native-maps/issues/3)
+- [ ] AIRMapCallout AIRMapCalloutSubview 组件为 marker 子组件,华为地图中 marker 有自带的,但是目前不支持自定义样式显示 [issues#4](https://github.com/react-native-oh-library/react-native-maps/issues/4)
- [ ] AIRMapUrlTile AIRMapWMSTile 瓦片地图加载方式华为地图不支持 [issues#5](https://github.com/react-native-oh-library/react-native-maps/issues/5)
- [ ] Heatmap 华为地图不支持 [issues#6](https://github.com/react-native-oh-library/react-native-maps/issues/6)
diff --git a/zh-cn/react-native-masked-view-masked-view.md b/zh-cn/react-native-masked-view-masked-view.md
index e99a9d430caec071ac9f1820e523aefdb912c999..b946432c183d23e11c25db09246d23710321dbbe 100644
--- a/zh-cn/react-native-masked-view-masked-view.md
+++ b/zh-cn/react-native-masked-view-masked-view.md
@@ -115,24 +115,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-masked-view": "file:../../node_modules/@react-native-oh-tpl/masked-view/harmony/masked_view"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 MaskedPackage
diff --git a/zh-cn/react-native-pager-view.md b/zh-cn/react-native-pager-view.md
index 191462eff89bfd2983714796179b8e283a10cddf..972e097ea9e954ad30541e57bf66e66153046505 100644
--- a/zh-cn/react-native-pager-view.md
+++ b/zh-cn/react-native-pager-view.md
@@ -105,24 +105,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-pager-view": "file:../../node_modules/@react-native-oh-tpl/react-native-pager-view/harmony/pager_view"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 ViewPagerPackage
diff --git a/zh-cn/react-native-pdf.md b/zh-cn/react-native-pdf.md
index a93c447d6900e45e8177642129ca1a586e34b837..e6da717cde1b41f410df90bfc00da1d608ca1ade 100644
--- a/zh-cn/react-native-pdf.md
+++ b/zh-cn/react-native-pdf.md
@@ -123,24 +123,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-pdf-view": "file:../../node_modules/@react-native-oh-tpl/react-native-pdf/harmony/pdfview"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 PdfViewPackage
@@ -190,7 +173,7 @@ std::vector> PackageProvider::getPackages(Package::Cont
}
```
-### 在 ArkTs 侧引入 RTNPdfView组件
+### 在 ArkTs 侧引入 RTNPdfView 组件
找到 **function buildCustomComponent()**,一般位于 `entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets`,添加:
@@ -311,7 +294,7 @@ ohpm install
## 遗留问题
-PDF处理能力持续完善中,敬请期待。
+PDF 处理能力持续完善中,敬请期待。
## 其他
diff --git a/zh-cn/react-native-permissions.md b/zh-cn/react-native-permissions.md
index 6c294bdd87a8c1f67ad2f9cf6ade77e6179d907d..66589731ea28a34c5019fde7b9489c1255efe81e 100644
--- a/zh-cn/react-native-permissions.md
+++ b/zh-cn/react-native-permissions.md
@@ -41,66 +41,76 @@ yarn add @react-native-oh-tpl/react-native-permissions@file:#
> [!WARNING] 使用时 import 的库名不变。
```js
-import { ScrollView, StyleSheet, View, Text, Button } from 'react-native';
-import React from 'react';
-import RTNPermissions, { Permission } from 'react-native-permissions';
+import { ScrollView, StyleSheet, View, Text, Button } from "react-native";
+import React from "react";
+import RTNPermissions, { Permission } from "react-native-permissions";
const permissionNormal: Permission[] = [
- 'ohos.permission.APPROXIMATELY_LOCATION',
- 'ohos.permission.CAMERA',
- 'ohos.permission.MICROPHONE',
- 'ohos.permission.READ_CALENDAR',
- 'ohos.permission.WRITE_CALENDAR',
- 'ohos.permission.ACTIVITY_MOTION',
- 'ohos.permission.READ_HEALTH_DATA',
- 'ohos.permission.DISTRIBUTED_DATASYNC',
- 'ohos.permission.READ_MEDIA',
- 'ohos.permission.MEDIA_LOCATION',
- 'ohos.permission.ACCESS_BLUETOOTH',
-]
+ "ohos.permission.APPROXIMATELY_LOCATION",
+ "ohos.permission.CAMERA",
+ "ohos.permission.MICROPHONE",
+ "ohos.permission.READ_CALENDAR",
+ "ohos.permission.WRITE_CALENDAR",
+ "ohos.permission.ACTIVITY_MOTION",
+ "ohos.permission.READ_HEALTH_DATA",
+ "ohos.permission.DISTRIBUTED_DATASYNC",
+ "ohos.permission.READ_MEDIA",
+ "ohos.permission.MEDIA_LOCATION",
+ "ohos.permission.ACCESS_BLUETOOTH",
+];
export function PermissionsExample() {
- return (
-
- {
- let check = await RTNPermissions.check('ohos.permission.CAMERA');
- console.info('RTNPermissions===== check', check);
- }} />
- {
- let request = await RTNPermissions.request('ohos.permission.CAMERA');
- console.info('RTNPermissions===== request', request);
- }} />
- {
- let checkMultiple = await RTNPermissions.checkMultiple(permissionNormal);
- console.info('RTNPermissions===== checkMultiple', checkMultiple);
- }} />
- {
- let requestMultiple = await RTNPermissions.requestMultiple(permissionNormal);
- console.info('RTNPermissions===== requestMultiple', requestMultiple);
- }} />
-
- );
+ return (
+
+ {
+ let check = await RTNPermissions.check("ohos.permission.CAMERA");
+ console.info("RTNPermissions===== check", check);
+ }}
+ />
+ {
+ let request = await RTNPermissions.request("ohos.permission.CAMERA");
+ console.info("RTNPermissions===== request", request);
+ }}
+ />
+ {
+ let checkMultiple = await RTNPermissions.checkMultiple(
+ permissionNormal
+ );
+ console.info("RTNPermissions===== checkMultiple", checkMultiple);
+ }}
+ />
+ {
+ let requestMultiple = await RTNPermissions.requestMultiple(
+ permissionNormal
+ );
+ console.info("RTNPermissions===== requestMultiple", requestMultiple);
+ }}
+ />
+
+ );
}
const styles = StyleSheet.create({
- sectionContainer: {
- marginTop: 32,
- paddingHorizontal: 24,
- },
- view: {
- width: '100%',
- display: 'flex',
- flexDirection: 'row',
- justifyContent: 'space-evenly',
- flexWrap: 'wrap',
- margin: 5,
- }
+ sectionContainer: {
+ marginTop: 32,
+ paddingHorizontal: 24,
+ },
+ view: {
+ width: "100%",
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-evenly",
+ flexWrap: "wrap",
+ margin: 5,
+ },
});
```
@@ -142,24 +152,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "react-native-permissions": "file:../../node_modules/@react-native-oh-tpl/react-native-permissions/harmony/permissions"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 PermissionsPackage
@@ -301,7 +294,7 @@ ohpm install
### 权限要求
-需要在`entry/src/main/module.json5`中声明权限并创建reason string value。
+需要在`entry/src/main/module.json5`中声明权限并创建 reason string value。
```
"requestPermissions": [
@@ -328,7 +321,7 @@ ohpm install
]
```
-reason字段的内容写作规范及建议如下:
+reason 字段的内容写作规范及建议如下:
保持句子简洁、不要加入多余的分割符号。
@@ -347,17 +340,17 @@ reason字段的内容写作规范及建议如下:
根据权限对于不同等级应用有不同的开放范围,权限类型对应分为以下三种,等级依次提高。
-- **normal权限**
+- **normal 权限**
normal 权限允许应用访问超出默认规则外的普通系统资源。这些系统资源的开放(包括数据和功能)对用户隐私以及其他应用带来的风险很小。
- 该类型的权限仅向APL等级为normal及以上的应用开放。
+ 该类型的权限仅向 APL 等级为 normal 及以上的应用开放。
-- **system_basic权限**
+- **system_basic 权限**
- system_basic权限允许应用访问操作系统基础服务相关的资源。这部分系统基础服务属于系统提供或者预置的基础功能,比如系统设置、身份认证等。这些系统资源的开放对用户隐私以及其他应用带来的风险较大。
+ system_basic 权限允许应用访问操作系统基础服务相关的资源。这部分系统基础服务属于系统提供或者预置的基础功能,比如系统设置、身份认证等。这些系统资源的开放对用户隐私以及其他应用带来的风险较大。
- 该类型的权限仅向APL等级为system_basic及以上的应用开放。
+ 该类型的权限仅向 APL 等级为 system_basic 及以上的应用开放。
```
normal权限列表
@@ -406,24 +399,24 @@ ohos.permission.LOCATION_IN_BACKGROUND 允许应用在后台运行时获取设
申请流程:
通过弹窗申请前台位置权限。存在两种允许情况:
申请前台模糊位置权限:ohos.permission.APPROXIMATELY_LOCATION。
-申请前台精确位置权限:ohos.permission.APPROXIMATELY_LOCATION和ohos.permission.LOCATION。
+申请前台精确位置权限:ohos.permission.APPROXIMATELY_LOCATION 和 ohos.permission.LOCATION。
当用户点击弹窗授予前台位置权限后,应用通过弹窗、提示窗等形式告知用户前往设置界面授予后台位置权限。
用户在设置界面中的选择“始终允许”应用访问位置信息权限,完成手动授予。
## 方法
-| Name | Description | Platform | HarmonyOS Support |
-| ----------------------- | -------------------------- | ----------- | ----------------------- |
-| check | 检查单个权限 | ios,android | yes |
-| checkNotifications | 检查通知权限 | ios,android | yes |
-| openSettings | 打开设置页 | ios,android | yes |
-| request | 设置单个权限 | ios,android | yes |
-| requestNotifications | 设置通知权限 | ios,android | yes |
-| checkMultiple | 检查多个权限 | android | yes |
-| requestMultiple | 设置多个权限 | android | yes |
-| checkLocationAccuracy | 检查设备位置权限 | ios | no(使用check()查询权限) |
-| requestLocationAccuracy | 请求访问设备位置的权限 | ios | no(使用check()设置权限) |
-| openPhotoPicker | 请求访问设备本地图片的权限 | ios | no(使用check()设置权限) |
+| Name | Description | Platform | HarmonyOS Support |
+| ----------------------- | -------------------------- | ----------- | ------------------------ |
+| check | 检查单个权限 | ios,android | yes |
+| checkNotifications | 检查通知权限 | ios,android | yes |
+| openSettings | 打开设置页 | ios,android | yes |
+| request | 设置单个权限 | ios,android | yes |
+| requestNotifications | 设置通知权限 | ios,android | yes |
+| checkMultiple | 检查多个权限 | android | yes |
+| requestMultiple | 设置多个权限 | android | yes |
+| checkLocationAccuracy | 检查设备位置权限 | ios | no(使用 check()查询权限) |
+| requestLocationAccuracy | 请求访问设备位置的权限 | ios | no(使用 check()设置权限) |
+| openPhotoPicker | 请求访问设备本地图片的权限 | ios | no(使用 check()设置权限) |
## 遗留问题
diff --git a/zh-cn/react-native-picker-picker.md b/zh-cn/react-native-picker-picker.md
index 06eec254c669e4cc5c919c40a66ed260dad55f8a..aab9f5804e1d9326877f4bfbd2bbf307926e9242 100644
--- a/zh-cn/react-native-picker-picker.md
+++ b/zh-cn/react-native-picker-picker.md
@@ -94,24 +94,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-picker": "file:../../node_modules/@react-native-oh-tpl/picker/harmony/picker"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 PickerPackge
diff --git a/zh-cn/react-native-reanimated.md b/zh-cn/react-native-reanimated.md
index 17dee23f651dc509cc9ae183d8f99ec1f790fc87..f1d639f915ed79ee1126df3bae6a0322a6ca153e 100644
--- a/zh-cn/react-native-reanimated.md
+++ b/zh-cn/react-native-reanimated.md
@@ -140,24 +140,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-reanimated": "file:../../node_modules/@react-native-oh-tpl/react-native-reanimated/harmony/reanimated"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 ReanimatedPackage
@@ -256,22 +239,21 @@ ohpm install
> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ----------------- | -------------------------| -------- | -------- | -------- | ----------------- |
-| `withTiming` | withTiming lets you create an animation based on duration and easing.. | function | No | All | yes |
-| `withSpring` | withSpring lets you create spring-based animations. | function | No | All | yes |
-| `withDecay` | withDecay lets you create animations that mimic objects in motion with friction. The animation will start with the provided velocity and slow down over time according to the given deceleration rate until it stops. | function | No | All | yes |
-| `withRepeat` | withRepeat is an animation modifier that lets you repeat an animation given number of times or run it indefinitely. | function | No | All | yes |
-| `useSharedValue` | useSharedValue lets you define shared values in your components.| function | No | All | yes |
-| `useAnimatedStyle` | useAnimatedStyle lets you create a styles object, similar to StyleSheet styles, which can be animated using shared values.| function | No | All | yes |
-| `useAnimatedRef` | useAnimatedRef lets you get a reference of a view. Used alongside measure, scrollTo, and useScrollViewOffset functions.| function | No | All | yes |
-| `useDerivedValue` | useDerivedValue lets you create new shared values based on existing ones while keeping them reactive.| function | No | All | yes |
-| `cancelAnimation` | cancelAnimation lets you cancel a running animation paired to a shared value.| function | No | All | yes |
-| `runOnJS` | runOnJS lets you asynchronously run non-workletized functions that could not otherwise run on the UI thread. This applies to most external libraries as they do not have their functions marked with "worklet"; directive.| function | No | All | yes |
-| `runOnUI` | runOnUI lets you asynchronously run workletized functions on the UI thread.| function | No | All | yes |
-| `measure` | measure lets you synchronously get the dimensions and position of a view on the screen, all on the UI thread.| function | No | All | yes |
-| `Easing` | easing set motion trajectory| function | No | All | yes |
-
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | -------- | ----------------- |
+| `withTiming` | withTiming lets you create an animation based on duration and easing.. | function | No | All | yes |
+| `withSpring` | withSpring lets you create spring-based animations. | function | No | All | yes |
+| `withDecay` | withDecay lets you create animations that mimic objects in motion with friction. The animation will start with the provided velocity and slow down over time according to the given deceleration rate until it stops. | function | No | All | yes |
+| `withRepeat` | withRepeat is an animation modifier that lets you repeat an animation given number of times or run it indefinitely. | function | No | All | yes |
+| `useSharedValue` | useSharedValue lets you define shared values in your components. | function | No | All | yes |
+| `useAnimatedStyle` | useAnimatedStyle lets you create a styles object, similar to StyleSheet styles, which can be animated using shared values. | function | No | All | yes |
+| `useAnimatedRef` | useAnimatedRef lets you get a reference of a view. Used alongside measure, scrollTo, and useScrollViewOffset functions. | function | No | All | yes |
+| `useDerivedValue` | useDerivedValue lets you create new shared values based on existing ones while keeping them reactive. | function | No | All | yes |
+| `cancelAnimation` | cancelAnimation lets you cancel a running animation paired to a shared value. | function | No | All | yes |
+| `runOnJS` | runOnJS lets you asynchronously run non-workletized functions that could not otherwise run on the UI thread. This applies to most external libraries as they do not have their functions marked with "worklet"; directive. | function | No | All | yes |
+| `runOnUI` | runOnUI lets you asynchronously run workletized functions on the UI thread. | function | No | All | yes |
+| `measure` | measure lets you synchronously get the dimensions and position of a view on the screen, all on the UI thread. | function | No | All | yes |
+| `Easing` | easing set motion trajectory | function | No | All | yes |
## 遗留问题
@@ -279,4 +261,4 @@ ohpm install
## 开源协议
-本项目基于 [The MIT License (MIT)](https://github.com/software-mansion/react-native-reanimated/blob/main/LICENSE) ,请自由地享受和参与开源。
\ No newline at end of file
+本项目基于 [The MIT License (MIT)](https://github.com/software-mansion/react-native-reanimated/blob/main/LICENSE) ,请自由地享受和参与开源。
diff --git a/zh-cn/react-native-safe-area-context.md b/zh-cn/react-native-safe-area-context.md
index a0b6a340da734d761b9d28db0aad6d0d9f4ecc05..d08b345226a652382d87436aff395f07b6337eca 100644
--- a/zh-cn/react-native-safe-area-context.md
+++ b/zh-cn/react-native-safe-area-context.md
@@ -104,24 +104,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-safe-area": "file:../../node_modules/@react-native-oh-tpl/react-native-safe-area-context/harmony/safe_area"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 SafeAreaViewPackage
diff --git a/zh-cn/react-native-sensors.md b/zh-cn/react-native-sensors.md
index 7a65c6b48162553e23bf427a9c1d457f1643c2eb..65471751bc5e858d0fe2ef970ad5f8ef8db7c891 100644
--- a/zh-cn/react-native-sensors.md
+++ b/zh-cn/react-native-sensors.md
@@ -84,7 +84,6 @@ gravity.subscribe(({ x, y, z, timestamp }) =>
);
// setUpdateIntervalForType(type: string, interval: number)
setUpdateIntervalForType(SensorTypes.accelerometer, 100);
-
```
## Link
@@ -93,7 +92,7 @@ setUpdateIntervalForType(SensorTypes.accelerometer, 100);
首先需要使用 DevEco Studio 打开项目里的鸿蒙工程 `harmony`
-### 在工程根目录的 `oh-package.json` 添加 overrides字段
+### 在工程根目录的 `oh-package.json` 添加 overrides 字段
```json
{
@@ -135,27 +134,9 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
-在 `harmony` 文件夹下新建 `sensors` 模块,把源库中react-native-sensors/harmony/sensors目录下代码copy到 `sensors`模块下面
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
- "@react-native-oh-tpl/react-native-sensors": "file:../sensors"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
-
-### 配置 CMakeLists 和引入 SensorsPackage(codegen方式忽略此步骤)
+### 配置 CMakeLists 和引入 SensorsPackage(codegen 方式忽略此步骤)
打开 `entry/src/main/cpp/CMakeLists.txt`,添加:
@@ -251,17 +232,17 @@ ohpm install
请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-sensors Releases](https://github.com/react-native-oh-library/react-native-sensors/releases)
-
本文档内容基于以下版本验证通过:
1. RNOH:0.72.20; SDK:HarmonyOS NEXT Developer Preview2; IDE:DevEco Studio 5.0.3.200; ROM:205.0.0.18;
### 权限要求
-在module.json5中配置所需要的权限
-accelerometer需要的权限:ohos.permission.ACCELEROMETER
+在 module.json5 中配置所需要的权限
+
+accelerometer 需要的权限:ohos.permission.ACCELEROMETER
-gyroscope需要的权限:ohos.permission.GYROSCOPE
+gyroscope 需要的权限:ohos.permission.GYROSCOPE
## API
@@ -269,16 +250,16 @@ gyroscope需要的权限:ohos.permission.GYROSCOPE
> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ---- | ----------- | ---- | -------- | -------- | ------------------ |
-| accelerometer | 加速度计 | Observable | no | ios/Android | yes |
-| gyroscope | 陀螺仪 | Observable | no | ios/Android | yes |
-| magnetometer | 磁力计 | Observable | no | ios/Android | yes |
-| barometer | 气压计 | Observable | no | ios/Android | yes |
-| orientation | 方向 | Observable | no | ios/Android | yes |
-| gravity | 重力 | Observable | no | ios/Android | yes |
-| setUpdateIntervalForType | 间隔时间 | function | no | ios/Android | yes |
-| setLogLevelForType | 日志打印级别 | function | no | ios/Android | yes |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ------------------------ | ------------ | ---------- | -------- | ----------- | ----------------- |
+| accelerometer | 加速度计 | Observable | no | ios/Android | yes |
+| gyroscope | 陀螺仪 | Observable | no | ios/Android | yes |
+| magnetometer | 磁力计 | Observable | no | ios/Android | yes |
+| barometer | 气压计 | Observable | no | ios/Android | yes |
+| orientation | 方向 | Observable | no | ios/Android | yes |
+| gravity | 重力 | Observable | no | ios/Android | yes |
+| setUpdateIntervalForType | 间隔时间 | function | no | ios/Android | yes |
+| setLogLevelForType | 日志打印级别 | function | no | ios/Android | yes |
## 遗留问题
@@ -286,4 +267,4 @@ gyroscope需要的权限:ohos.permission.GYROSCOPE
## 开源协议
-本项目基于 [The MIT License (MIT)](https://github.com/react-native-oh-library/react-native-sensors/blob/sig/LICENSE) ,请自由地享受和参与开源。
\ No newline at end of file
+本项目基于 [The MIT License (MIT)](https://github.com/react-native-oh-library/react-native-sensors/blob/sig/LICENSE) ,请自由地享受和参与开源。
diff --git a/zh-cn/react-native-sound.md b/zh-cn/react-native-sound.md
index df1488e9f6bf79350e9dce2e4c5a37c9be94dcd7..2d74fef65db91a8da083ec41828d543f66ae209a 100644
--- a/zh-cn/react-native-sound.md
+++ b/zh-cn/react-native-sound.md
@@ -194,24 +194,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-sound": "file:../../node_modules/@react-native-oh-tpl/react-native-sound/harmony/sound"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 SoundPackge
diff --git a/zh-cn/react-native-svg.md b/zh-cn/react-native-svg.md
index b8967458c5d87e560b976a5b707f423992c0afb9..2891d2c55df85e7b92b09e49556b8d25045d6a52 100644
--- a/zh-cn/react-native-svg.md
+++ b/zh-cn/react-native-svg.md
@@ -99,38 +99,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-把 `tester/node_modules/@react-native-oh-tpl/react-native-svg/harmony/` 目录下的源码 `svg` 复制到 `harmony` 工程根目录下
-
-在`harmony`工程根目录的 `build-profile.template.json5(若有)` 和 `build-profile.json5` 添加以下模块
-
-```json
-modules:[
- ...
- {
- name: 'svg',
- srcPath: './svg',
- }
-]
-```
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "@react-native-oh-tpl/svg": "file:../svg"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 SVGPackage
diff --git a/zh-cn/react-native-text-size.md b/zh-cn/react-native-text-size.md
index 9ba070d4a5a978090684bfc118eb17762daa0814..962231885fc45a6d4cfd3078f2a2ec1be742428d 100644
--- a/zh-cn/react-native-text-size.md
+++ b/zh-cn/react-native-text-size.md
@@ -227,24 +227,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-text-size": "file:../../node_modules/@react-native-oh-tpl/react-native-text-size/harmony/text_size"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 RNTextSizePackage
@@ -363,14 +346,14 @@ Plain JS object with this properties (only `text` is required):
This parameter is a subset of **TSMeasureParams**, so the details are omitted here.
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ------------- | ------------ | --------------------- | -------- | ----------- | ----------------- |
-| fontFamily | System Name | string | No | IOS/Android | yes |
-| fontWeight | Font Weight | number | No | IOS/Android | yes |
-| fontSize | Font Size | TSFontStyle | No | IOS/Android | yes |
-| fontStyle | Font Style | TSFontWeight | No | IOS/Android | yes |
-| fontVariant | Font Variant | TSFontVariant[]或null | No | IOS/Android | yes |
-| letterSpacing | Font spacing | number | No | IOS/Android | yes |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ------------- | ------------ | ---------------------- | -------- | ----------- | ----------------- |
+| fontFamily | System Name | string | No | IOS/Android | yes |
+| fontWeight | Font Weight | number | No | IOS/Android | yes |
+| fontSize | Font Size | TSFontStyle | No | IOS/Android | yes |
+| fontStyle | Font Style | TSFontWeight | No | IOS/Android | yes |
+| fontVariant | Font Variant | TSFontVariant[]或 null | No | IOS/Android | yes |
+| letterSpacing | Font spacing | number | No | IOS/Android | yes |
**TSHeightsParams**
@@ -407,7 +390,7 @@ This is an object similar to the one you pass to `measure`, but the `text` optio
## 遗留问题
-- [ ] fontFamilyNames&fontNamesForFamilyName问题:需要依赖手机文件font目录下的json文件,该文件目前没有预置在手机目录下,会导致该接口调用为空。后续底层框架侧修复该问题 [issue#1](https://github.com/react-native-oh-library/react-native-text-size/issues/1)
+- [ ] fontFamilyNames&fontNamesForFamilyName 问题:需要依赖手机文件 font 目录下的 json 文件,该文件目前没有预置在手机目录下,会导致该接口调用为空。后续底层框架侧修复该问题 [issue#1](https://github.com/react-native-oh-library/react-native-text-size/issues/1)
## 其他
diff --git a/zh-cn/react-native-toolbar-android.md b/zh-cn/react-native-toolbar-android.md
index a87f2abcc4261fb4037072e77ee6257f8953b70c..b5f9e2357058892ab501528ec622234ad39a12c8 100644
--- a/zh-cn/react-native-toolbar-android.md
+++ b/zh-cn/react-native-toolbar-android.md
@@ -157,24 +157,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-toolbar-android": "file:../../node_modules/@react-native-oh-tpl/toolbar-android/harmony/toolbar_android"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 ToolbarAndroidPackage
@@ -224,7 +207,7 @@ std::vector> PackageProvider::getPackages(Package::Cont
}
```
-### 在 ArkTs 侧引入 RNCToolbarAndroid组件
+### 在 ArkTs 侧引入 RNCToolbarAndroid 组件
找到 **function buildCustomComponent()**,一般位于 `entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets`,添加:
diff --git a/zh-cn/react-native-video.md b/zh-cn/react-native-video.md
index bb15197afe7f0eb9ebfe6693a70b0e0ba19238fa..e7aa9b8158cef823566a43f0928e6f0a6034654d 100644
--- a/zh-cn/react-native-video.md
+++ b/zh-cn/react-native-video.md
@@ -53,7 +53,7 @@ function RNCVideoDemo() {
const [repeat, setRepeat] = useState(true);
const [disableFocus, setDisableFocus] = useState(false);
const [uri, setUri] = useState(
- "https://res.vmallres.com//uomcdn/CN/cms/202210/C75C7E20060F3E909F2998E13C3ABC03.mp4",
+ "https://res.vmallres.com//uomcdn/CN/cms/202210/C75C7E20060F3E909F2998E13C3ABC03.mp4"
);
const [txt, setTxt] = useState("empty");
const [resizeMode, setResizeMode] = useState("none");
@@ -97,7 +97,7 @@ function RNCVideoDemo() {
// setUri((prevRepeat) => 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4');
setUri(
(prevRepeat) =>
- "https://res.vmallres.com//uomcdn/CN/cms/202210/C75C7E20060F3E909F2998E13C3ABC03.mp4",
+ "https://res.vmallres.com//uomcdn/CN/cms/202210/C75C7E20060F3E909F2998E13C3ABC03.mp4"
);
};
@@ -129,7 +129,7 @@ function RNCVideoDemo() {
style={{ backgroundColor: "blue", flex: 0.25 }}
onPress={() => {
setUri(
- "https://res.vmallres.com//uomcdn/CN/cms/202210/C75C7E20060F3E909F2998E13C3ABC03.mp4",
+ "https://res.vmallres.com//uomcdn/CN/cms/202210/C75C7E20060F3E909F2998E13C3ABC03.mp4"
);
setPosterResizeMode("stretch");
}}
@@ -287,7 +287,7 @@ function RNCVideoDemo() {
"s width =" +
e.naturalSize.width +
" orientation =" +
- e.naturalSize.orientation,
+ e.naturalSize.orientation
);
setOnVideoError("onVideoError error = ok");
}}
@@ -298,7 +298,7 @@ function RNCVideoDemo() {
" type=" +
e.type +
" uri=" +
- e.uri,
+ e.uri
);
}}
onProgress={(e) => {
@@ -308,7 +308,7 @@ function RNCVideoDemo() {
" playableDuration=" +
e.playableDuration +
" seekableDuration=" +
- e.seekableDuration,
+ e.seekableDuration
);
}}
onError={(e) => {
@@ -438,24 +438,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-video": "file:../../node_modules/@react-native-oh-tpl/react-native-video/harmony/rn_video"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 RNCVideoPackage
diff --git a/zh-cn/react-native-view-shot.md b/zh-cn/react-native-view-shot.md
index f44912279d7ee526dbc72914dbfce6fafa9592d7..8e77076dcebd3672dfb47ceac75b498fee3e2043 100644
--- a/zh-cn/react-native-view-shot.md
+++ b/zh-cn/react-native-view-shot.md
@@ -154,24 +154,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-view-shot": "file:../../node_modules/@react-native-oh-tpl/react-native-view-shot/harmony/view_shot"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 ViewShotPackage
diff --git a/zh-cn/react-native-webview.md b/zh-cn/react-native-webview.md
index 35f7cda28c8a1c5f1dd6188bd4ec98f208dfb6c3..154d71fddc9bec1b3bbe7efdd6a1efb0b5d66510 100644
--- a/zh-cn/react-native-webview.md
+++ b/zh-cn/react-native-webview.md
@@ -86,24 +86,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-webview": "file:../../node_modules/@react-native-oh-tpl/react-native-webview/harmony/rn_webview"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 WebViewPackage
@@ -260,4 +243,4 @@ ohpm install
## 开源协议
本项目基于 [The MIT License (MIT)](https://github.com/react-native-webview/react-native-webview/blob/master/LICENSE) ,请自由地享受和参与开源。
-[react-native-vconsole.md](react-native-vconsole.md)
\ No newline at end of file
+[react-native-vconsole.md](react-native-vconsole.md)
diff --git a/zh-cn/react-native-worklets-core.md b/zh-cn/react-native-worklets-core.md
index de9eccfbd0d0defdd201d3e1137c72d2565b9630..f2aee31893fcd4e207988732abb28040ab9feaf5 100644
--- a/zh-cn/react-native-worklets-core.md
+++ b/zh-cn/react-native-worklets-core.md
@@ -90,25 +90,9 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```diff
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-+ "@react-native-oh-tpl/react-native-worklets-core": "file:../../node_modules/@react-native-oh-tpl/react-native-worklets-core/harmony/rn_worklets"
- }
-```
-
-打开终端,执行:
-
-```shell
-cd entry
-ohpm install --no-link
-```
-
-### 配置 CMakeLists 和引入Worklets
+### 配置 CMakeLists 和引入 Worklets
打开 `entry/src/main/cpp/CMakeLists.txt`,添加:
@@ -172,35 +156,39 @@ ohpm install
快速使用:
->[!WARNING] 使用时 import 的库名不变。
+> [!WARNING] 使用时 import 的库名不变。
```tsx
import { useState } from "react";
-import { Button, Text, View } from "react-native"
+import { Button, Text, View } from "react-native";
import { useRunOnJS, useWorklet } from "react-native-worklets-core";
const App = () => {
- // 计数器
- const [count, setCount] = useState(0);
- // 定义一个useRunJS方法
- const setCountRunInJS = useRunOnJS(() => {
- setCount(Math.random());
- }, [count])
- // 在worklets线程使用RunInJS方法
- const countInWorkLet = useWorklet('default', () => {
- 'worklet'
- setCountRunInJS();
- }, [setCountRunInJS])
-
- return (
-
-
- countInWorkLet()} />
-
- count:{count}
-
- )
-}
+ // 计数器
+ const [count, setCount] = useState(0);
+ // 定义一个useRunJS方法
+ const setCountRunInJS = useRunOnJS(() => {
+ setCount(Math.random());
+ }, [count]);
+ // 在worklets线程使用RunInJS方法
+ const countInWorkLet = useWorklet(
+ "default",
+ () => {
+ "worklet";
+ setCountRunInJS();
+ },
+ [setCountRunInJS]
+ );
+
+ return (
+
+
+ countInWorkLet()} />
+
+ count:{count}
+
+ );
+};
export default App;
```
@@ -208,6 +196,7 @@ export default App;
## 约束与限制
### 兼容性
+
本文档内容基于以下版本验证通过:
1. RNOH:0.72.20; SDK:HarmonyOS NEXT Developer Beta1; IDE:DevEco Studio 5.0.3.200; ROM:205.0.0.18;
@@ -216,19 +205,19 @@ export default App;
### API
-| NAME | Description | Required | Platform | HarmonyOS Support |
-| ---------------------- | ------------------------------------------------------------ | -------- | -------- | ----------------- |
-| createContext | Create a worker thread context object | YES | All | YES |
-| createSharedValue | Creates a new worklet context with the given name | YES | All | YES |
+| NAME | Description | Required | Platform | HarmonyOS Support |
+| ---------------------- | -------------------------------------------------------------------------------------- | -------- | -------- | ----------------- |
+| createContext | Create a worker thread context object | YES | All | YES |
+| createSharedValue | Creates a new worklet context with the given name | YES | All | YES |
| createRunOnJS | Creates a function that can be executed asynchronously on the default React-JS context | YES | All | YES |
-| runOnJS | Runs the given Function asynchronously on the default React-JS context | YES | All | YES |
-| getCurrentThreadId | Returns a unique identifier for the Thread this method is called on | YES | All | YES |
-| defaultContext | Get the default Worklet context | YES | All | YES |
-| context.createRunAsync | Creates a function that can be executed asynchronously on the Worklet context. | YES | All | YES |
-| context.runAsync | Runs the given Function asynchronously on this Worklet context. | YES | All | YES |
-| useWorklet | Same as `context.createRunAsync` | YES | All | YES |
-| useRunOnJS | Same as `createRunOnJS` | YES | All | YES |
-| useSharedValue | Same as `createSharedValue` | YES | All | YES |
+| runOnJS | Runs the given Function asynchronously on the default React-JS context | YES | All | YES |
+| getCurrentThreadId | Returns a unique identifier for the Thread this method is called on | YES | All | YES |
+| defaultContext | Get the default Worklet context | YES | All | YES |
+| context.createRunAsync | Creates a function that can be executed asynchronously on the Worklet context. | YES | All | YES |
+| context.runAsync | Runs the given Function asynchronously on this Worklet context. | YES | All | YES |
+| useWorklet | Same as `context.createRunAsync` | YES | All | YES |
+| useRunOnJS | Same as `createRunOnJS` | YES | All | YES |
+| useSharedValue | Same as `createSharedValue` | YES | All | YES |
## 遗留问题
diff --git a/zh-cn/shopify-flash-list.md b/zh-cn/shopify-flash-list.md
index 372c7dc14d35d2b3297543eed60bf8dfe1b01fde..1246f255dd51f2cc0141eafc8480b437715d76d3 100644
--- a/zh-cn/shopify-flash-list.md
+++ b/zh-cn/shopify-flash-list.md
@@ -105,24 +105,7 @@ ohpm install
方法二:直接链接源码
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
-
- "rnoh-flash-list": "file:../../node_modules/@react-native-oh-tpl/flash_list/harmony/flash_list"
- }
-```
-
-打开终端,执行:
-
-```bash
-cd entry
-ohpm install --no-link
-```
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
### 配置 CMakeLists 和引入 FlashListPackage
@@ -291,7 +274,7 @@ ohpm install
## 遗留问题
-- [ ] flash-list部分属性未实现鸿蒙化: [issue#I8QVS0](https://gitee.com/react-native-oh-library/usage-docs/issues/I8QVS0)
+- [ ] flash-list 部分属性未实现鸿蒙化: [issue#I8QVS0](https://gitee.com/react-native-oh-library/usage-docs/issues/I8QVS0)
## 开源协议