From 625cf1dd57de0a8cea11a8012d90362ba8a33546 Mon Sep 17 00:00:00 2001
From: lizhien52O
Date: Wed, 6 Nov 2024 16:08:46 +0800
Subject: [PATCH 1/5] docs: [Issues: #IB117J] react-native-size-matters.md
---
en/react-native-size-matters.md | 96 +++++++++++++++++----------------
1 file changed, 51 insertions(+), 45 deletions(-)
diff --git a/en/react-native-size-matters.md b/en/react-native-size-matters.md
index a06f9360..9573d8bb 100644
--- a/en/react-native-size-matters.md
+++ b/en/react-native-size-matters.md
@@ -1,4 +1,4 @@
-> 模板版本:v0.2.2
+> Template version: v0.2.2
react-native-size-matters
@@ -12,11 +12,11 @@
-> [!TIP] [Github 地址](https://github.com/nirsky/react-native-size-matters)
+> [!TIP] [GitHub address](https://github.com/nirsky/react-native-size-matters)
-## 安装与使用
+## Installation and Usage
-进入到工程目录并输入以下命令:
+Go to the project directory and execute the following instruction:
@@ -25,24 +25,25 @@
```bash
npm install react-native-size-matters@0.4.2
```
+
#### **yarn**
```bash
yarn add react-native-size-matters@0.4.2
```
+
-下面的代码展示了这个库的基本使用场景:
-> [!WARNING] 使用时 import 的库名不变。
+The following code shows the basic use scenario of the repository:
+
+> [!WARNING] The name of the imported repository remains unchanged.
**这里是该插件提供的基础用法**
```js
-
import { Text, View } from 'react-native';
import { scale, verticalScale, moderateScale, moderateVerticalScale } from 'react-native-size-matters';
-
import { s, vs, ms, mvs } from 'react-native-size-matters';
let scale = () =>{
@@ -55,7 +56,7 @@ let scale = () =>{
borderColor: 'red',
backgroundColor: 'blue'
}} >
- {scale(100}
+ {scale(100)}
)
}
@@ -70,7 +71,7 @@ let verticalScale = () =>{
borderColor: 'red',
backgroundColor: 'blue'
}} >
- {verticalScale(100}
+ {verticalScale(100)}
)
}
@@ -101,7 +102,7 @@ let moderateVerticalScale = ()=>{
borderColor: 'red',
backgroundColor: 'blue'
}} >
- {moderateVerticalScale(100}
+ {moderateVerticalScale(100)}
)
}
@@ -116,7 +117,7 @@ let s = () =>{
borderColor: 'red',
backgroundColor: 'blue'
}} >
- {s(100}
+ {s(100)}
)
}
@@ -131,7 +132,7 @@ let vs = () =>{
borderColor: 'red',
backgroundColor: 'blue'
}} >
- {vs(100}
+ {vs(100)}
)
}
@@ -162,7 +163,7 @@ let mvs = ()=>{
borderColor: 'red',
backgroundColor: 'blue'
}} >
- {mvs(100}
+ {mvs(100)}
)
}
@@ -185,60 +186,65 @@ export default class sizeMattersDemo {
}
```
+
**这里提供注解用法**
+
```javascript
-import { Text, View } from 'react-native';
-import { ScaledSheet } from 'react-native-size-matters';
+import { Text, View } from "react-native";
+import { ScaledSheet } from "react-native-size-matters";
const styles = ScaledSheet.create({
- container: {
- width: '100@s', // = scale(100)
- height: '200@vs', // = verticalScale(200)
- padding: '2@msr', // = Math.round(moderateScale(2))
- margin: 5
- }
+ container: {
+ width: "100@s", // = scale(100)
+ height: "200@vs", // = verticalScale(200)
+ padding: "2@msr", // = Math.round(moderateScale(2))
+ margin: 5,
+ },
});
export default class sizeMattersDemo {
render() {
return (
-
- 调用create方法
-
+
+ create
+
);
}
}
```
- [!TIP] 这里展示[自定义默认尺寸](https://github.com/nirsky/react-native-size-matters/blob/master/examples/change-guideline-sizes.md)
-## 约束与限制
-### 兼容性
-本文档内容基于以下版本验证通过:
+[!TIP] Here is displayed[Custom Default Size](https://github.com/nirsky/react-native-size-matters/blob/master/examples/change-guideline-sizes.md)
+
+## Constraints
+
+### Compatibility
+
+This document is verified based on the following versions:
1. RNOH:0.72.27; SDK:HarmonyOS-Next-DB1 5.0.0.29(SP1); IDE:DevEco Studio 5.0.3.400; ROM:3.0.0.25;
2. RNOH:0.72.33; SDK:OpenHarmony 5.0.0.71(API Version 12 Release); IDE:DevEco Studio 5.0.3.900; ROM:NEXT.0.0.71;
## API
-> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
+> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
-> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
+> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android.
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ---------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------- | -------- | ----------- | -------- |
-| scale | 将根据您设备的屏幕宽度返回所提供尺寸的线性缩放结果。 | Function | No | Android、iOS | Yes |
-| verticalScale | 将根据您设备的屏幕高度返回所提供尺寸的线性缩放结果。 | Function | No | Android、iOS | Yes |
-| moderateScale | 有时您不想以线性方式缩放所有内容,这时可以使用 moderateScale。它的妙处在于您可以控制调整大小的因子(默认值为 0.5)。如果正常缩放会将您的尺寸增加 +2X,则 moderateScale 只会将其增加 +X | Function | No | Android、iOS | Yes |
-| moderateVerticalScale | 与 moderateScale 相同,但使用 verticalScale 而不是 scale。 | Function | No | Android、iOS | Yes |
-| s | scale方法的别名 | Function | No | Android、iOS | Yes |
-| vs | verticalScale方法的别名 | Function | No | Android、iOS | Yes |
-| ms | moderateScale别名方法 | Function | No | Android、iOS | Yes |
-| mvs | moderateVerticalScale的别名方法 | Function | No | Android、iOS | Yes |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | ------------ | ----------------- |
+| scale | 将根据您设备的屏幕宽度返回所提供尺寸的线性缩放结果。 | Function | No | Android、iOS | Yes |
+| verticalScale | 将根据您设备的屏幕高度返回所提供尺寸的线性缩放结果。 | Function | No | Android、iOS | Yes |
+| moderateScale | 有时您不想以线性方式缩放所有内容,这时可以使用 moderateScale。它的妙处在于您可以控制调整大小的因子(默认值为 0.5)。如果正常缩放会将您的尺寸增加 +2X,则 moderateScale 只会将其增加 +X | Function | No | Android、iOS | Yes |
+| moderateVerticalScale | 与 moderateScale 相同,但使用 verticalScale 而不是 scale。 | Function | No | Android、iOS | Yes |
+| s | scale 方法的别名 | Function | No | Android、iOS | Yes |
+| vs | verticalScale 方法的别名 | Function | No | Android、iOS | Yes |
+| ms | moderateScale 别名方法 | Function | No | Android、iOS | Yes |
+| mvs | moderateVerticalScale 的别名方法 | Function | No | Android、iOS | Yes |
-## 遗留问题
+## Known Issues
-## 其他
+## Others
-## 开源协议
+## License
-本项目基于 [The MIT License(MIT)](https://github.com/nirsky/react-native-size-matters/blob/master/LICENSE) ,请自由地享受和参与开源。
+This project is licensed under [The MIT License(MIT)](https://github.com/nirsky/react-native-size-matters/blob/master/LICENSE).
--
Gitee
From 7a23710c2a773a0e6accdd712397b8a8ae7fab30 Mon Sep 17 00:00:00 2001
From: lizhien52O
Date: Wed, 6 Nov 2024 16:09:01 +0800
Subject: [PATCH 2/5] docs: [Issues: #IB117J] react-native-root-toast.md
---
en/react-native-root-toast.md | 36 +++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/en/react-native-root-toast.md b/en/react-native-root-toast.md
index f9f57bc5..2885b23f 100644
--- a/en/react-native-root-toast.md
+++ b/en/react-native-root-toast.md
@@ -1,4 +1,4 @@
-> 模板版本:v0.2.2
+> Template version: v0.2.2
react-native-root-toast
@@ -13,11 +13,11 @@
-> [!TIP] [Github 地址](https://github.com/magicismight/react-native-root-toast)
+> [!TIP] [GitHub address](https://github.com/magicismight/react-native-root-toast)
-## 安装与使用
+## Installation and Usage
-进入到工程目录并输入以下命令:
+Go to the project directory and execute the following instruction:
@@ -35,7 +35,7 @@ yarn add react-native-root-toast@3.5.1
-下面的代码展示了这个库的基本使用场景:
+The following code shows the basic use scenario of the repository:
```js
import React, { useState } from "react";
@@ -55,7 +55,7 @@ import Toast from "react-native-root-toast";
export function ReactNativeRootToastExample() {
let PToast: any = null;
function startPToast() {
- PToast = Toast.show("超长待机弹窗实例", {
+ PToast = Toast.show("Ultra Long standby pop-up instance", {
duration: 99999999,
position: 20,
shadow: true,
@@ -74,27 +74,27 @@ export function ReactNativeRootToastExample() {
}
return (
-
-
+
+
);
}
```
-## 约束与限制
+## Constraints
-### 兼容性
+### Compatibility
-本文档内容基于以下版本验证通过:
+This document is verified based on the following versions:
1. RNOH: 0.72.20-CAPI; SDK:HarmonyOS NEXT Developer Beta1; IDE:DevEco Studio 5.0.3.200; ROM:3.0.0.18;
2. RNOH:0.72.33; SDK:OpenHarmony 5.0.0.71(API Version 12 Release); IDE:DevEco Studio 5.0.3.900; ROM:NEXT.0.0.71;
-## 属性
+## Properties
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
+> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
+> [!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android.
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------- | ------------------------------------------------------------------------------------- | -------- | -------- | -------- | ----------------- |
@@ -114,10 +114,10 @@ export function ReactNativeRootToastExample() {
| onHide | Callback for toast`s hide animation start | function | no | All | yes |
| onHidden | Callback for toast`s hide animation end | function | no | All | yes |
-## 遗留问题
+## Known Issues
-## 其他
+## Others
-## 开源协议
+## License
-本项目基于 [The MIT License (MIT)](https://github.com/magicismight/react-native-root-toast/blob/master/LICENSE.txt) ,请自由地享受和参与开源。
\ No newline at end of file
+This project is licensed under [The MIT License (MIT)](https://github.com/magicismight/react-native-root-toast/blob/master/LICENSE.txt).
\ No newline at end of file
--
Gitee
From 435e52e76e01c312754e32fe6ed85d415ccd412e Mon Sep 17 00:00:00 2001
From: lizhien52O
Date: Wed, 6 Nov 2024 16:09:14 +0800
Subject: [PATCH 3/5] docs: [Issues: #IB117J] react-native-mlkit-ocr.md
---
en/react-native-mlkit-ocr.md | 102 ++++++++++++++++-------------------
1 file changed, 47 insertions(+), 55 deletions(-)
diff --git a/en/react-native-mlkit-ocr.md b/en/react-native-mlkit-ocr.md
index 55d6e930..4df5bdba 100644
--- a/en/react-native-mlkit-ocr.md
+++ b/en/react-native-mlkit-ocr.md
@@ -1,4 +1,4 @@
-> 模板版本:v0.2.2
+> Template version: v0.2.2
react-native-mlkit-ocr
@@ -12,15 +12,15 @@
-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-mlkit-ocr)
+> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-mlkit-ocr)
-## 安装与使用
+## Installation and Usage
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-mlkit-ocr Releases](https://github.com/react-native-oh-library/react-native-mlkit-ocr/releases),并下载适用版本的 tgz 包。
+Find the matching version information in the release address of a third-party library and download an applicable .tgz package: [@react-native-oh-tpl/react-native-mlkit-ocr Releases](https://github.com/react-native-oh-library/react-native-mlkit-ocr/releases).
-进入到工程目录并输入以下命令:
+Go to the project directory and execute the following instruction:
-> [!TIP] # 处替换为 tgz 包的路径
+> [!TIP] Replace the content with the path of the .tgz package at the comment sign (#).
@@ -38,9 +38,9 @@ yarn add @react-native-oh-tpl/react-native-mlkit-ocr@file:#
-下面的代码展示了这个库的基本使用场景:
+The following code shows the basic use scenario of the repository:
-> [!WARNING] 使用时 import 的库名不变。
+> [!WARNING] The name of the imported repository remains unchanged.
```js
import * as React from 'react';
@@ -108,7 +108,7 @@ export const OcrTest = () => {
)}
{
MlkitOcr.detectFromUri('https://res.vmallres.com//uomcdn/CN/pms/202407/E3B48F7290631FAF341FDB09CF907F03.jpg').then(res => {
setTimeout(() => {
@@ -121,7 +121,7 @@ export const OcrTest = () => {
}}
/>
{
MlkitOcr.detectFromFile('file://docs/storage/Users/currentUser/test/1.jpg').then(res => {
setTimeout(() => {
@@ -140,11 +140,11 @@ export const OcrTest = () => {
## Link
-目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。
+Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking.
-首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony`
+Open the `harmony` directory of the HarmonyOS project in DevEco Studio.
-### 1.在工程根目录的 `oh-package.json5` 添加 overrides 字段
+### 1. Adding the overrides Field to oh-package.json5 File in the Root Directory of the Project
```json
{
@@ -155,18 +155,15 @@ export const OcrTest = () => {
}
```
-### 2.引入原生端代码
+### 2.Introducing Native Code
-目前有两种方法:
+Currently, two methods are available:
-1. 通过 har 包引入(在 IDE 完善相关功能后该方法会被遗弃,目前首选此方法);
-2. 直接链接源码。
+Method 1 (recommended): Use the HAR file.
-方法一:通过 har 包引入(推荐)
+> [!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library.
-> [!TIP] har 包位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
+Open `entry/oh-package.json5` file and add the following dependencies:
```json
"dependencies": {
@@ -176,22 +173,22 @@ export const OcrTest = () => {
}
```
-点击右上角的 `sync` 按钮
+Click the `sync` button in the upper right corner.
-或者在终端执行:
+Alternatively, run the following instruction on the terminal:
```bash
cd entry
ohpm install
```
-方法二:直接链接源码
+Method 2: Directly link to the source code.
-> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
+> [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md).
-### 3.配置 CMakeLists 和引入 RNMlkitOcrPackage
+### 3. Configuring CMakeLists and Introducing RNMlkitOcrPackage
-打开 `entry/src/main/cpp/CMakeLists.txt`,添加:
+Open `entry/src/main/cpp/CMakeLists.txt` and add the following code:
```diff
project(rnapp)
@@ -229,7 +226,7 @@ target_link_libraries(rnoh_app PUBLIC rnoh_sample_package)
# RNOH_END: manual_package_linking_2
```
-打开 `entry/src/main/cpp/PackageProvider.cpp`,添加:
+Open `entry/src/main/cpp/PackageProvider.cpp` and add the following code:
```diff
#include "RNOH/PackageProvider.h"
@@ -246,9 +243,9 @@ std::vector> PackageProvider::getPackages(Package::Cont
}
```
-### 4.在 ArkTs 侧引入 RNMlkitOcrPackage
+### 4. Introducing RNMlkitOcrPackage to ArkTS
-打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
+Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
```diff
+ import { RNMlkitOcrPackage } from '@react-native-oh-tpl/react-native-mlkit-ocr/ts';
@@ -261,11 +258,11 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
}
```
-### 5.应用权限申请
+### 5. Permission Requirements
> [!tip] "ohos.permission.INTERNET"权限等级为normal ,授权方式为system_grant ,[使用 ACL 签名的配置指导](https://developer.harmonyos.com/cn/docs/documentation/doc-guides-V3/signing-0000001587684945-V3#section157591551175916)
-在 `YourProject/entry/src/main/module.json5`补上配置
+Add configuration to `YourProject/entry/src/main/module.json5`
```diff
{
@@ -284,47 +281,42 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
}
```
+### 6. Running
+Click the `sync` button in the upper right corner.
-### 6.运行
-
-点击右上角的 `sync` 按钮
-
-或者在终端执行:
+Alternatively, run the following instruction on the terminal:
```bash
cd entry
ohpm install
```
-然后编译、运行即可。
+Then build and run the code.
-## 约束与限制
+## Constraints
-### 兼容性
-
-要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。
-
-请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-mlkit-ocr Releases](https://github.com/react-native-oh-library/react-native-mlkit-ocr/releases)
+### Compatibility
+To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone.
+Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-mlkit-ocr Releases](https://github.com/react-native-oh-library/react-native-mlkit-ocr/releases)
## API
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
+> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
-| NAME | Description | TYPE | Required | Platform | HarmonyOS Support |
-| ---------------- | ------------------------------------------ |--------------------------------- | ------ | -------- | -------- |
-| detectFromUri(uri)| 传入网络图片地址 | Function |Yes| All | Yes |
-| detectFromFile(path) | 传入本地图片地址 | Function |Yes| All | Yes |
+> [!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android.
+| NAME | Description | TYPE | Required | Platform | HarmonyOS Support |
+| -------------------- | ---------------- | -------- | -------- | -------- | ----------------- |
+| detectFromUri(uri) | 传入网络图片地址 | Function | Yes | All | Yes |
+| detectFromFile(path) | 传入本地图片地址 | Function | Yes | All | Yes |
-## 遗留问题
+## Known Issues
-## 其他
+## Others
-## 开源协议
+## License
-本项目基于 [The MIT License (MIT)](https://github.com/agoldis/react-native-mlkit-ocr/blob/main/LICENSE) ,请自由地享受和参与开源。
+This project is licensed under [The MIT License (MIT)](https://github.com/agoldis/react-native-mlkit-ocr/blob/main/LICENSE).
--
Gitee
From 7fc04d2ed4c12e1dd0c00ba587a8f4830f4e2e5d Mon Sep 17 00:00:00 2001
From: lizhien52O
Date: Wed, 6 Nov 2024 16:09:25 +0800
Subject: [PATCH 4/5] docs: [Issues: #IB117J] react-native-incall-manager.md
---
en/react-native-incall-manager.md | 228 +++++++++++++++---------------
1 file changed, 111 insertions(+), 117 deletions(-)
diff --git a/en/react-native-incall-manager.md b/en/react-native-incall-manager.md
index c8c83503..c7148807 100644
--- a/en/react-native-incall-manager.md
+++ b/en/react-native-incall-manager.md
@@ -1,4 +1,4 @@
-模板版本:v0.2.2
+> Template version: v0.2.2
@@ -15,18 +15,15 @@
+> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-incall-manager)
-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-incall-manager)
+## Installation and Usage
+Find the matching version information in the release address of a third-party library and download an applicable .tgz package: [@react-native-oh-tpl/react-native-incall-manager Releases](https://github.com/react-native-oh-library/react-native-incall-manager/releases).
-## 安装与使用
+Go to the project directory and execute the following instruction:
-
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-incall-manager Releases](https://github.com/react-native-oh-library/react-native-incall-manager/releases),并下载适用版本的 tgz 包。
-
-进入到工程目录并输入以下命令:
-
-> [!TIP] # 处替换为 tgz 包的路径
+> [!TIP] Replace the content with the path of the .tgz package at the comment sign (#).
@@ -45,16 +42,16 @@ yarn add @react-native-oh-tpl/react-native-incall-manager@file:#
**关于音频文件放置**
-> [!WARNING] 由于HarmonyOS暂不支持普通应用获取系统铃声,需要手动导入音频文件.
-将音频文件至HarmonyOS 工程 `harmony`,entry/src/main/resources/rawfile文件夹下,音频文件命名如下:
-incallmanager_busytone.mp3
-incallmanager_ringback.mp3
-incallmanager_ringtone.mp3
-下面的代码展示了这个库的基本使用场景:
+> [!WARNING] 由于 HarmonyOS 暂不支持普通应用获取系统铃声,需要手动导入音频文件.
+> 将音频文件至 HarmonyOS 工程 `harmony`,entry/src/main/resources/rawfile 文件夹下,音频文件命名如下:
+> incallmanager_busytone.mp3
+> incallmanager_ringback.mp3
+> incallmanager_ringtone.mp3
-> [!WARNING] 使用时 import 的库名不变。
+The following code shows the basic use scenario of the repository:
+> [!WARNING] The name of the imported repository remains unchanged.
```js
@@ -263,15 +260,15 @@ export default function InCallManagerExample() {
- noisyAudioEvent(iOS不支持):{JSON.stringify(noisyAudioEvent)}
+ noisyAudioEvent(iOS is not supported):{JSON.stringify(noisyAudioEvent)}
- mediaButtonEvent(iOS不支持):{JSON.stringify(mediaButtonEvent)}
+ mediaButtonEvent(iOS is not supported):{JSON.stringify(mediaButtonEvent)}
- onAudioFocusChange(iOS不支持):{JSON.stringify(onAudioFocusChange)}
+ onAudioFocusChange(iOS is not supported):{JSON.stringify(onAudioFocusChange)}
- 切换为{changeType == 'audio' ? 'video' : 'audio'}
+ Switch to{changeType == 'audio' ? 'video' : 'audio'}
@@ -458,14 +455,14 @@ export default function InCallManagerExample() {
onPress={() => {
setFlashOn(true, 100);
}}>
- setFlashOn=true(Android不支持)
+ setFlashOn=true(Android is not supported)
{
setFlashOn(false, 50);
}}>
- setFlashOn=false(Android不支持)
+ setFlashOn=false(Android is not supported)
[!TIP] har 包位于三方库安装路径的 `harmony` 文件夹下。
+> [!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library.
-打开 `entry/oh-package.json5`,添加以下依赖
+Open `entry/oh-package.json5` file and add the following dependencies:
```json
"dependencies": {
@@ -527,22 +522,22 @@ export default function InCallManagerExample() {
}
```
-点击右上角的 `sync` 按钮
+Click the `sync` button in the upper right corner.
-或者在终端执行:
+Alternatively, run the following instruction on the terminal:
```bash
cd entry
ohpm install
```
-方法二:直接链接源码
+Method 2: Directly link to the source code.
-> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
+> [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md).
-### 3.配置 CMakeLists 和引入 RNInCallManagerPackage
+### 3. Configuring CMakeLists and Introducing RNInCallManagerPackage
-打开 `entry/src/main/cpp/CMakeLists.txt`,添加:
+Open `entry/src/main/cpp/CMakeLists.txt` and add the following code:
```diff
project(rnapp)
@@ -580,7 +575,7 @@ target_link_libraries(rnoh_app PUBLIC rnoh_sample_package)
# RNOH_END: manual_package_linking_2
```
-打开 `entry/src/main/cpp/PackageProvider.cpp`,添加:
+Open `entry/src/main/cpp/PackageProvider.cpp` and add the following code:
```diff
#include "RNOH/PackageProvider.h"
@@ -597,9 +592,9 @@ std::vector> PackageProvider::getPackages(Package::Cont
}
```
-### 4.在 ArkTs 侧引入 RNInCallManagerPackage
+### 4. Introducing RNInCallManagerPackage to ArkTS
-打开 `entry/src/main/ets/RNPackagesFactory.ts`,或者`entry/src/main/ets/rn/RNPackagesFactory.ts`,添加:
+Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
```diff
+ import { RNInCallManagerPackage } from '@react-native-oh-tpl/react-native-incall-manager/ts';
@@ -612,34 +607,35 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
}
```
-### 5.运行
+### 5. Running
-点击右上角的 `sync` 按钮
+Click the `sync` button in the upper right corner.
-或者在终端执行:
+Alternatively, run the following instruction on the terminal:
```bash
cd entry
ohpm install
```
-然后编译、运行即可。
+Then build and run the code.
-## 约束与限制
-### 兼容性
+## Constraints
+### Compatibility
-要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。
+To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone.
-请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-incall-manager Releases](https://github.com/react-native-oh-library/react-native-incall-manager/releases)
+Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-incall-manager Releases](https://github.com/react-native-oh-library/react-native-incall-manager/releases)
+### Permission Requirements
-### 应用权限申请
> [!TIP] "ohos.permission.RUNNING_LOCK","ohos.permission.KEEP_BACKGROUND_RUNNING"权限等级为normal ,授权方式为system_grant
> "ohos.permission.MICROPHONE"权限等级为normal ,授权方式为user_grant ,[使用 ACL 签名的配置指导](https://developer.harmonyos.com/cn/docs/documentation/doc-guides-V3/signing-0000001587684945-V3#section157591551175916)
-#### 在 entry 目录下的module.json5中添加权限
-在 `YourProject/entry/src/main/module.json5`补上配置
+#### Include applicable permissions in the module.json5 file within the entry directory.
+
+Add configuration to `YourProject/entry/src/main/module.json5`
```diff
{
@@ -656,7 +652,7 @@ ohpm install
+ "reason": "$string:Access_micphone",
+ "usedScene": {"when": "inuse"}
+ },
-+ { "name": "ohos.permission.KEEP_BACKGROUND_RUNNING",
++ { "name": "ohos.permission.KEEP_BACKGROUND_RUNNING",
+ "usedScene": {
+ "when": "always"
+ }
@@ -665,11 +661,12 @@ ohpm install
}
}
```
-在 `YourProject/entry/src/main/resources/base/element/string.json`补上配置
-#### 在 entry 目录下添加申请权限的原因
+Add configuration to `YourProject/entry/src/main/resources/base/element/string.json`
-打开 `entry/src/main/resources/base/element/string.json`,添加:
+#### Apply the reasons for applicable permission in the entry directory.
+
+Open `entry/src/main/resources/base/element/string.json` file and add:
```diff
...
@@ -683,63 +680,60 @@ ohpm install
}
```
-
-
-## 静态方法
-
-> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ---- | ----------- | ---- | -------- | -------- | ------------------ |
-| vibrate | set vibrate true / false | boolean | no | all | yes |
-| start | start incall manager.ringback accept non-empty string or it won't play default: \{media:'audio', auto: true, ringback: ''\} | (setup?: \{auto?: boolean;media?: "video" \| "audio";ringback?: string;\}) => void | no | all | yes |
-| stop | stop incall manager,busytone accept non-empty string or it won't play,default: \{busytone: ''\} | (setup?: \{ busytone?: string \}) => void | no | all | partially |
-| turnScreenOn | force turn screen on | () => void | no | Android | yes |
-| turnScreenOff | turn screen off | () => void | no | Android | yes |
-| setKeepScreenOn | set KeepScreenOn flag = true or false,default: false | (enable: boolean) => void | no | all | yes |
-| setSpeakerphoneOn | toggle speaker ON/OFF once. but not force,default: false | (enable: boolean) => void | no | all | no |
-| setForceSpeakerphoneOn | true -> force speaker on,false -> force speaker off,null -> use default behavior according to media type,default: null | (flag: boolean) => void | no | all | no |
-| setMicrophoneMute | mute/unmute micophone,default: false,p.s. if you use webrtc, you can just use track.enabled = false to mute | (enable: boolean) => void | no | Android | no |
-| getAudioUri | get audio Uri path. this would be useful when you want to pass Uri into another module. | (audioType: string, fileType: string) => Promise | no | all | yes |
-| startRingtone | play ringtone.ringtone: 'DEFAULT' or 'BUNDLE',vibrate_pattern: same as RN, but does not support repeat,ios_category: ios only, if you want to use specific audio category,seconds: android only, specify how long do you want to play rather than play once nor repeat. in sec. | (ringtone: string,vibrate_pattern: number | number\[],ios_category: string,seconds: number) => void | no | all | partially |
-| stopRingtone | stop play ringtone if previous started via | () => void | no | all | yes |
-| startRingback | play ringback.,ringback: '_DEFAULT_' or '_DTMF_' | (ringback: string) => void; | no | all | partially |
-| stopRingback | stop play ringback if previous started via start() | () => void | no | all | yes |
-| stopProximitySensor | stop ProximitySensor | () => void | no | all | yes |
-| startProximitySensor | start proximitySensor | () => void | no | all | yes |
-| pokeScreen | poke screen | (timeout: number) => void | no | Android | no |
-| chooseAudioRoute | choose audio route | (route: string) => Promise | no | Android | no |
-| requestAudioFocus | request audio focus | () => Promise | no | Android | no |
-| abandonAudioFocus | abandon audio focus | () => Promise | no | Android | no |
-| setFlashOn | set flash light on/off | (enable: boolean, brightness: number) => void | no | iOS | yes |
-| getIsWiredHeadsetPluggedIn | return wired headset plugged in state | () => Promise<\{ isWiredHeadsetPluggedIn: boolean \}> | no | all | yes |
-
-### Event(事件监听)
-
-> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ---- | ----------- | ---- | -------- | -------- | ------------------ |
-| Proximity | proximity sensor detected changes. | (data: \{'isNear': boolean\}) => void | no | all | yes |
-| WiredHeadset | fire when wired headset plug/unplug | (data: \{'isPlugged': boolean, 'hasMic': boolean, 'deviceName': string \}) => void | no | all | yes |
-| NoisyAudio | a hint for applications that audio is about to become 'noisy' due to a change in audio outputs. | () => void | no | Android | yes |
-| MediaButton | when external device controler pressed button | (data: \{'eventText': string, 'eventCode': number \}) => void | no | Android | yes |
-| onAudioFocusChange | Called on the listener to notify it the audio focus for this listener has been changed. | (data: \{'eventText': string, 'eventCode': number }) => void | no | Android | yes |
-
-
-## 遗留问题
-
-- [ ] 打开关闭麦克风静音setMicrophoneMute,未实现 HarmonyOS化 问题: [issue#1](https://github.com/react-native-oh-library/react-native-incall-manager/issues/1)
-- [ ] 播放获取系统铃声,未实现 HarmonyOS化 问题: [issue#2](https://github.com/react-native-oh-library/react-native-incall-manager/issues/2)
-- [ ] 手动切换输出设备扬声器与听筒切换setSpeakerphoneOn、setForceSpeakerphoneOn,未实现 HarmonyOS化 问题: [issue#3](https://github.com/react-native-oh-library/react-native-incall-manager/issues/3)
-- [ ] 手动切换音频输入输出设备chooseAudioRoute,未实现 HarmonyOS化 问题: [issue#4](https://github.com/react-native-oh-library/react-native-incall-manager/issues/4)
-
-## 其他
-
-## 开源协议
-
-本项目基于 [The ISC License (ISC)](https://github.com/react-native-webrtc/react-native-incall-manager/blob/master/LICENSE) ,请自由地享受和参与开源。
+## Static method
+
+> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
+
+> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android.
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------- | -------- | ----------------- | --------- |
+| vibrate | set vibrate true / false | boolean | no | all | yes |
+| start | start incall manager.ringback accept non-empty string or it won't play default: \{media:'audio', auto: true, ringback: ''\} | (setup?: \{auto?: boolean;media?: "video" \| "audio";ringback?: string;\}) => void | no | all | yes |
+| stop | stop incall manager,busytone accept non-empty string or it won't play,default: \{busytone: ''\} | (setup?: \{ busytone?: string \}) => void | no | all | partially |
+| turnScreenOn | force turn screen on | () => void | no | Android | yes |
+| turnScreenOff | turn screen off | () => void | no | Android | yes |
+| setKeepScreenOn | set KeepScreenOn flag = true or false,default: false | (enable: boolean) => void | no | all | yes |
+| setSpeakerphoneOn | toggle speaker ON/OFF once. but not force,default: false | (enable: boolean) => void | no | all | no |
+| setForceSpeakerphoneOn | true -> force speaker on,false -> force speaker off,null -> use default behavior according to media type,default: null | (flag: boolean) => void | no | all | no |
+| setMicrophoneMute | mute/unmute micophone,default: false,p.s. if you use webrtc, you can just use track.enabled = false to mute | (enable: boolean) => void | no | Android | no |
+| getAudioUri | get audio Uri path. this would be useful when you want to pass Uri into another module. | (audioType: string, fileType: string) => Promise | no | all | yes |
+| startRingtone | play ringtone.ringtone: 'DEFAULT' or 'BUNDLE',vibrate_pattern: same as RN, but does not support repeat,ios_category: ios only, if you want to use specific audio category,seconds: android only, specify how long do you want to play rather than play once nor repeat. in sec. | (ringtone: string,vibrate_pattern: number | number\[],ios_category: string,seconds: number) => void | no | all | partially |
+| stopRingtone | stop play ringtone if previous started via | () => void | no | all | yes |
+| startRingback | play ringback.,ringback: '_DEFAULT_' or '_DTMF_' | (ringback: string) => void; | no | all | partially |
+| stopRingback | stop play ringback if previous started via start() | () => void | no | all | yes |
+| stopProximitySensor | stop ProximitySensor | () => void | no | all | yes |
+| startProximitySensor | start proximitySensor | () => void | no | all | yes |
+| pokeScreen | poke screen | (timeout: number) => void | no | Android | no |
+| chooseAudioRoute | choose audio route | (route: string) => Promise | no | Android | no |
+| requestAudioFocus | request audio focus | () => Promise | no | Android | no |
+| abandonAudioFocus | abandon audio focus | () => Promise | no | Android | no |
+| setFlashOn | set flash light on/off | (enable: boolean, brightness: number) => void | no | iOS | yes |
+| getIsWiredHeadsetPluggedIn | return wired headset plugged in state | () => Promise<\{ isWiredHeadsetPluggedIn: boolean \}> | no | all | yes |
+
+### Event(Event Listening)
+
+> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
+
+> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android.
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ------------------ | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -------- | -------- | ----------------- |
+| Proximity | proximity sensor detected changes. | (data: \{'isNear': boolean\}) => void | no | all | yes |
+| WiredHeadset | fire when wired headset plug/unplug | (data: \{'isPlugged': boolean, 'hasMic': boolean, 'deviceName': string \}) => void | no | all | yes |
+| NoisyAudio | a hint for applications that audio is about to become 'noisy' due to a change in audio outputs. | () => void | no | Android | yes |
+| MediaButton | when external device controler pressed button | (data: \{'eventText': string, 'eventCode': number \}) => void | no | Android | yes |
+| onAudioFocusChange | Called on the listener to notify it the audio focus for this listener has been changed. | (data: \{'eventText': string, 'eventCode': number }) => void | no | Android | yes |
+
+## Known Issues
+
+- [ ] 打开关闭麦克风静音 setMicrophoneMute,未实现 HarmonyOS 化 问题: [issue#1](https://github.com/react-native-oh-library/react-native-incall-manager/issues/1)
+- [ ] 播放获取系统铃声,未实现 HarmonyOS 化 问题: [issue#2](https://github.com/react-native-oh-library/react-native-incall-manager/issues/2)
+- [ ] 手动切换输出设备扬声器与听筒切换 setSpeakerphoneOn、setForceSpeakerphoneOn,未实现 HarmonyOS 化 问题: [issue#3](https://github.com/react-native-oh-library/react-native-incall-manager/issues/3)
+- [ ] 手动切换音频输入输出设备 chooseAudioRoute,未实现 HarmonyOS 化 问题: [issue#4](https://github.com/react-native-oh-library/react-native-incall-manager/issues/4)
+
+## Others
+
+## License
+
+This project is licensed under [The ISC License (ISC)](https://github.com/react-native-webrtc/react-native-incall-manager/blob/master/LICENSE).
--
Gitee
From fb7832fbb8b2e4498072075f2fc7491ac44f03e4 Mon Sep 17 00:00:00 2001
From: lizhien52O
Date: Wed, 6 Nov 2024 16:09:32 +0800
Subject: [PATCH 5/5] docs: [Issues: #IB117J] react-native-background-timer.md
---
en/react-native-background-timer.md | 141 +++++++++++++---------------
1 file changed, 63 insertions(+), 78 deletions(-)
diff --git a/en/react-native-background-timer.md b/en/react-native-background-timer.md
index 89f77c0c..12de4f5b 100644
--- a/en/react-native-background-timer.md
+++ b/en/react-native-background-timer.md
@@ -1,6 +1,4 @@
-
-
-> 模板版本:v0.2.1
+> Template version: v0.2.2
react-native-background-timer
@@ -15,16 +13,15 @@
-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-background-timer)
-
+> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-background-timer)
-## 安装与使用
+## Installation and Usage
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-background-timer Releases](https://github.com/react-native-oh-library/react-native-background-timer/releases),并下载适用版本的 tgz 包。
+Find the matching version information in the release address of a third-party library and download an applicable .tgz package: [@react-native-oh-tpl/react-native-background-timer Releases](https://github.com/react-native-oh-library/react-native-background-timer/releases).
-进入到工程目录并输入以下命令:
+Go to the project directory and execute the following instruction:
-> [!TIP] # 处替换为 tgz 包的路径
+> [!TIP] Replace the content with the path of the .tgz package at the comment sign (#).
@@ -42,9 +39,9 @@ yarn add @react-native-oh-tpl/react-native-background-timer@file:#
-下面的代码展示了这个库的基本使用场景:
+The following code shows the basic use scenario of the repository:
-> [!WARNING] 使用时 import 的库名不变。
+> [!WARNING] The name of the imported repository remains unchanged.
```js
import {View, Button, StyleSheet, Text,TextInput} from 'react-native';
@@ -53,37 +50,34 @@ import BackgroundTimer from "react-native-background-timer";
export function BackgroundTimerExample() {
let [count, setCount] = useState(0);
let [text, setText] = useState("");
- // BackgroundTimer延时
let [delay, setDelay] = useState("1000");
- // setTimeout延时
let [timeoutDelay, setTimeoutDelay] = useState("1000");
- // setInterval延时
let [intervalDelay, setIntervalDelay] = useState("1000");
let timeoutList:number[] = []
let [intervalList, setIntervalList] = useState([]);
-
+
// runBackgroundTimer
function onPressStart(){
- setText("开启定时器...")
+ setText("Turn on the timer...")
BackgroundTimer.runBackgroundTimer(()=>{
setCount(count+=1)
},parseInt(delay))
}
function onPressStop(){
- setText("结束定时器")
+ setText("Turn off the timer")
BackgroundTimer.stopBackgroundTimer()
}
// setTimeout
function setTimeoutStart(){
- setText("开启定时器...")
+ setText("Turn on the timer...")
let timeoutId = BackgroundTimer.setTimeout(()=>{
setCount(count+=1)
},parseInt(timeoutDelay))
timeoutList.push(timeoutId)
}
function setTimeoutStop(){
- setText("结束定时器")
+ setText("Turn off the timer")
if(timeoutList.length>0){
BackgroundTimer.clearTimeout(timeoutList[0])
timeoutList.shift()
@@ -92,14 +86,14 @@ export function BackgroundTimerExample() {
// setInterval
function setIntervalStart(){
- setText("开启定时器...")
+ setText("Turn on the timer...")
let intervalId = BackgroundTimer.setInterval(()=>{
setCount(count+=1)
},parseInt(intervalDelay))
setIntervalList([...intervalList,intervalId])
}
function setIntervalStop(){
- setText("结束定时器")
+ setText("Turn off the timer")
if(intervalList.length>0){
BackgroundTimer.clearInterval(intervalList[0])
intervalList.shift()
@@ -119,7 +113,7 @@ export function BackgroundTimerExample() {
/>
{setDelay(value)}}
value={delay}
/>
@@ -131,7 +125,7 @@ export function BackgroundTimerExample() {
/>
-
+
{setTimeoutDelay(value)}}
value={timeoutDelay}
/>
@@ -152,7 +146,7 @@ export function BackgroundTimerExample() {
/>
-
+
-
+
[!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library.
-> [!TIP] har 包位于三方库安装路径的 `harmony` 文件夹下。
-
-打开 `entry/oh-package.json5`,添加以下依赖
+Open `entry/oh-package.json5` file and add the following dependencies:
```json
"dependencies": {
@@ -246,20 +237,20 @@ const styles = StyleSheet.create({
}
```
-点击右上角的 `sync` 按钮
+Click the `sync` button in the upper right corner.
-或者在终端执行:
+Alternatively, run the following instruction on the terminal:
```bash
cd entry
ohpm install
```
-方法二:直接链接源码
+Method 2: Directly link to the source code.
-> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。
+> [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md).
-打开 `entry/oh-package.json5`,添加以下依赖
+Open `entry/oh-package.json5` file and add the following dependencies:
```json
"dependencies": {
@@ -268,16 +259,16 @@ ohpm install
}
```
-打开终端,执行:
+Opening the terminal and executing:
```bash
cd entry
ohpm install --no-link
```
-### 3.在 ArkTs 侧引入 BackgroundTimerTurboModulePackage
+### 3. Introducing BackgroundTimerTurboModulePackage to ArkTS
-打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
+Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
```diff
...
@@ -285,66 +276,60 @@ ohpm install --no-link
export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
return [
- new SamplePackage(ctx),
+ new SamplePackage(ctx),
+ new BackgroundTimerTurboModulePackage(ctx)
];
}
```
-### 4.运行
+### 4. Running
-点击右上角的 `sync` 按钮
+Click the `sync` button in the upper right corner.
-或者在终端执行:
+Alternatively, run the following instruction on the terminal:
```bash
cd entry
ohpm install
```
-然后编译、运行即可。
-
-## 约束与限制
-
-### 兼容性
+Then build and run the code.
+## Constraints
-要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。
+### Compatibility
-请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-background-timer Releases](https://github.com/react-native-oh-library/react-native-background-timer/releases)
+To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone.
+Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-background-timer Releases](https://github.com/react-native-oh-library/react-native-background-timer/releases)
-本文档内容基于以下版本验证通过:
-
+This document is verified based on the following versions:
RNOH: 0.72.20; SDK: HarmonyOS NEXT Developer Beta1 B.0.18; IDE: DevEco Studio 5.0.3.200; ROM: 3.0.0.19;
-
## API
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
+> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
-| Name | Description | Required | Platform | HarmonyOS Support |
-| ---- | ----------- | -------- | -------- | ------------------ |
-| runBackgroundTimer | 开启定时器,以固定的时间间隔重复执行指定代码 | no | all | yes |
-| stopBackgroundTimer | 结束runBackgroundTimer开启的定时器 | no | all | yes |
-| start | 后台开启新任务 | no | all | no |
-| stop | 结束后台任务 | no | all | no |
-| setTimeout | 开启定时器,定时器到期会执行指定代码,只会执行一次 | no | Android | yes |
-| clearTimeout | 结束setTimeout开启的定时器 | no | Android | yes |
-| setInterval | 开启定时器,以固定的时间间隔重复执行指定代码 | no | Android | yes |
-| clearInterval | 结束setInterval开启的定时器 | no | Android | yes |
+> [!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android.
-## 遗留问题
+| Name | Description | Required | Platform | HarmonyOS Support |
+| ------------------- | -------------------------------------------------- | -------- | -------- | ----------------- |
+| runBackgroundTimer | 开启定时器,以固定的时间间隔重复执行指定代码 | no | all | yes |
+| stopBackgroundTimer | 结束 runBackgroundTimer 开启的定时器 | no | all | yes |
+| start | 后台开启新任务 | no | all | no |
+| stop | 结束后台任务 | no | all | no |
+| setTimeout | 开启定时器,定时器到期会执行指定代码,只会执行一次 | no | Android | yes |
+| clearTimeout | 结束 setTimeout 开启的定时器 | no | Android | yes |
+| setInterval | 开启定时器,以固定的时间间隔重复执行指定代码 | no | Android | yes |
+| clearInterval | 结束 setInterval 开启的定时器 | no | Android | yes |
-- [ ] 使用worker开的新线程中不支持RNOHContext序列化传参,底层OS暂不支持,导致无法在新线程中发送事件,需要底层OS框架实现相关业务功能。不开线程的情况下,因setTimeout属于异步方法,定时器效果不受影响。[worker线程遗留问题:start和stop接口, HarmonyOS RN框架暂不支持](https://github.com/react-native-oh-library/react-native-background-timer/issues/3)
+## Known Issues
-## 其他
+- [ ] 使用 worker 开的新线程中不支持 RNOHContext 序列化传参,底层 OS 暂不支持,导致无法在新线程中发送事件,需要底层 OS 框架实现相关业务功能。不开线程的情况下,因 setTimeout 属于异步方法,定时器效果不受影响。[worker 线程 Known Issues:start 和 stop 接口, HarmonyOS RN 框架暂不支持](https://github.com/react-native-oh-library/react-native-background-timer/issues/3)
-## 开源协议
+## Others
-本项目基于 [The MIT License (MIT)](https://github.com/ocetnik/react-native-background-timer/blob/master/LICENSE) ,请自由地享受和参与开源。
+## License
-
\ No newline at end of file
+This project is licensed under [The MIT License (MIT)](https://github.com/ocetnik/react-native-background-timer/blob/master/LICENSE).
--
Gitee