@@ -13,9 +13,9 @@
-> [!TIP] [Github 地址](https://github.com/callstack/react-theme-provider)
+> [!TIP] [GitHub address](https://github.com/callstack/react-theme-provider)
-## 安装与使用
+## Installation and Usage
#### **npm**
@@ -31,9 +31,9 @@ yarn add @callstack/react-theme-provider@3.0.9
-下面的代码展示了这个库的基本使用场景:
+The following code shows the basic use scenario of the repository:
-> [!WARNING] 使用时 import 的库名不变。
+> [!WARNING] The name of the imported repository remains unchanged.
```js
import React from 'react';
@@ -107,26 +107,26 @@ const styles = StyleSheet.create({
export default RNThemeProvider;
```
-本文档内容基于以下版本验证通过:
+This document is verified based on the following versions:
-1. RNOH:0.72.26; SDK:HarmonyOS NEXT Developer Beta1; IDE:DevEco Studio 5.0.3.300; ROM:3.0.0.22;
+1. RNOH: 0.72.26; SDK: HarmonyOS NEXT Developer Beta1; IDE: DevEco Studio 5.0.3.300; ROM: 3.0.0.22;
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;
-## 组件
+## Components
-> [!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 |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
| ThemeProvider | 接收一个主题对象作为属性,并将该主题提供给其子组件 | component | no | all | yes |
-## 静态方法
+## Static Methods
-> [!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 |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
@@ -134,12 +134,12 @@ export default RNThemeProvider;
| useTheme | 用于在函数组件中访问当前主题,它返回当前主题对象 | function | no | all | yes |
| withTheme | 用于将当前主题作为属性传递给包装组件 | function | yes | all | yes |
-## 遗留问题
+## Known Issues
-## 其他
+## Others
-## 开源协议
+## License
-本项目基于 [The MIT License (MIT)](https://github.com/callstack/react-theme-provider/blob/master/LICENSE) ,请自由地享受和参与开源。
+This project is licensed under [The MIT License (MIT)](https://github.com/callstack/react-theme-provider/blob/master/LICENSE).
\ No newline at end of file
--
Gitee
From 5ea98cb2d09fa80b9a1e0acaa2621ee06e2f087b Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 14:54:39 +0800
Subject: [PATCH 04/53] docs: [Issues: #IB07UG] gorhom-bottom-sheet.md
---
en/gorhom-bottom-sheet.md | 223 +++++++++++++++++++++-----------------
1 file changed, 122 insertions(+), 101 deletions(-)
diff --git a/en/gorhom-bottom-sheet.md b/en/gorhom-bottom-sheet.md
index b174abf7..434c7a93 100644
--- a/en/gorhom-bottom-sheet.md
+++ b/en/gorhom-bottom-sheet.md
@@ -1,4 +1,4 @@
-> 模板版本:v0.2.2
+> Template version: v0.2.2
@gorhom/bottom-sheet
@@ -12,15 +12,15 @@
-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-bottom-sheet)
+> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-bottom-sheet)
-## 安装与使用
+## Installation and Usage
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-library/bottom-sheet Releases](https://github.com/react-native-oh-library/react-native-bottom-sheet/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-library/bottom-sheet Releases](https://github.com/react-native-oh-library/react-native-bottom-sheet/releases).
-#### npm
+#### npm
```bash
npm install @react-native-oh-tpl/bottom-sheet@file:#
@@ -34,19 +34,18 @@ yarn add @react-native-oh-tpl/bottom-sheet@file:#
-下面的代码展示了这个库的基本使用场景:
+The following code shows the basic use scenario of the repository:
->[!WARNING] 使用时 import 的库名不变。
+> [!WARNING] The name of the imported repository remains unchanged.
```jsx
-// bottom-sheet组件
import React, { useCallback, useRef, useMemo } from "react";
import { StyleSheet, View, Text, Button } from "react-native";
import BottomSheet, { BottomSheetView } from "@gorhom/bottom-sheet";
const App = () => {
// hooks
- const sheetRef = useRef(null);
+ const sheetRef = useRef < BottomSheet > null;
// variables
const snapPoints = useMemo(() => ["25%", "50%", "90%"], []);
@@ -91,29 +90,29 @@ const styles = StyleSheet.create({
export default App;
```
+
```jsx
-// bottom-sheet-modal组件
-import React, { useCallback, useMemo, useRef } from 'react';
-import { View, Text, StyleSheet, Button } from 'react-native';
+import React, { useCallback, useMemo, useRef } from "react";
+import { View, Text, StyleSheet, Button } from "react-native";
import {
BottomSheetModal,
BottomSheetView,
BottomSheetModalProvider,
-} from '@gorhom/bottom-sheet';
+} from "@gorhom/bottom-sheet";
const App = () => {
// ref
- const bottomSheetModalRef = useRef(null);
+ const bottomSheetModalRef = useRef < BottomSheetModal > null;
// variables
- const snapPoints = useMemo(() => ['25%', '50%'], []);
+ const snapPoints = useMemo(() => ["25%", "50%"], []);
// callbacks
const handlePresentModalPress = useCallback(() => {
bottomSheetModalRef.current?.present();
}, []);
const handleSheetChanges = useCallback((index: number) => {
- console.log('handleSheetChanges', index);
+ console.log("handleSheetChanges", index);
}, []);
// renders
@@ -144,126 +143,148 @@ const styles = StyleSheet.create({
container: {
flex: 1,
padding: 24,
- justifyContent: 'center',
- backgroundColor: 'grey',
+ justifyContent: "center",
+ backgroundColor: "grey",
},
contentContainer: {
flex: 1,
- alignItems: 'center',
+ alignItems: "center",
},
});
export default App;
```
-## 使用codegen
-本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。
+## Use Codegen
+
+If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/zh-cn/codegen.md).
## Link
-本库鸿蒙侧实现依赖@react-native-oh-tpl/react-native-reanimated和@react-native-oh-tpl/react-native-gesture-handler的原生端代码,如已在鸿蒙工程中引入过该库,则无需再次引入,可跳过本章节步骤,直接使用。
+The HarmonyOS implementation of this library depends on the native code from @react-native-oh-tpl/react-native-reanimated、@react-native-oh-tpl/react-native-gesture-handler. If this library is included into your HarmonyOS application, there is no need to include it again; you can skip the steps in this section and use it directly.
+
+If it is not included, follow the guide provided in [@react-native-oh-tpl/react-native-reanimated docs](/zh-cn/react-native-reanimated.md)、[@react-native-oh-tpl/react-native-gesture-handler docs](/zh-cn/react-native-gesture-handler.md) to add it to your project.
-如未引入请参照[@react-native-oh-tpl/react-native-reanimated 文档](/zh-cn/react-native-reanimated.md)、[@react-native-oh-tpl/react-native-gesture-handler 文档](/zh-cn/react-native-gesture-handler.md)进行引入
+## Constraints
-## 约束与限制
+### Compatibility
-### 兼容性
+This document is verified based on the following versions:
-本文档内容基于以下版本验证通过:
+1.RNOH: 0.72.29; SDK: HarmonyOS-Next-DB1 5.0.0.61; IDE: DevEco Studio 5.0.3.706; ROM: 5.0.0.61;
-1.RNOH: 0.72.29; SDK:HarmonyOS-Next-DB1 5.0.0.61; IDE:DevEco Studio 5.0.3.706; ROM:5.0.0.61;
+## Properties
-## 属性
+> [!Tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
-> [!Tip] "Platform"列表示该属性在原三方库上支持的平台。
+> [!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.
-> [!Tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
### Bottom Sheet
+
#### Configuration
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-|----------------|-------------------------------| -- | -------- | ----------- | ----------------- |
-| index | Initial snap index. You also could provide -1 to initiate bottom sheet in closed state. | number | No | Android / iOS | Yes |
-| snapPoints | Points for the bottom sheet to snap to, points should be sorted from bottom to top. It accepts array of number, string or mix. | Array\| SharedValue> | Yes | Android / iOS | Yes |
-| overDragResistanceFactor | Defines how violently sheet has to be stopped while over dragging. | number | No | Android / iOS | Yes |
-| detached | Defines whether the bottom sheet is attached to the bottom or no. | boolean | No | Android / iOS | Yes |
-| enableContentPanningGesture | Enable content panning gesture interaction. | boolean | No | Android / iOS | Yes |
-| enableHandlePanningGesture | Enable handle panning gesture interaction. | boolean | No | Android / iOS | Yes |
-| enableOverDrag | Enable over drag for the sheet. | boolean | No | Android / iOS | Yes |
-| enablePanDownToClose | Enable pan down gesture to close the sheet. | boolean | No | Android / iOS | Yes |
-| enableDynamicSizing | Enable dynamic sizing for content view and scrollable content size. | boolean | No | Android / iOS | Yes |
-| animateOnMount | This will initially mount the sheet closed and when it's mounted and calculated the layout, it will snap to initial snap point index. | boolean | No | Android / iOS | Yes |
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | -------- | ------------- | ----------------- |
+| index | Initial snap index. You also could provide -1 to initiate bottom sheet in closed state. | number | No | Android / iOS | Yes |
+| snapPoints | Points for the bottom sheet to snap to, points should be sorted from bottom to top. It accepts array of number, string or mix. | Array\| SharedValue> | Yes | Android / iOS | Yes |
+| overDragResistanceFactor | Defines how violently sheet has to be stopped while over dragging. | number | No | Android / iOS | Yes |
+| detached | Defines whether the bottom sheet is attached to the bottom or no. | boolean | No | Android / iOS | Yes |
+| enableContentPanningGesture | Enable content panning gesture interaction. | boolean | No | Android / iOS | Yes |
+| enableHandlePanningGesture | Enable handle panning gesture interaction. | boolean | No | Android / iOS | Yes |
+| enableOverDrag | Enable over drag for the sheet. | boolean | No | Android / iOS | Yes |
+| enablePanDownToClose | Enable pan down gesture to close the sheet. | boolean | No | Android / iOS | Yes |
+| enableDynamicSizing | Enable dynamic sizing for content view and scrollable content size. | boolean | No | Android / iOS | Yes |
+| animateOnMount | This will initially mount the sheet closed and when it's mounted and calculated the layout, it will snap to initial snap point index. | boolean | No | Android / iOS | Yes |
+
#### Styles
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-|----------------|-------------------------------| -- | -------- | ----------- | ----------------- |
-| style | View style to be applied at the sheet container, it also could be an AnimatedStyle. This is helpful to add shadow to the sheet. | ViewStyle \| AnimatedStyle | No | Android / iOS | Yes |
-| backgroundStyle | View style to be applied to the background component. | ViewStyle | No | Android / iOS | Yes |
-| handleStyle | View style to be applied to the handle indicator component. | ViewStyle | No | Android / iOS | Yes |
-| handleIndicatorStyle | View style to be applied to the handle indicator component. | ViewStyle | No | Android / iOS | Yes |
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| -------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -------------------------- | -------- | ------------- | ----------------- |
+| style | View style to be applied at the sheet container, it also could be an AnimatedStyle. This is helpful to add shadow to the sheet. | ViewStyle \| AnimatedStyle | No | Android / iOS | Yes |
+| backgroundStyle | View style to be applied to the background component. | ViewStyle | No | Android / iOS | Yes |
+| handleStyle | View style to be applied to the handle indicator component. | ViewStyle | No | Android / iOS | Yes |
+| handleIndicatorStyle | View style to be applied to the handle indicator component. | ViewStyle | No | Android / iOS | Yes |
+
#### Layout Configuration
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-|----------------|-------------------------------| -- | -------- | ----------- | ----------------- |
-| handleHeight | Handle height helps to calculate the internal container and sheet layouts. If handleComponent is provided, the library internally will calculate its layout, unless handleHeight is provided too. | number | No | Android / iOS | Yes |
-| containerHeight | Container height helps to calculate the internal sheet layouts. If containerHeight not provided, the library internally will calculate it, however this will cause an extra re-rendering. | number | No | Android / iOS | Yes |
-| contentHeight | Content height helps dynamic snap points calculation. | number \| Animated.SharedValue\ | No | Android / iOS | Yes |
-| containerOffset | Container offset helps to accurately detect container offsets. | Animated.SharedValue\ | No | Android / iOS | Yes |
-| topInset | Top inset to be added to the bottom sheet container, usually it comes from @react-navigation/stack hook useHeaderHeight or from react-native-safe-area-context hook useSafeArea. | number | No | Android / iOS | Yes |
-| bottomInset | Bottom inset to be added to the bottom sheet container. | number | No | Android / iOS | Yes |
-| maxDynamicContentSize | Max dynamic content size height to limit the bottom sheet height from exceeding a provided size. | number | No | Android / iOS | Yes |
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | -------- | ------------- | ----------------- |
+| handleHeight | Handle height helps to calculate the internal container and sheet layouts. If handleComponent is provided, the library internally will calculate its layout, unless handleHeight is provided too. | number | No | Android / iOS | Yes |
+| containerHeight | Container height helps to calculate the internal sheet layouts. If containerHeight not provided, the library internally will calculate it, however this will cause an extra re-rendering. | number | No | Android / iOS | Yes |
+| contentHeight | Content height helps dynamic snap points calculation. | number \| Animated.SharedValue\ | No | Android / iOS | Yes |
+| containerOffset | Container offset helps to accurately detect container offsets. | Animated.SharedValue\ | No | Android / iOS | Yes |
+| topInset | Top inset to be added to the bottom sheet container, usually it comes from @react-navigation/stack hook useHeaderHeight or from react-native-safe-area-context hook useSafeArea. | number | No | Android / iOS | Yes |
+| bottomInset | Bottom inset to be added to the bottom sheet container. | number | No | Android / iOS | Yes |
+| maxDynamicContentSize | Max dynamic content size height to limit the bottom sheet height from exceeding a provided size. | number | No | Android / iOS | Yes |
+
#### Keyboard Configuration
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-|----------------|-------------------------------| -- | -------- | ----------- | ----------------- |
-| keyboardBehavior | Defines the keyboard appearance behavior;`extend:` extend the sheet to its maximum snap point;`fillParent:` extend the sheet to fill the parent view;`interactive: `offset the sheet by the size of the keyboard. | 'extend' \| 'fillParent' \| 'interactive' | No | Android / iOS | Yes |
-| keyboardBlurBehavior | Defines the keyboard blur behavior;none: do nothing;restore: restore sheet position | 'none' \| 'restore' | No | Android / iOS | Yes |
-| android_keyboardInputMode | Defines keyboard input mode for Android only. | 'adjustPan' \| 'adjustResize' | No | Android | No |
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- | -------- | ------------- | ----------------- |
+| keyboardBehavior | Defines the keyboard appearance behavior;`extend:` extend the sheet to its maximum snap point;`fillParent:` extend the sheet to fill the parent view;`interactive: `offset the sheet by the size of the keyboard. | 'extend' \| 'fillParent' \| 'interactive' | No | Android / iOS | Yes |
+| keyboardBlurBehavior | Defines the keyboard blur behavior;none: do nothing;restore: restore sheet position | 'none' \| 'restore' | No | Android / iOS | Yes |
+| android_keyboardInputMode | Defines keyboard input mode for Android only. | 'adjustPan' \| 'adjustResize' | No | Android | No |
+
#### Animation Configuration
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-|----------------|-------------------------------| -- | -------- | ----------- | ----------------- |
-| animationConfigs | Animation configs. | function | No | Android/iOS | Yes |
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ---------------- | ------------------ | -------- | -------- | ----------- | ----------------- |
+| animationConfigs | Animation configs. | function | No | Android/iOS | Yes |
+
#### Gesture Configuration
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-|----------------|-------------------------------| -- | -------- | ----------- | ----------------- |
-| waitFor | - | React.Ref \| React.Ref[] | No | Android/iOS | Yes |
-| simultaneousHandlers | - | React.Ref \| React.Ref[] | No | Android/iOS | Yes |
-| activeOffsetX | - | number[] | No | Android/iOS | Yes |
-| activeOffsetY | - | number[] | No | Android/iOS | Yes |
-| failOffsetX | - | number[] | No | Android/iOS | Yes |
-| failOffsetY | - | number[] | No | Android/iOS | Yes |
-| gestureEventsHandlersHook | Custom hook to provide pan gesture events handler, which will allow advance and customize handling for pan gesture. | GestureEventsHandlersHookType | No | Android/iOS | Yes |
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ------------------------- | ------------------------------------------------------------------------------------------------------------------- | ----------------------------- | -------- | ----------- | ----------------- |
+| waitFor | - | React.Ref \| React.Ref[] | No | Android/iOS | Yes |
+| simultaneousHandlers | - | React.Ref \| React.Ref[] | No | Android/iOS | Yes |
+| activeOffsetX | - | number[] | No | Android/iOS | Yes |
+| activeOffsetY | - | number[] | No | Android/iOS | Yes |
+| failOffsetX | - | number[] | No | Android/iOS | Yes |
+| failOffsetY | - | number[] | No | Android/iOS | Yes |
+| gestureEventsHandlersHook | Custom hook to provide pan gesture events handler, which will allow advance and customize handling for pan gesture. | GestureEventsHandlersHookType | No | Android/iOS | Yes |
#### Animated Nodes
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-|----------------|-------------------------------| -- | -------- | ----------- | ----------------- |
-| animatedIndex | Animated value to be used as a callback for the index node internally. | Animated.SharedValue\ | No | Android/iOS | Yes |
-| animatedPosition | Animated value to be used as a callback for the position node internally. | Animated.SharedValue\ | No | Android/iOS | Yes |
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ---------------- | ------------------------------------------------------------------------- | ----------------------------- | -------- | ----------- | ----------------- |
+| animatedIndex | Animated value to be used as a callback for the index node internally. | Animated.SharedValue\ | No | Android/iOS | Yes |
+| animatedPosition | Animated value to be used as a callback for the position node internally. | Animated.SharedValue\ | No | Android/iOS | Yes |
#### Callbacks
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-|----------------|-------------------------------| -- | -------- | ----------- | ----------------- |
-| onChange | Callback when the sheet position changed. | function | No | Android/iOS | Yes |
-| onAnimate | Callback when the sheet about to animate to a new position. | function | No | Android/iOS | Yes |
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| --------- | ----------------------------------------------------------- | -------- | -------- | ----------- | ----------------- |
+| onChange | Callback when the sheet position changed. | function | No | Android/iOS | Yes |
+| onAnimate | Callback when the sheet about to animate to a new position. | function | No | Android/iOS | Yes |
#### Components
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-|----------------|-------------------------------| -- | -------- | ----------- | ----------------- |
-| handleComponent | Component to be placed as a sheet handle. | React.FC\ | No | Android/iOS | Yes |
-| backdropComponent | Component to be placed as a sheet backdrop, by default is set to null, however the library also provide a default implementation BottomSheetBackdrop of a backdrop but you will need to provide it manually. | React.FC\ | No | Android/iOS | Yes |
-| backgroundComponent | Component to be placed as a sheet background. | React.FC\ | No | Android/iOS | Yes |
-| footerComponent | Component to be placed as a sheet footer. | React.FC\ | No | Android/iOS | Yes |
-| children | Scrollable node or react node to be places as a sheet content. | () => React.ReactNode \| React.ReactNode[] \| React.ReactNode | No | Android/iOS | Yes |
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------- | -------- | ----------- | ----------------- |
+| handleComponent | Component to be placed as a sheet handle. | React.FC\ | No | Android/iOS | Yes |
+| backdropComponent | Component to be placed as a sheet backdrop, by default is set to null, however the library also provide a default implementation BottomSheetBackdrop of a backdrop but you will need to provide it manually. | React.FC\ | No | Android/iOS | Yes |
+| backgroundComponent | Component to be placed as a sheet background. | React.FC\ | No | Android/iOS | Yes |
+| footerComponent | Component to be placed as a sheet footer. | React.FC\ | No | Android/iOS | Yes |
+| children | Scrollable node or react node to be places as a sheet content. | () => React.ReactNode \| React.ReactNode[] \| React.ReactNode | No | Android/iOS | Yes |
+
### Bottom Sheet Modal
+
> [!Tip]Bottom Sheet Modal inherits all [Bottom Sheet props](https://ui.gorhom.dev/components/bottom-sheet/props) except for animateOnMount & containerHeight and also it introduces its own props
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-|----------------|-------------------------------| -- | -------- | ----------- | ----------------- |
-| name | Modal name to help identify the modal for later on. | string | No | Android/iOS | Yes |
-| stackBehavior | Defines the stack behavior when modal mounts. | 'push' \| 'replace' | No | Android/iOS | Yes |
-| enableDismissOnClose | Dismiss the modal when it is closed, this will unmount the modal. | boolean | No | Android/iOS | Yes |
-| onDismiss | Callback when the modal dismissed (unmounted). | function | No | Android/iOS | Yes |
-| containerComponent | Component to be placed as a bottom sheet container, this is to place the bottom sheet at the very top layer of your application when using FullWindowOverlay from React Native Screens. | React.ReactNode | No | Android/iOS | Yes |
-## 遗留问题
-- [ ] BottomSheetFlatList组件手势滑动存在冲突 [issue#6](https://github.com/react-native-oh-library/react-native-bottom-sheet/issues/6)
-## 其他
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | -------- | ----------- | ----------------- |
+| name | Modal name to help identify the modal for later on. | string | No | Android/iOS | Yes |
+| stackBehavior | Defines the stack behavior when modal mounts. | 'push' \| 'replace' | No | Android/iOS | Yes |
+| enableDismissOnClose | Dismiss the modal when it is closed, this will unmount the modal. | boolean | No | Android/iOS | Yes |
+| onDismiss | Callback when the modal dismissed (unmounted). | function | No | Android/iOS | Yes |
+| containerComponent | Component to be placed as a bottom sheet container, this is to place the bottom sheet at the very top layer of your application when using FullWindowOverlay from React Native Screens. | React.ReactNode | No | Android/iOS | Yes |
+
+## Known Issues
+
+- [ ] BottomSheetFlatList 组件手势滑动存在冲突 [issue#6](https://github.com/react-native-oh-library/react-native-bottom-sheet/issues/6)
+
+## Others
-## 开源协议
+## License
-本项目基于 [The MIT License (MIT)](hhttps://github.com/gorhom/react-native-bottom-sheet/blob/master/LICENSE) ,请自由地享受和参与开源。
+This project is licensed under [The MIT License (MIT)](hhttps://github.com/gorhom/react-native-bottom-sheet/blob/master/LICENSE).
--
Gitee
From d38016a733edaf7190703a698d5070207842962f Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 14:55:00 +0800
Subject: [PATCH 05/53] docs: [Issues: #IB07UG] react-native-animatable.md
---
en/react-native-animatable.md | 143 ++++++++++++++++++++--------------
1 file changed, 86 insertions(+), 57 deletions(-)
diff --git a/en/react-native-animatable.md b/en/react-native-animatable.md
index 6b168df6..aeac25e3 100644
--- a/en/react-native-animatable.md
+++ b/en/react-native-animatable.md
@@ -1,4 +1,6 @@
-> Template version: v0.2.2
+
+
+> Template version: v0.2.0
react-native-animatable
@@ -14,13 +16,10 @@
> [!TIP] [GitHub address](https://github.com/oblador/react-native-animatable)
-
## Installation and Usage
-
Go to the project directory and execute the following instruction:
-
#### **npm**
@@ -39,82 +38,112 @@ yarn add react-native-animatable@1.4.0
The following code shows the basic use scenario of the repository:
->[!WARNING] The name of the imported repository remains unchanged.
+> [!WARNING] The name of the imported repository remains unchanged.
```js
-import { useState } from 'react';
-import { TouchableOpacity } from 'react-native';
-import * as Animatable from 'react-native-animatable';
+import { useState } from "react";
+import { TouchableOpacity } from "react-native";
+import * as Animatable from "react-native-animatable";
export default function ExampleView() {
- const [textFontSize, setTextFontSize] = useState(10);
- return (
-
- { console.log('test onAnimationBegin') }}
- onAnimationEnd={() => { console.log('test onAnimationEnd') }}
- >Up and down you go
- ❤️
- (*^▽^*)
- setTextFontSize(textFontSize + 5)}>
- { console.log('test onTransitionBegin') }}
- onTransitionEnd={() => { console.log('test onTransitionEnd') }}
- >test
-
-
- )
-}
+ const [textFontSize, setTextFontSize] = useState(10);
+ return (
+
+ {
+ console.log("test onAnimationBegin");
+ }}
+ onAnimationEnd={() => {
+ console.log("test onAnimationEnd");
+ }}
+ >
+ Up and down you go
+
+
+ ❤️
+
+
+ (*^▽^*)
+
+ setTextFontSize(textFontSize + 5)}>
+ {
+ console.log("test onTransitionBegin");
+ }}
+ onTransitionEnd={() => {
+ console.log("test onTransitionEnd");
+ }}
+ >
+ O(∩_∩)O哈哈~
+
+
+
+ );
+}
```
-
-
## Constraints
### 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.
This document is verified based on the following versions:
-1. RNOH:0.72.20; SDK:HarmonyOS NEXT Developer Beta1 B.0.18; IDE:DevEco Studio 5.0.3.200; ROM:2.0.0.18;
+1. RNOH: 0.72.20; SDK: HarmonyOS NEXT Developer Beta1 B.0.18; IDE: DevEco Studio 5.0.3.200; ROM: 2.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] 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
--- | -- | -- | -- | -- | --
-animation | The name of the animation, see Available Animations below | string/undefined | / | all | yes
-duration | Time (milliseconds) the animation will run | number/undefined | / | all | yes
-delay | (Optional) Delay animation (milliseconds) | number/undefined | / | all | yes
-direction | The direction of the animation, especially for repeated animations. Valid values: Normal, Reverse, Alternate, Alternate Reverse | string/undefined | / | all | yes
-easing | The timing function of the animation. Valid values: user-defined function or linear, easy-in, easy-out, easy-in | string/undefined | / | all | yes
-iterationCount | The number of times the animation is run, using infinity for loop animation. | number/undefined | / | all | yes
-iterationDelay | About Pause Time Between Animation Iterations (milliseconds) | number/undefined | / | all | yes
-transition | The style attribute to convert, such as opacity, rotation, or font size. Use an array for multiple properties. | string/array/undefined | / | all | yes
-onAnimationBegin | The function that is called when the animation is started. | Function/undefined | / | all | yes
-onAnimationEnd | Function that is called when the animation is successfully completed or cancelled. The function is called with the endState parameter, see endState.finished to see if the animation is complete. | Function/undefined | / | all | yes
-onTransitionBegin | The function that is called at the beginning of the style conversion. Call functions with property arguments to distinguish styles. | Function/undefined | / | all | yes
-onTransitionEnd | Function that is called when the style conversion is successfully completed or canceled. Call functions with property arguments to distinguish styles. | Function/undefined | / | all | yes
-useNativeDriver | Whether to use native or JavaScript animation drivers. Native drivers can help improve performance, but cannot handle all types of styles. | Function/undefined | / | all | yes
-isInteraction | Whether this animation creates an Interaction Handle on the Interaction Manager. | Boolean | / | all | yes
-
-
-
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ----------------- | --------------------------------------------------------------------------------------------------------------- | ---------------------- | -------- | -------- | ----------------- |
+| animation | 动画的名称,请参见下面的可用动画 | string/undefined | / | all | yes |
+| duration | 动画将运行的时间(毫秒) | number/undefined | / | all | yes |
+| delay | (可选)延迟动画(毫秒) | number/undefined | / | all | yes |
+| direction | 动画的方向,特别适用于重复动画。有效值: 正常、反向、交替、交替反向 | string/undefined | / | all | yes |
+| easing | 动画的计时功能。有效值: 自定义函数或线性、易进、易出、易入 | string/undefined | / | all | yes |
+| iterationCount | 运行动画的次数,对于循环动画使用无穷大。 | number/undefined | / | all | yes |
+| iterationDelay | 关于动画迭代之间的暂停时间(毫秒) | number/undefined | / | all | yes |
+| transition | 要转换的样式属性,例如不透明度、旋转或字体大小。对多个属性使用数组。 | string/array/undefined | / | all | yes |
+| onAnimationBegin | 启动动画时调用的函数。 | Function/undefined | / | all | yes |
+| onAnimationEnd | 当动画成功完成或取消时调用的函数。函数是用 endState 参数调用的,请参阅 endState.finished 以查看动画是否已完成。 | Function/undefined | / | all | yes |
+| onTransitionBegin | 在样式转换开始时调用的函数。使用属性参数调用函数以区分样式。 | Function/undefined | / | all | yes |
+| onTransitionEnd | 当样式转换成功完成或取消时调用的函数。使用属性参数调用函数以区分样式。 | Function/undefined | / | all | yes |
+| useNativeDriver | 是否使用本机或 JavaScript 动画驱动程序。本机驱动程序可以帮助提高性能,但不能处理所有类型的样式。 | Function/undefined | / | all | yes |
+| isInteraction | 此动画是否在交互管理器上创建“交互控制柄”。 | Boolean | / | all | yes |
## Others
## License
-This project is licensed under [The MIT License (MIT)](https://github.com/oblador/react-native-animatable/blob/master/LICENSE) .
+This project is licensed under [The MIT License (MIT)](https://github.com/oblador/react-native-animatable/blob/master/LICENSE).
+
+
--
Gitee
From 6c01889f6aa7551187ee52ceb4c7d64b61264d08 Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 14:55:13 +0800
Subject: [PATCH 06/53] docs: [Issues: #IB07UG]
react-native-apple-authentication.md
---
en/react-native-apple-authentication.md | 176 ++++++++++++------------
1 file changed, 85 insertions(+), 91 deletions(-)
diff --git a/en/react-native-apple-authentication.md b/en/react-native-apple-authentication.md
index 858b71db..f3ddc5af 100644
--- a/en/react-native-apple-authentication.md
+++ b/en/react-native-apple-authentication.md
@@ -1,4 +1,4 @@
-> 模板版本:v0.2.2
+> Template version: v0.2.2
react-native-apple-authentication
@@ -12,25 +12,19 @@
+> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-apple-authentication)
+## 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-library/react-native-apple-authentication Releases](https://github.com/react-native-oh-library/react-native-apple-authentication/releases).
+Go to the project directory and execute the following instruction:
-
-
-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-apple-authentication)
-
-## 安装与使用
-
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-library/react-native-apple-authentication Releases](https://github.com/react-native-oh-library/react-native-apple-authentication/releases),并下载适用版本的 tgz 包。
-
-进入到工程目录并输入以下命令:
-
->[!TIP] # 处替换为 tgz 包的路径
+> [!TIP] Replace the content with the path of the .tgz package at the comment sign (#).
-#### npm
+#### npm
```bash
npm install @react-native-oh-tpl/react-native-apple-authentication@file:#
@@ -43,55 +37,60 @@ yarn add @react-native-oh-tpl/react-native-apple-authentication@file:#
```
#### **配置用于 Web 的“通过 Apple 登录”**
-首先需要进行客户端id配置:[Initial Development Environment Setup](https://github.com/invertase/react-native-apple-authentication/blob/main/docs/INITIAL_SETUP.md)
-然后需要进行服务设置:[Services setup](https://github.com/invertase/react-native-apple-authentication/blob/main/docs/ANDROID_EXTRA.md)
+首先需要进行客户端 id 配置: [Initial Development Environment Setup](https://github.com/invertase/react-native-apple-authentication/blob/main/docs/INITIAL_SETUP.md)
-Apple官方配置说明:[Configure Sign in with Apple for the web](https://developer.apple.com/help/account/configure-app-capabilities/configure-sign-in-with-apple-for-the-web)
+然后需要进行服务设置: [Services setup](https://github.com/invertase/react-native-apple-authentication/blob/main/docs/ANDROID_EXTRA.md)
+
+Apple 官方配置说明: [Configure Sign in with Apple for the web](https://developer.apple.com/help/account/configure-app-capabilities/configure-sign-in-with-apple-for-the-web)
-下面的代码展示了这个库的基本使用场景:
+The following code shows the basic use scenario of the repository:
->[!WARNING] 使用时 import 的库名不变。
+> [!WARNING] The name of the imported repository remains unchanged.
```tsx
-import React from 'react';
-import { appleAuthHarmony, AppleButton } from '@invertase/react-native-apple-authentication';
+import React from "react";
+import {
+ appleAuthHarmony,
+ AppleButton,
+} from "@invertase/react-native-apple-authentication";
const AppleAuthenticationDemo: React.FC = (): JSX.Element => {
- return (
- <>
- {
- appleAuthHarmony.configure({
- // 以下配置请参考原库AppleId登录文档:
- // https://github.com/invertase/react-native-apple-authentication/blob/main/docs/INITIAL_SETUP.md
- // https://github.com/invertase/react-native-apple-authentication/blob/main/docs/ANDROID_EXTRA.md
- clientId: 'com.example.client',
- redirectUri: 'https://example.com'
- })
- const singInRes = await appleAuthHarmony.signIn()
- console.log(singInRes)
- }}
- />
- >
- )
-}
+ return (
+ <>
+ {
+ appleAuthHarmony.configure({
+ // For the following configuration,please refer to the original library AppleId login document:
+ // https://github.com/invertase/react-native-apple-authentication/blob/main/docs/INITIAL_SETUP.md
+ // https://github.com/invertase/react-native-apple-authentication/blob/main/docs/ANDROID_EXTRA.md
+ clientId: "com.example.client",
+ redirectUri: "https://example.com",
+ });
+ const singInRes = await appleAuthHarmony.signIn();
+ console.log(singInRes);
+ }}
+ />
+ >
+ );
+};
export default AppleAuthenticationDemo;
```
-## 使用 Codegen
-本库已经适配了 Codegen ,在使用前需要主动执行生成三方库桥接代码,详细请参考 [Codegen 文档](/zh-cn/codegen.md)。
+## Use Codegen
+
+If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/zh-cn/codegen.md).
## 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
{
@@ -102,18 +101,15 @@ export default AppleAuthenticationDemo;
}
```
-### 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": {
@@ -122,23 +118,22 @@ export default AppleAuthenticationDemo;
}
```
-点击右上角的 `sync` 按钮
+Click the `sync` button in the upper right corner.
-或者在终端执行:
+Alternatively, run the following instruction on the terminal:
```bash
cd entry
ohpm install
```
-方法二:直接链接源码
-
-> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
+Method 2: Directly link to the source code.
+> [!TIP] For details, see [Directly Linking Source Code](/zh-cn/link-source-code.md).
-### 3.在 ArkTs 侧引入 RNAppleAuthPackage
+### 3. Introducing RNAppleAuthPackage to ArkTS
-打开 `entry/src/main/ets/RNPackagesFactory.ets`,添加:
+Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
```diff
...
@@ -152,66 +147,65 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
}
```
-### 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
-### 兼容性
+### 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-library/react-native-apple-authentication Releases](https://github.com/react-native-oh-library/react-native-apple-authentication/releases)。
+Check the release version information in the release address of the third-party library: [@react-native-oh-library/react-native-apple-authentication Releases](https://github.com/react-native-oh-library/react-native-apple-authentication/releases)。
-## 属性
+## 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.
-**AppleButton**:Apple身份验证按钮组件。
+**AppleButton**: Apple 身份验证按钮组件。
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ------------ | ------------------ | ------------------------------------------------------------ | -------- | -------- | ----------------- |
-| style | 按钮样式 | StyleProp< [ViewStyle](https://gitee.com/link?target=https%3A%2F%2Freactnative.dev%2Fdocs%2Fview%23props) > | no | all | yes |
-| textStyle | 按钮内文字样式 | StyleProp< [TextStyle](https://gitee.com/link?target=https%3A%2F%2Freactnative.dev%2Fdocs%2Ftext%23props) > | no | all | yes |
-| cornerRadius | 按钮边框圆角弧度 | number | no | all | yes |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ------------ | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | ----------------- |
+| style | 按钮样式 | StyleProp< [ViewStyle](https://gitee.com/link?target=https%3A%2F%2Freactnative.dev%2Fdocs%2Fview%23props) > | no | all | yes |
+| textStyle | 按钮内文字样式 | StyleProp< [TextStyle](https://gitee.com/link?target=https%3A%2F%2Freactnative.dev%2Fdocs%2Ftext%23props) > | no | all | yes |
+| cornerRadius | 按钮边框圆角弧度 | number | no | all | yes |
| buttonStyle | 按钮样式(预设枚举) | [AppleButtonStyle](https://gitee.com/link?target=https%3A%2F%2Fgithub.com%2Finvertase%2Freact-native-apple-authentication%2Fblob%2Fmain%2Ftypedocs%2Fenums%2FAppleButtonStyle.md) | no | all | yes |
-| buttonType | 按钮类型(预设枚举) | [AppleButtonType](https://gitee.com/link?target=https%3A%2F%2Fgithub.com%2Finvertase%2Freact-native-apple-authentication%2Fblob%2Fmain%2Ftypedocs%2Fenums%2FAppleButtonType.md) | no | all | yes |
-| onPress | 按钮点击事件 | () => void | yes | all | yes |
-| leftView | 按钮内左侧图标 | ReactNode | no | all | yes |
-| buttonText | 按钮内文字内容 | string | no | all | yes |
+| buttonType | 按钮类型(预设枚举) | [AppleButtonType](https://gitee.com/link?target=https%3A%2F%2Fgithub.com%2Finvertase%2Freact-native-apple-authentication%2Fblob%2Fmain%2Ftypedocs%2Fenums%2FAppleButtonType.md) | no | all | yes |
+| onPress | 按钮点击事件 | () => void | yes | all | yes |
+| leftView | 按钮内左侧图标 | ReactNode | no | all | yes |
+| buttonText | 按钮内文字内容 | string | no | all | yes |
## 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.
-**appleAuthHarmony**:Apple身份验证对象,包含2个方法。
+**appleAuthHarmony**: Apple 身份验证对象,包含 2 个方法。
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| --------- | ------------------------------------------------------- | ------------------------------------------------------------ | -------- | -------- | ----------------- |
-| configure | 配置 Apple 身份验证的信息,此接口必须在 signIn 之前调用 | ([Config](https://github.com/invertase/react-native-apple-authentication/blob/main/typedocs/interfaces/AndroidConfig.md)) => void | no | all | yes |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| --------- | ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | ----------------- |
+| configure | 配置 Apple 身份验证的信息,此接口必须在 signIn 之前调用 | ([Config](https://github.com/invertase/react-native-apple-authentication/blob/main/typedocs/interfaces/AndroidConfig.md)) => void | no | all | yes |
| signIn | 弹出 webview 以进行 Apple 身份验证 | () => Promise< [SigninResponse](https://github.com/invertase/react-native-apple-authentication/blob/main/typedocs/interfaces/AndroidSigninResponse.md) > | no | all | no |
-## 其他
-
-## 遗留问题
+## Others
-- [ ] 由于 Apple 开发者账户验证问题,HarmonyOS暂无法实现的接口:[issue#1](https://github.com/react-native-oh-library/react-native-apple-authentication/issues/1)
+## Known Issues
+- [ ] 由于 Apple 开发者账户验证问题,HarmonyOS 暂无法实现的接口: [issue#1](https://github.com/react-native-oh-library/react-native-apple-authentication/issues/1)
-## 开源协议
+## License
-本项目基于 [Apache License 2.0](https://github.com/invertase/react-native-apple-authentication/blob/main/LICENSE) ,请自由地享受和参与开源。
\ No newline at end of file
+This project is licensed under [Apache License 2.0](https://github.com/invertase/react-native-apple-authentication/blob/main/LICENSE).
--
Gitee
From c9ff32abf9cde0606ab2c2d4ddade3b90d70f3e2 Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 14:55:23 +0800
Subject: [PATCH 07/53] docs: [Issues: #IB07UG] react-native-audio-toolkit.md
---
en/react-native-audio-toolkit.md | 372 +++++++++++++++++--------------
1 file changed, 202 insertions(+), 170 deletions(-)
diff --git a/en/react-native-audio-toolkit.md b/en/react-native-audio-toolkit.md
index 980e78e2..d0c3140c 100644
--- a/en/react-native-audio-toolkit.md
+++ b/en/react-native-audio-toolkit.md
@@ -1,6 +1,6 @@
-> 模板版本:v0.2.2
+> Template version: v0.2.2
@react-native-community/audio-toolkit
@@ -14,16 +14,15 @@
+> [!tip] [GitHub address](https://github.com/react-native-oh-library/react-native-audio-toolkit)
-> [!tip] [Github 地址](https://github.com/react-native-oh-library/react-native-audio-toolkit)
+## 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/audio-toolkit Releases](https://github.com/react-native-oh-library/react-native-audio-toolkit/releases).
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/audio-toolkit Releases](https://github.com/react-native-oh-library/react-native-audio-toolkit/releases),并下载适用版本的 tgz 包。
+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 (#).
@@ -41,40 +40,54 @@ yarn add @react-native-oh-tpl/audio-toolkit@file:#
-下面的代码展示了这个库的基本使用场景:
+The following code shows the basic use scenario of the repository:
-> [!WARNING] 使用时 import 的库名不变。
+> [!WARNING] The name of the imported repository remains unchanged.
-> [!TIP] # demo使用了三方库[@react-native-oh-tpl/react-native-slider](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-slider.md)
+> [!TIP] # demo 使用了三方库[@react-native-oh-tpl/react-native-slider](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-slider.md)
-> [!TIP] # demo使用了权限三方库[@react-native-oh-tpl/react-native-permissions](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-permissions.md)
+> [!TIP] # demo 使用了权限三方库[@react-native-oh-tpl/react-native-permissions](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-permissions.md)
```tsx
-import React, { Component } from 'react';
-import { Button, PermissionsAndroid, Platform, StyleSheet, Switch, Text, View, ScrollView } from 'react-native';
-import Slider from '@react-native-oh-tpl/react-native-slider';
-import { Player, Recorder, MediaStates } from '@react-native-community/audio-toolkit';
-import RTNPermissions, {RESULTS} from "@react-native-oh-tpl/react-native-permissions";
-
-const filename = 'test.mp4';
-
+import React, { Component } from "react";
+import {
+ Button,
+ PermissionsAndroid,
+ Platform,
+ StyleSheet,
+ Switch,
+ Text,
+ View,
+ ScrollView,
+} from "react-native";
+import Slider from "@react-native-oh-tpl/react-native-slider";
+import {
+ Player,
+ Recorder,
+ MediaStates,
+} from "@react-native-community/audio-toolkit";
+import RTNPermissions, {
+ RESULTS,
+} from "@react-native-oh-tpl/react-native-permissions";
+
+const filename = "test.mp4";
type Props = {};
type State = {
- playPauseButton: string,
- recordButton: string,
+ playPauseButton: string;
+ recordButton: string;
- stopButtonDisabled: boolean,
- playButtonDisabled: boolean | undefined,
- recordButtonDisabled: boolean,
+ stopButtonDisabled: boolean;
+ playButtonDisabled: boolean | undefined;
+ recordButtonDisabled: boolean;
- recordPauseButtonDisabled: boolean,
+ recordPauseButtonDisabled: boolean;
- loopButtonStatus: boolean,
- progress: number,
+ loopButtonStatus: boolean;
+ progress: number;
- error: string | null
+ error: string | null;
};
export default class App extends Component {
@@ -87,18 +100,18 @@ export default class App extends Component {
super(props);
this.state = {
- playPauseButton: 'Preparing...',
- recordButton: 'Preparing...',
+ playPauseButton: "Preparing...",
+ recordButton: "Preparing...",
stopButtonDisabled: true,
playButtonDisabled: true,
recordButtonDisabled: true,
- recordPauseButtonDisabled:true,
+ recordPauseButtonDisabled: true,
loopButtonStatus: false,
progress: 0,
- error: null
+ error: null,
};
}
@@ -111,7 +124,8 @@ export default class App extends Component {
this._progressInterval = setInterval(() => {
if (this.player && this._shouldUpdateProgressBar()) {
- let currentProgress = Math.max(0, this.player.currentTime) / this.player.duration;
+ let currentProgress =
+ Math.max(0, this.player.currentTime) / this.player.duration;
if (isNaN(currentProgress)) {
currentProgress = 0;
}
@@ -132,16 +146,18 @@ export default class App extends Component {
}
_updateState() {
-
this.setState({
- playPauseButton: this.player && this.player.isPlaying ? 'Pause' : 'Play',
- recordButton: this.recorder && this.recorder.isRecording ? 'Stop' : 'Record',
+ playPauseButton: this.player && this.player.isPlaying ? "Pause" : "Play",
+ recordButton:
+ this.recorder && this.recorder.isRecording ? "Stop" : "Record",
recordPauseButtonDisabled: !this.recorder || !this.recorder.isRecording,
stopButtonDisabled: !this.player || !this.player.canStop,
- playButtonDisabled: !this.player || !this.player.canPlay || this.recorder?.isRecording,
- recordButtonDisabled: (!this.recorder || (this.player && !this.player.isStopped)) ?? true,
+ playButtonDisabled:
+ !this.player || !this.player.canPlay || this.recorder?.isRecording,
+ recordButtonDisabled:
+ (!this.recorder || (this.player && !this.player.isStopped)) ?? true,
});
}
@@ -149,7 +165,7 @@ export default class App extends Component {
this.player?.playPause((err, paused) => {
if (err) {
this.setState({
- error: err.message
+ error: err.message,
});
}
this._updateState();
@@ -170,7 +186,7 @@ export default class App extends Component {
this.lastSeek = Date.now();
let position = percentage * this.player.duration;
- this.player.seek(position, () => { });
+ this.player.seek(position, () => {});
}
_getPlayPath() {
@@ -185,10 +201,10 @@ export default class App extends Component {
this.player.destroy();
}
this.player = new Player(this._getPlayPath(), {
- autoDestroy: false
+ autoDestroy: false,
}).prepare((err) => {
if (err) {
- console.log('error at _reloadPlayer():');
+ console.log("error at _reloadPlayer():");
console.log(err);
} else {
if (this.player) {
@@ -201,10 +217,10 @@ export default class App extends Component {
this._updateState();
- this.player.on('ended', () => {
+ this.player.on("ended", () => {
this._updateState();
});
- this.player.on('pause', () => {
+ this.player.on("pause", () => {
this._updateState();
});
}
@@ -218,44 +234,46 @@ export default class App extends Component {
bitrate: 256000,
channels: 2,
sampleRate: 44100,
- quality: 'max'
+ quality: "max",
});
this._updateState();
}
_toggleRecord() {
- if(this.recorder && this.recorder.state === MediaStates.PAUSED){
+ if (this.recorder && this.recorder.state === MediaStates.PAUSED) {
this.recorder?.record((err) => {
this._updateState();
- })
- return
+ });
+ return;
}
if (this.player) {
this.player.destroy();
}
let recordAudioRequest;
- if (Platform.OS == 'android') {
+ if (Platform.OS == "android") {
recordAudioRequest = this._requestRecordAudioPermission();
- } else if (Platform.OS === 'harmony') {
+ } else if (Platform.OS === "harmony") {
recordAudioRequest = this._requestRecordAudioPermissionHs();
} else {
- recordAudioRequest = new Promise(function (resolve, reject) { resolve(true); });
+ recordAudioRequest = new Promise(function (resolve, reject) {
+ resolve(true);
+ });
}
recordAudioRequest.then((hasPermission) => {
if (!hasPermission) {
this.setState({
- error: 'Record Audio Permission was denied'
+ error: "Record Audio Permission was denied",
});
return;
}
-
+
this.recorder?.toggleRecord((err, stopped) => {
if (err) {
this.setState({
- error: err.message
+ error: err.message,
});
}
if (stopped) {
@@ -267,10 +285,9 @@ export default class App extends Component {
});
}
-
async _requestRecordAudioPermissionHs() {
try {
- let check = await RTNPermissions.request('ohos.permission.MICROPHONE');
+ let check = await RTNPermissions.request("ohos.permission.MICROPHONE");
console.info("RTNPermissions===== request", check);
if (check === RESULTS.GRANTED) {
return true;
@@ -288,12 +305,13 @@ export default class App extends Component {
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,
{
- title: 'Microphone Permission',
- message: 'ExampleApp needs access to your microphone to test react-native-audio-toolkit.',
- buttonNeutral: 'Ask Me Later',
- buttonNegative: 'Cancel',
- buttonPositive: 'OK',
- },
+ title: "Microphone Permission",
+ message:
+ "ExampleApp needs access to your microphone to test react-native-audio-toolkit.",
+ buttonNeutral: "Ask Me Later",
+ buttonNegative: "Cancel",
+ buttonPositive: "OK",
+ }
);
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
return true;
@@ -308,7 +326,7 @@ export default class App extends Component {
_toggleLooping(value: boolean) {
this.setState({
- loopButtonStatus: value
+ loopButtonStatus: value,
});
if (this.player) {
this.player.looping = value;
@@ -319,38 +337,56 @@ export default class App extends Component {
return (
-
- Playback
-
+ Playback
-
-
+ );
};
const styles = StyleSheet.create({
- container: {
- flex: 1
- }
-
+ container: {
+ flex: 1,
+ },
});
export default App;
```
-## 约束与限制
+## 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-better-banner Releases](https://github.com/react-native-oh-library/better-banner/releases)
+Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-better-banner Releases](https://github.com/react-native-oh-library/better-banner/releases)
-## 属性
+## 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 | Default | Platform | HarmonyOS Support |
-| --------------------------------- | ------------------------------------------------------------ | -------- | --------------------- | -------- | ----------------- |
-| bannerImages | 用于展示轮播图片, 与`bannerComponents`二选一 | Array | [] | All | Yes |
-| bannerComponents | 用于展示轮播自定义组件,与`bannerImages`二选一 | Array | [] | All | Yes |
-| bannerHeight | banner的默认高度 | Number | 250 | All | Yes |
-| bannerTitles | 每张图片或组件对应的标题 | Array | [] | All | Yes |
-| bannerTitleTextColor | 每张图片或组件对应的标题的文字颜色 | String | #fff | All | Yes |
-| bannerTitleTextSize | 每张图片或组件对应的标题的文字大小 | Number | 2000 | All | Yes |
-| isAutoScroll | 是否开启自动轮播 | Boolean | true | All | Yes |
-| isSeamlessScroll | 是否开启无缝滚动(iOS下正常,安卓某些机型可能出现滚动异常) | Boolean | false | All | Yes |
-| adaptSeamlessScrollValue | 如果开启无缝滚动在某些机型滚动异常,可针对这些机型设置`true` 或 `false`, 此值实际上是设置是否显示`ScrollView`的`scrollTo`的滚动动画 | Boolean | false | All | Yes |
-| indicatorWidth | 指示器宽度 | Number | 10 | All | Yes |
-| indicatorHeight | 指示器高度 | Number | 6 | All | Yes |
-| indicatorColor | 指示器颜色 | String | rgba(255,255,255,0.6) | All | Yes |
-| indicatorStyle | 指示器样式,您也可以直接使用此属性一次性设置指示器宽、高、颜色和圆角等,它会覆盖以上`indicatorWidth`,`indicatorHeight`,`indicatorColor`属性 | Object | {} | No | No |
-| indicatorGap | 指示器之间的间隔 | Number | 6 | All | Yes |
-| activeIndicatorColor | 活动指示器颜色 | String | #fff | All | Yes |
-| indicatorGroupPosition | 指示器组的位置,可设置`left`,`center`,`right`。如果您设置了`bannerTitles`,则此属性只能是`right` | String | right | All | Yes |
-| indicatorGroupSideOffset | 指示器组的左右边距 | Number | 10 | All | Yes |
-| indicatorContainerHeight | 指示器容器高度 | Number | 32 | All | Yes |
-| indicatorContainerBackgroundColor | 指示器容器背景色 | String | transparent | All | Yes |
-| onPress() | 点击轮播图后的回调函数,会传回banner的`index` | Function | ()=>{} | All | Yes |
-| onScrollEnd() | 滚动完每张轮播图的回调函数,等同于`ScrollView`的`onMomentumScrollEnd` | Function | ()=>{} | All | Yes |
+| Name | Description | Type | Default | Platform | HarmonyOS Support |
+| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------- | --------------------- | -------- | ----------------- |
+| bannerImages | 用于展示轮播图片, 与`bannerComponents`二选一 | Array | [] | All | Yes |
+| bannerComponents | 用于展示轮播自定义组件,与`bannerImages`二选一 | Array | [] | All | Yes |
+| bannerHeight | banner 的默认高度 | Number | 250 | All | Yes |
+| bannerTitles | 每张图片或组件对应的标题 | Array | [] | All | Yes |
+| bannerTitleTextColor | 每张图片或组件对应的标题的文字颜色 | String | #fff | All | Yes |
+| bannerTitleTextSize | 每张图片或组件对应的标题的文字大小 | Number | 2000 | All | Yes |
+| isAutoScroll | 是否开启自动轮播 | Boolean | true | All | Yes |
+| isSeamlessScroll | 是否开启无缝滚动(iOS 下正常,安卓某些机型可能出现滚动异常) | Boolean | false | All | Yes |
+| adaptSeamlessScrollValue | 如果开启无缝滚动在某些机型滚动异常,可针对这些机型设置`true` 或 `false`, 此值实际上是设置是否显示`ScrollView`的`scrollTo`的滚动动画 | Boolean | false | All | Yes |
+| indicatorWidth | 指示器宽度 | Number | 10 | All | Yes |
+| indicatorHeight | 指示器高度 | Number | 6 | All | Yes |
+| indicatorColor | 指示器颜色 | String | rgba(255,255,255,0.6) | All | Yes |
+| indicatorStyle | 指示器样式,您也可以直接使用此属性一次性设置指示器宽、高、颜色和圆角等,它会覆盖以上`indicatorWidth`,`indicatorHeight`,`indicatorColor`属性 | Object | {} | All | Yes |
+| indicatorGap | 指示器之间的间隔 | Number | 6 | All | Yes |
+| activeIndicatorColor | 活动指示器颜色 | String | #fff | All | Yes |
+| indicatorGroupPosition | 指示器组的位置,可设置`left`,`center`,`right`。如果您设置了`bannerTitles`,则此属性只能是`right` | String | right | All | Yes |
+| indicatorGroupSideOffset | 指示器组的左右边距 | Number | 10 | All | Yes |
+| indicatorContainerHeight | 指示器容器高度 | Number | 32 | All | Yes |
+| indicatorContainerBackgroundColor | 指示器容器背景色 | String | transparent | All | Yes |
+| onPress() | 点击轮播图后的回调函数,会传回 banner 的`index` | Function | ()=>{} | All | Yes |
+| onScrollEnd() | 滚动完每张轮播图的回调函数,等同于`ScrollView`的`onMomentumScrollEnd` | Function | ()=>{} | All | Yes |
-## 遗留问题
-- [ ] indicatorStyle属性问题:源码逻辑有问题导致属性失效。[issue#11](https://github.com/react-native-oh-library/better-banner/issues/11)
+## Known Issues
-## 其他
+## Others
-## 开源协议
+## License
-本项目基于 [The ISC License (ISC)](https://www.isc.org/licenses/) ,请自由地享受和参与开源。
+This project is licensed under [The ISC License (ISC)](https://www.isc.org/licenses/).
--
Gitee
From ab4243eba1216cafe872c6b6538d5df1600e381e Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 14:55:42 +0800
Subject: [PATCH 09/53] docs: [Issues: #IB07UG] react-native-bootsplash.md
---
en/react-native-bootsplash.md | 148 ++++++++++++++++++----------------
1 file changed, 77 insertions(+), 71 deletions(-)
diff --git a/en/react-native-bootsplash.md b/en/react-native-bootsplash.md
index 13643d61..7a30e653 100644
--- a/en/react-native-bootsplash.md
+++ b/en/react-native-bootsplash.md
@@ -1,4 +1,4 @@
-> 模板版本:v0.2.2
+> Template version: v0.2.2
react-native-bootsplash
@@ -13,17 +13,15 @@
+> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-bootsplash)
+## Installation and Usage
-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-bootsplash)
+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-bootsplash Releases](https://github.com/react-native-oh-library/react-native-bootsplash/releases).
-## 安装与使用
+Go to the project directory and execute the following instruction:
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-bootsplash Releases](https://github.com/react-native-oh-library/react-native-bootsplash/releases),并下载适用版本的 tgz 包。
-
-进入到工程目录并输入以下命令:
-
-> [!TIP] # 处替换为 tgz 包的路径
+> [!TIP] Replace the content with the path of the .tgz package at the comment sign (#).
@@ -40,7 +38,8 @@ yarn add @react-native-oh-tpl/react-native-bootsplash@file:#
```
#### 生成配置文件
-为了加快设置速度,我们提供了一个CLI来自动生成配置、创建Android Drawable XML文件、iOS Storyboard文件和HarmonyOS Resources文件
+
+为了加快设置速度,我们提供了一个 CLI 来自动生成配置、创建 Android Drawable XML 文件、iOS Storyboard 文件和 HarmonyOS Resources 文件
```bash
$ npx react-native generate-bootsplash --help
@@ -80,6 +79,7 @@ npx react-native generate-bootsplash svgs/light-logo.svg
```
命令执行后将创建以下文件:
+
```js
# Without license key
android/app/src/main/res/drawable-mdpi/bootsplash_logo.png
@@ -114,7 +114,7 @@ assets/bootsplash/logo@3x.png
assets/bootsplash/logo@4x.png
```
-编辑您的启动Ability文件, 它通常是配置在entry模块module.json5中abilities属性中配置的第一个abilitie:
+编辑您的启动 Ability 文件, 它通常是配置在 entry 模块 module.json5 中 abilities 属性中配置的第一个 abilitie:
```diff
+ import { window } from '@kit.ArkUI';
@@ -133,15 +133,23 @@ export default class EntryAbility extends RNAbility {
-下面的代码展示了这个库的基本使用场景:
+The following code shows the basic use scenario of the repository:
-> [!WARNING] 使用时 import 的库名不变。
+> [!WARNING] The name of the imported repository remains unchanged.
-> [!TIP] 示例中logo参数使用了本地图片资源,可以到[react-native-boot-splash demo](https://github.com/react-native-oh-library/RNOHDCS/tree/main/react-native-boot-splash/source)获取该图片
+> [!TIP] 示例中 logo 参数使用了本地图片资源,可以到[react-native-boot-splash demo](https://github.com/react-native-oh-library/RNOHDCS/tree/main/react-native-boot-splash/source)获取该图片
```js
-import { useState , useEffect} from "react";
-import { Animated, View, Text, Dimensions, Platform, StatusBar, StyleSheet } from "react-native";
+import { useState, useEffect } from "react";
+import {
+ Animated,
+ View,
+ Text,
+ Dimensions,
+ Platform,
+ StatusBar,
+ StyleSheet,
+} from "react-native";
import BootSplash from "react-native-bootsplash";
const styles = StyleSheet.create({
@@ -162,7 +170,7 @@ const styles = StyleSheet.create({
});
type Props = {
- onAnimationEnd: () => void;
+ onAnimationEnd: () => void,
};
export const AnimatedBootSplash = ({ onAnimationEnd }: Props) => {
@@ -223,7 +231,7 @@ const App = () => {
{
BootSplash.isVisible();
- console.log("--------++++AnimationEnd")
+ console.log("--------++++AnimationEnd");
setVisible(false);
}}
/>
@@ -247,17 +255,17 @@ export default App;
}
```
-## 使用 Codegen
+## Use Codegen
-本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。
+If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/zh-cn/codegen.md).
## 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
{
@@ -268,18 +276,15 @@ export default App;
}
```
-### 2.引入原生端代码
-
-目前有两种方法:
+### 2. Introducing Native Code
-1. 通过 har 包引入(在 IDE 完善相关功能后该方法会被遗弃,目前首选此方法);
-2. 直接链接源码。
+Currently, two methods are available:
-方法一:通过 har 包引入(推荐)
+Method 1 (recommended): Use the HAR file.
-> [!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": {
@@ -288,22 +293,22 @@ export default App;
}
```
-点击右上角的 `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](/zh-cn/link-source-code.md).
-### 3.在 ArkTs 侧引入 RNBootSplashPackage
+### 3. Introducing RNBootSplashPackage to ArkTS
-打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
+Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
```diff
...
@@ -317,38 +322,38 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
}
```
-### 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
-### 兼容性
+### 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-bootsplash Releases](https://github.com/react-native-oh-library/react-native-bootsplash/releases)
+Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-bootsplash Releases](https://github.com/react-native-oh-library/react-native-bootsplash/releases)
## 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 |
-| ---------------- | ------------------------------------------------------------ | -------- | -------- | ------------ | ----------------- |
-| hide | Hide the splash screen. | function | no | Android、IOS | yes |
-| isVisible | Return the current visibility status of the native splash screen. | function | no | Android、IOS | yes |
-| useHideAnimation | A hook to easily create a custom hide animation by animating all splash screen elements using Animated, react-native-reanimated or else (similar as the video on top of this documentation). | function | no | Android、IOS | yes |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | ------------ | ----------------- |
+| hide | Hide the splash screen. | function | no | Android、IOS | yes |
+| isVisible | Return the current visibility status of the native splash screen. | function | no | Android、IOS | yes |
+| useHideAnimation | A hook to easily create a custom hide animation by animating all splash screen elements using Animated, react-native-reanimated or else (similar as the video on top of this documentation). | function | no | Android、IOS | yes |
### hide
@@ -356,9 +361,9 @@ ohpm install
type hide = (config?: { fade?: boolean }) => Promise;
```
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ----- | ---------------------------------------------------------- | ---------------- | -------- | ----------- | ----------------- |
-| fade | Hide the splash screen (immediately, or with a fade out). | boolean | No | iOS/Android | partially |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ---- | --------------------------------------------------------- | ------- | -------- | ----------- | ----------------- |
+| fade | Hide the splash screen (immediately, or with a fade out). | boolean | No | iOS/Android | partially |
### useHideAnimation
@@ -366,25 +371,26 @@ type hide = (config?: { fade?: boolean }) => Promise;
useHideAnimation(config: {UseHideAnimationConfig}) => {container: ContainerProps;logo: LogoProps;brand: BrandProps;};
```
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ----- | ---------------------------------------------------------- | ---------------- | -------- | ----------- | ----------------- |
-| ready | a boolean flag to delay the animate execution (default: true) | boolean | No | iOS/Android | partially |
-| manifest | the manifest file is generated in your assets directory | Manifest | Yes | iOS/Android | partially |
-| logo | logo image in animation | ImageRequireSource | No | iOS/Android | partially |
-| darkLogo | logo image in animation in dark mode | ImageRequireSource | No | iOS/Android | partially |
-| brand | brand image in animation | ImageRequireSource | No | iOS/Android | partially |
-| darkBrand | brand image in animation in dark mode | ImageRequireSource | No | iOS/Android | partially |
-| statusBarTranslucent | sets whether the status bar is transparent | boolean | No | iOS/Android | partially |
-| navigationBarTranslucent | sets whether the navigation bar is transparent | boolean | No | iOS/Android | partially |
-| animate | custom hide animation | function | Yes | iOS/Android | partially |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ------------------------ | ------------------------------------------------------------- | ------------------ | -------- | ----------- | ----------------- |
+| ready | a boolean flag to delay the animate execution (default: true) | boolean | No | iOS/Android | partially |
+| manifest | the manifest file is generated in your assets directory | Manifest | Yes | iOS/Android | partially |
+| logo | logo image in animation | ImageRequireSource | No | iOS/Android | partially |
+| darkLogo | logo image in animation in dark mode | ImageRequireSource | No | iOS/Android | partially |
+| brand | brand image in animation | ImageRequireSource | No | iOS/Android | partially |
+| darkBrand | brand image in animation in dark mode | ImageRequireSource | No | iOS/Android | partially |
+| statusBarTranslucent | sets whether the status bar is transparent | boolean | No | iOS/Android | partially |
+| navigationBarTranslucent | sets whether the navigation bar is transparent | boolean | No | iOS/Android | partially |
+| animate | custom hide animation | function | Yes | iOS/Android | partially |
+
+## Known Issues
-## 遗留问题
+- [ ] HarmonyOS 的 window 窗口上不支持设置动画属性,hide 接口 fade 参数设置 true 没有效果 问题: [issue#13](https://github.com/react-native-oh-library/react-native-bootsplash/issues/13)
-- [ ] HarmonyOS的window窗口上不支持设置动画属性,hide接口fade参数设置true没有效果 问题: [issue#13](https://github.com/react-native-oh-library/react-native-bootsplash/issues/13)
+## Others
-## 其他
-- 执行generate-bootsplash命令行时,由于 `--brand, --brand-width 和 --dark-*` 选项需要购买license才能使用,涉及功能未开源,HarmonyOS平台不支持使用
+- 执行 generate-bootsplash 命令行时,由于 `--brand, --brand-width 和 --dark-*` 选项需要购买 license 才能使用,涉及功能未开源,HarmonyOS 平台不支持使用
-## 开源协议
+## License
-本项目基于 [The MIT License (MIT)](https://github.com/zoontek/react-native-bootsplash/blob/master/LICENSE) ,请自由地享受和参与开源。
\ No newline at end of file
+This project is licensed under [The MIT License (MIT)](https://github.com/zoontek/react-native-bootsplash/blob/master/LICENSE).
--
Gitee
From 0a822cdb31e964ec11bc92f00264d980037829e1 Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 14:55:50 +0800
Subject: [PATCH 10/53] docs: [Issues: #IB07UG] react-native-camera-kit.md
---
en/react-native-camera-kit.md | 225 ++++++++++++++++------------------
1 file changed, 109 insertions(+), 116 deletions(-)
diff --git a/en/react-native-camera-kit.md b/en/react-native-camera-kit.md
index b62c5b45..4556b80d 100644
--- a/en/react-native-camera-kit.md
+++ b/en/react-native-camera-kit.md
@@ -12,21 +12,19 @@
-
-
-> [!TIP] [Github address](https://github.com/react-native-oh-library/react-native-camera-kit)
+> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-camera-kit)
## 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-library/react-native-camera-kit Releases](https://github.com/react-native-oh-library/react-native-camera-kit/releases)
+Find the matching version information in the release address of a third-party library and download an applicable .tgz package: [@react-native-oh-library/react-native-camera-kit Releases](https://github.com/react-native-oh-library/react-native-camera-kit/releases).
Go to the project directory and execute the following instruction:
->[!TIP] Replace the content with the path of the .tgz package at the comment sign (#).
+> [!TIP] Replace the content with the path of the .tgz package at the comment sign (#).
-#### npm
+#### npm
```bash
npm install @react-native-oh-tpl/react-native-camera-kit@file:#
@@ -43,17 +41,19 @@ yarn add @react-native-oh-tpl/react-native-camera-kit@file:#
The following code shows the basic use scenario of the repository:
> [!WARNING] The name of the imported repository remains unchanged.
+
### camera example
-``` js
-import React, {useRef, useState} from 'react';
-import {Text, StyleSheet, View, Button} from 'react-native';
-import {CameraApi, CameraType,Camera} from 'react-native-camera-kit';
+
+```js
+import React, { useRef, useState } from "react";
+import { Text, StyleSheet, View, Button } from "react-native";
+import { CameraApi, CameraType, Camera } from "react-native-camera-kit";
export const CameraDemo: React.FC = (): JSX.Element => {
- const nativeRef = useRef(null);
- const [zoom, setZoom] = useState(0);
- const [errorStr, setErrorStr] = useState('');
- const [photo, setPhoto] = useState('');
+ const nativeRef = useRef < CameraApi > null;
+ const [zoom, setZoom] = useState < number > 0;
+ const [errorStr, setErrorStr] = useState < string > "";
+ const [photo, setPhoto] = useState < string > "";
const onError = (e: any) => {
setErrorStr(e.nativeEvent.errorMessage);
@@ -72,7 +72,7 @@ export const CameraDemo: React.FC = (): JSX.Element => {
<>
{
/>
-
+ zoom:{zoom}error:{errorStr}photo:{photo}
@@ -94,24 +94,25 @@ export const CameraDemo: React.FC = (): JSX.Element => {
const styles = StyleSheet.create({
text: {
fontSize: 20,
- textAlign: 'center',
- color: '#000',
+ textAlign: "center",
+ color: "#000",
marginTop: 10,
},
});
-
```
+
### scanCode example
-``` js
-import React, {useRef, useState} from 'react';
-import {Text, StyleSheet, View} from 'react-native';
-import {CameraApi, CameraType,Camera} from 'react-native-camera-kit';
+
+```js
+import React, { useRef, useState } from "react";
+import { Text, StyleSheet, View } from "react-native";
+import { CameraApi, CameraType, Camera } from "react-native-camera-kit";
export const ScanCodeDemo: React.FC = (): JSX.Element => {
- const nativeRef = useRef(null);
- const [zoomStr, setZoomStr] = useState(0);
- const [errorStr, setErrorStr] = useState('');
- const [codeResult, setCodeResult] = useState('');
+ const nativeRef = useRef < CameraApi > null;
+ const [zoomStr, setZoomStr] = useState < number > 0;
+ const [errorStr, setErrorStr] = useState < string > "";
+ const [codeResult, setCodeResult] = useState < string > "";
const onError = (e: any) => {
setErrorStr(e.nativeEvent.errorMessage);
@@ -129,7 +130,7 @@ export const ScanCodeDemo: React.FC = (): JSX.Element => {
<>
{
const styles = StyleSheet.create({
text: {
fontSize: 20,
- textAlign: 'center',
- color: '#000',
+ textAlign: "center",
+ color: "#000",
marginTop: 10,
},
});
-
-
```
-
## Link
Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking.
@@ -183,7 +181,6 @@ Open the `harmony` directory of the HarmonyOS project in DevEco Studio.
Currently, two methods are available:
-
Method 1 (recommended): Use the HAR file.
> [!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library.
@@ -210,9 +207,9 @@ Method 2: Directly link to the source code.
> [!TIP] For details, see [Directly Linking Source Code](/zh-cn/link-source-code.md).
-### 3. Configuring CMakeLists and Introducing xxx Package
+### 3. Introducing RTNCameraKitView Component to ArkTS
-Open `entry/src/main/cpp/CMakeLists.txt` and add the following code:
+Find `function buildCustomRNComponent()`, which is usually located in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets`, and add the following code:
```diff
...
@@ -230,17 +227,14 @@ export function buildCustomRNComponent(ctx: ComponentBuilderContext) {
...
}
...
-> [!TIP] If the repository uses a mixed solution, the component name needs to be added.
+```
-Find the constant `arkTsComponentNames` in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets` and add the component name to the array.
+在`entry/src/main/ets/pages/index.ets`中,如果当前文件中存在`arkTsComponentNames`数组(后续版本新增内容),则需要在其中追加: `RTNCameraKitView.NAME`;
-```diff
-const arkTsComponentNames: Array = [
- SampleView.NAME,
- GeneratedSampleView.NAME,
- PropsDisplayer.NAME,
-+ RTNCameraKitView.NAME
- ];
+```ts
+ ...
+ const arkTsComponentNames: Array = [..., RTNCameraKitView.NAME];
+ ...
```
### 4. Introducing RTNCameraKitPackage to ArkTS
@@ -278,15 +272,15 @@ Then build and run the code.
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-library/react-native-camera-kit Releases](https://github.com/react-native-oh-library/react-native-camera-kit/releases)
+Check the release version information in the release address of the third-party library: [@react-native-oh-library/react-native-camera-kit Releases](https://github.com/react-native-oh-library/react-native-camera-kit/releases)
### Permission Requirements
-The following permissions include the `system_basic` permission, but the default application permission is `normal`. Only the `normal` permission can be used. Therefore, the error * 9568289 * * * may be reported during the installation of the HAP package. For details, see [Document](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/bm-tool-V5#ZH-CN_TOPIC_0000001884757326__%E5%AE%89%E8%A3%85hap%E6%97%B6%E6%8F%90%E7%A4%BAcode9568289-error-install-failed-due-to-grant-request-permissions-failed) Change the application level to `system_basic`.
+以下权限中有`system_basic` 权限,而默认的应用权限是 `normal` ,只能使用 `normal` 等级的权限,所以可能会在安装 hap 包时报错**9568289**,请参考 [文档](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/bm-tool-V5#ZH-CN_TOPIC_0000001884757326__%E5%AE%89%E8%A3%85hap%E6%97%B6%E6%8F%90%E7%A4%BAcode9568289-error-install-failed-due-to-grant-request-permissions-failed) 修改应用等级为 `system_basic`
-#### Add permissions to the module.json5 file in the entry directory.
+#### Include applicable permissions in the module.json5 file within the entry directory.
-Open `entry/src/main/module.json5` and add the following information:
+Open the `entry/src/main/module.json5` file and add the following code:
```diff
...
@@ -324,9 +318,9 @@ Open `entry/src/main/module.json5` and add the following information:
]
```
-#### Add the reason for applying for the preceding permission to the entry directory.
+#### Apply the reasons for applicable permission in the entry directory.
-Open `entry/src/main/resources/base/element/string.json` and add the following information:
+Open the `entry/src/main/resources/base/element/string.json` file and add the following code:
```diff
...
@@ -334,15 +328,15 @@ Open `entry/src/main/resources/base/element/string.json` and add the following i
"string": [
+ {
+ "name": "camera_reason",
-+ "value": "camera_reason"
++ "value": "using the camera"
+ },
+ {
+ "name": "location_reason",
-+ "value": "location_reason"
++ "value": "get current location"
+ },
+ {
+ "name": "microphone_reason",
-+ "value": "microphone_reason"
++ "value": "using a Microphone"
+ },
]
}
@@ -354,71 +348,70 @@ Open `entry/src/main/resources/base/element/string.json` and add the following i
> [!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.
-**Camera**:CameraComponent
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-|-----------------|----------------------|----------|----------|-------------|-------------------|
-| ref | Reference on the camera view | Ref | no | All | yes |
-| style | Style to apply on the camera view | StyleProp\ | no | All | yes |
-| flashMode | Camera flash mode. Default: `auto` | 'on'`/`'off'`/`'auto' | no | All | yes |
-| focusMode | Camera focus mode. Default: on | 'on'`/`'off' | no | All | yes |
-| zoomMode | Enable the pinch to zoom gesture. Default: on | 'on'`/`'off' | no | All | yes |
-| zoom | Control the zoom. Default: 1.0 | Number | no | All | yes |
-| maxZoom | Maximum zoom allowed (but not beyond what camera allows). Default: undefined (camera default max) | Number | no | All | yes |
-| onZoom | Callback when user makes a pinch gesture, regardless of what the zoom prop was set to. Returned event contains zoom. Ex: onZoom={(e) => console.log(e.nativeEvent.zoom)}. | Function | no | All | yes |
-| torchMode | Toggle flash light when camera is active. Default: off | 'on'`/`'off' | no | All | yes |
-| cameraType | Choose what camera to use. Default: `CameraType. | 'front'/'back' | no | All | yes |
-| onOrientationChange | Callback when physical device orientation changes. Returned event contains orientation. Ex: onOrientationChange={(event) => console.log(event.nativeEvent.orientation)}. Use import { Orientation } from 'react-native-camera-kit'; if (event.nativeEvent.orientation === Orientation.PORTRAIT) { ... } to understand the new value | Function | no | iOS | yes |
-| onError | Android only. Callback when camera fails to initialize. Ex: onError={(e) => console.log(e.nativeEvent.errorMessage)}. | Function | no | Android | yes |
-| shutterPhotoSound |Android only. Enable or disable the shutter sound when capturing a photo. Default: `true` | Boolean | no | Android | yes
-| ratioOverlay | Show a guiding overlay in the camera preview for the selected ratio. Does not crop image as of v9.0. Example: '16:9' | String | no | iOS | yes |
-| ratioOverlayColor | Any color with alpha. Default: '#ffffff77' | String | no | All | yes |
-| resetFocusTimeout | Dismiss tap to focus after this many milliseconds. Default 0 (disabled). Example: 5000 is 5 seconds. | Number | no | All | yes |
-| resetFocusWhenMotionDetected | Dismiss tap to focus when focus area content changes. Native iOS feature, see documentation: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1624644-subjectareachangemonitoringenabl?language=objc). Default true. | Boolean | no | iOS | no |
-| resizeMode | Determines the scaling and cropping behavior of content within the view. cover (resizeAspectFill on iOS) scales the content to fill the view completely, potentially cropping content if its aspect ratio differs from the view. contain (resizeAspect on iOS) scales the content to fit within the view's bounds without cropping, ensuring all content is visible but may introduce letterboxing. Default behavior depends on the specific use case. | 'cover' / 'contain' | no | iOS | no |
-| onCaptureButtonPressIn | Callback when iPhone capture button is pressed in. Ex: onCaptureButtonPressIn={() => console.log("volume button pressed in")} | Function | no | iOS | yes |
-| onCaptureButtonPressOut | Callback when iPhone capture button is released. Ex: onCaptureButtonPressOut={() => console.log("volume button released")} | Function | no | iOS | no |
-
-**ScanCode**:ScanCodeComponent
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-|-----------------|----------------------|----------|----------|-------------|-------------------|
-| ref | Reference on the camera view | Ref | no | All | yes |
-| style | Style to apply on the camera view | StyleProp\ | no | All | yes |
-| flashMode | Get secret value | 'on'`/`'off'`/`'auto' | no | All | yes |
-| zoomMode | Enable the pinch to zoom gesture. Default: on | 'on'`/`'off' | no | All | yes |
-| zoom | Control the zoom. Default: 1.0 | Number | no | All | yes |
-| maxZoom | Maximum zoom allowed (but not beyond what camera allows). Default: undefined (camera default max) | Number | no | All | yes |
-| onZoom | Callback when user makes a pinch gesture, regardless of what the zoom prop was set to. Returned event contains zoom. Ex: onZoom={(e) => console.log(e.nativeEvent.zoom)}. | Function | no | All | yes |
-| torchMode | Toggle flash light when camera is active. Default: off | 'on'`/`'off' | no | All | yes |
-| cameraType | Choose what camera to use. Default: `CameraType. | 'front'/'back' | no | All | no |
-| onOrientationChange | Callback when physical device orientation changes. Returned event contains orientation. Ex: onOrientationChange={(event) => console.log(event.nativeEvent.orientation)}. Use import { Orientation } from 'react-native-camera-kit'; if (event.nativeEvent.orientation === Orientation.PORTRAIT) { ... } to understand the new value | Function | no | iOS | no |
-| onError | Android only. Callback when camera fails to initialize. Ex: onError={(e) => console.log(e.nativeEvent.errorMessage)}. | Function | no | Android | yes |
-| resetFocusTimeout | Dismiss tap to focus after this many milliseconds. Default 0 (disabled). Example: 5000 is 5 seconds. | Number | no | All | yes |
-| scanThrottleDelay | Duration between scan detection in milliseconds. Default 2000 (2s) | Number | no | All | yes |
-| scanBarcode | Enable barcode scanner. Default: `false` | boolean | no | All | yes |
-| showFrame | Show frame in barcode scanner. Default: `false` | boolean | no | All | yes |
-| laserColor | Color of barcode scanner laser visualization. Default: `red` | string | no | All | yes |
-| frameColor | Color of barcode scanner frame visualization. Default: `yellow` | string | no | All | yes |
-| onReadCode | Callback when scanner successfully reads barcode. Returned event contains `codeStringValue`. Default: `null`. Ex: `onReadCode={(event) => console.log(event.nativeEvent.codeStringValue)} | Function | no | All | yes |
-
-## Methods
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ----- | ------------------- | ---------- | -------- | -------- | ----------------- |
-| capture | Capture image as JPEG. | Promise | No | All | Yes |
-| requestDeviceCameraAuthorization | `AVAuthorizationStatusAuthorized` returns `true` otherwise, returns `false` | Promise | No | All | Yes |
-| checkDeviceCameraAuthorizationStatus | `AVAuthorizationStatusAuthorized` returns `true` otherwise, returns `false` | Promise | All | Yes |Yes|
-
+**Camera**: 相机组件
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------- | -------- | -------- | ----------------- |
+| ref | Reference on the camera view | Ref | no | All | yes |
+| style | Style to apply on the camera view | StyleProp\ | no | All | yes |
+| flashMode | Camera flash mode. Default: `auto` | 'on'`/`'off'`/`'auto' | no | All | yes |
+| focusMode | Camera focus mode. Default: on | 'on'`/`'off' | no | All | yes |
+| zoomMode | Enable the pinch to zoom gesture. Default: on | 'on'`/`'off' | no | All | yes |
+| zoom | Control the zoom. Default: 1.0 | Number | no | All | yes |
+| maxZoom | Maximum zoom allowed (but not beyond what camera allows). Default: undefined (camera default max) | Number | no | All | yes |
+| onZoom | Callback when user makes a pinch gesture, regardless of what the zoom prop was set to. Returned event contains zoom. Ex: onZoom={(e) => console.log(e.nativeEvent.zoom)}. | Function | no | All | yes |
+| torchMode | Toggle flash light when camera is active. Default: off | 'on'`/`'off' | no | All | yes |
+| cameraType | Choose what camera to use. Default: `CameraType. | 'front'/'back' | no | All | yes |
+| onOrientationChange | Callback when physical device orientation changes. Returned event contains orientation. Ex: onOrientationChange={(event) => console.log(event.nativeEvent.orientation)}. Use import { Orientation } from 'react-native-camera-kit'; if (event.nativeEvent.orientation === Orientation.PORTRAIT) { ... } to understand the new value | Function | no | iOS | yes |
+| onError | Android only. Callback when camera fails to initialize. Ex: onError={(e) => console.log(e.nativeEvent.errorMessage)}. | Function | no | Android | yes |
+| shutterPhotoSound | Android only. Enable or disable the shutter sound when capturing a photo. Default: `true` | Boolean | no | Android | yes |
+| ratioOverlay | Show a guiding overlay in the camera preview for the selected ratio. Does not crop image as of v9.0. Example: '16:9' | String | no | iOS | yes |
+| ratioOverlayColor | Any color with alpha. Default: '#ffffff77' | String | no | All | yes |
+| resetFocusTimeout | Dismiss tap to focus after this many milliseconds. Default 0 (disabled). Example: 5000 is 5 seconds. | Number | no | All | yes |
+| resetFocusWhenMotionDetected | Dismiss tap to focus when focus area content changes. Native iOS feature, see documentation: https://developer.apple.com/documentation/avfoundation/avcapturedevice/1624644-subjectareachangemonitoringenabl?language=objc). Default true. | Boolean | no | iOS | no |
+| resizeMode | Determines the scaling and cropping behavior of content within the view. cover (resizeAspectFill on iOS) scales the content to fill the view completely, potentially cropping content if its aspect ratio differs from the view. contain (resizeAspect on iOS) scales the content to fit within the view's bounds without cropping, ensuring all content is visible but may introduce letterboxing. Default behavior depends on the specific use case. | 'cover' / 'contain' | no | iOS | no |
+| onCaptureButtonPressIn | Callback when iPhone capture button is pressed in. Ex: onCaptureButtonPressIn={() => console.log("volume button pressed in")} | Function | no | iOS | yes |
+| onCaptureButtonPressOut | Callback when iPhone capture button is released. Ex: onCaptureButtonPressOut={() => console.log("volume button released")} | Function | no | iOS | no |
+
+**ScanCode**: 扫码组件
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | -------- | -------- | ----------------- |
+| ref | Reference on the camera view | Ref | no | All | yes |
+| style | Style to apply on the camera view | StyleProp\ | no | All | yes |
+| flashMode | Get secret value | 'on'`/`'off'`/`'auto' | no | All | yes |
+| zoomMode | Enable the pinch to zoom gesture. Default: on | 'on'`/`'off' | no | All | yes |
+| zoom | Control the zoom. Default: 1.0 | Number | no | All | yes |
+| maxZoom | Maximum zoom allowed (but not beyond what camera allows). Default: undefined (camera default max) | Number | no | All | yes |
+| onZoom | Callback when user makes a pinch gesture, regardless of what the zoom prop was set to. Returned event contains zoom. Ex: onZoom={(e) => console.log(e.nativeEvent.zoom)}. | Function | no | All | yes |
+| torchMode | Toggle flash light when camera is active. Default: off | 'on'`/`'off' | no | All | yes |
+| cameraType | Choose what camera to use. Default: `CameraType. | 'front'/'back' | no | All | no |
+| onOrientationChange | Callback when physical device orientation changes. Returned event contains orientation. Ex: onOrientationChange={(event) => console.log(event.nativeEvent.orientation)}. Use import { Orientation } from 'react-native-camera-kit'; if (event.nativeEvent.orientation === Orientation.PORTRAIT) { ... } to understand the new value | Function | no | iOS | no |
+| onError | Android only. Callback when camera fails to initialize. Ex: onError={(e) => console.log(e.nativeEvent.errorMessage)}. | Function | no | Android | yes |
+| resetFocusTimeout | Dismiss tap to focus after this many milliseconds. Default 0 (disabled). Example: 5000 is 5 seconds. | Number | no | All | yes |
+| scanThrottleDelay | Duration between scan detection in milliseconds. Default 2000 (2s) | Number | no | All | yes |
+| scanBarcode | Enable barcode scanner. Default: `false` | boolean | no | All | yes |
+| showFrame | Show frame in barcode scanner. Default: `false` | boolean | no | All | yes |
+| laserColor | Color of barcode scanner laser visualization. Default: `red` | string | no | All | yes |
+| frameColor | Color of barcode scanner frame visualization. Default: `yellow` | string | no | All | yes |
+| onReadCode | Callback when scanner successfully reads barcode. Returned event contains `codeStringValue`. Default: `null`. Ex: `onReadCode={(event) => console.log(event.nativeEvent.codeStringValue)} | Function | no | All | yes |
+
+## Static Methods
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ------------------------------------ | --------------------------------------------------------------------------- | -------------------- | -------- | -------- | ----------------- |
+| capture | Capture image as JPEG. | Promise | No | All | Yes |
+| requestDeviceCameraAuthorization | `AVAuthorizationStatusAuthorized` returns `true` otherwise, returns `false` | Promise | No | All | Yes |
+| checkDeviceCameraAuthorizationStatus | `AVAuthorizationStatusAuthorized` returns `true` otherwise, returns `false` | Promise | All | Yes | Yes |
## Known Issues
-- [ ] The sensor rotation angle cannot be queried. [issue#1](https://github.com/react-native-oh-library/react-native-camera-kit/issues/1)
-- [ ] The front camera cannot be used for code scanning. [issue#2](https://github.com/react-native-oh-library/react-native-camera-kit/issues/2)
-- [ ] The flashMode and torchMode attributes cannot be set at the same time. [issue#3](https://github.com/react-native-oh-library/react-native-camera-kit/issues/3)
-- [ ] The onCaptureButtonPressOut attribute is not supported. [issue#4](https://github.com/react-native-oh-library/react-native-camera-kit/issues/4)
-- [ ] The resetFocusWhenMotionDetected attribute is not supported. [issue#5](https://github.com/react-native-oh-library/react-native-camera-kit/issues/5)
-- [ ] The resizeMode attribute is not supported currently. [issue#6](https://github.com/react-native-oh-library/react-native-camera-kit/issues/6)
+- [ ] 不支持查询传感器旋转角度 [issue#1](https://github.com/react-native-oh-library/react-native-camera-kit/issues/1)
+- [ ] 不支持使用前置相机进行扫码 [issue#2](https://github.com/react-native-oh-library/react-native-camera-kit/issues/2)
+- [ ] 不能同时设置 flashMode 和 torchMode 属性 [issue#3](https://github.com/react-native-oh-library/react-native-camera-kit/issues/3)
+- [ ] 暂不支持 onCaptureButtonPressOut 属性 [issue#4](https://github.com/react-native-oh-library/react-native-camera-kit/issues/4)
+- [ ] 暂不支持 resetFocusWhenMotionDetected 属性 [issue#5](https://github.com/react-native-oh-library/react-native-camera-kit/issues/5)
+- [ ] 暂不支持 resizeMode 属性 [issue#6](https://github.com/react-native-oh-library/react-native-camera-kit/issues/6)
## Others
--
Gitee
From 985ef2e7541bb8bb89b7fda7992eeda4365a82c1 Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 14:55:59 +0800
Subject: [PATCH 11/53] docs: [Issues: #IB07UG] react-native-charts-wrapper.md
---
en/react-native-charts-wrapper.md | 170 +++++++++++++++---------------
1 file changed, 85 insertions(+), 85 deletions(-)
diff --git a/en/react-native-charts-wrapper.md b/en/react-native-charts-wrapper.md
index a3538669..e62795aa 100644
--- a/en/react-native-charts-wrapper.md
+++ b/en/react-native-charts-wrapper.md
@@ -1,4 +1,4 @@
-模板版本:v0.2.2
+Template version: v0.2.2
react-native-charts-wrapper
@@ -12,15 +12,15 @@
-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-charts-wrapper)
+> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-charts-wrapper)
-## 安装与使用
+## Installation and Usage
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-charts-wrapper/Releases](https://github.com/react-native-oh-library/react-native-charts-wrapper/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-charts-wrapper/Releases](https://github.com/react-native-oh-library/react-native-charts-wrapper/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-charts-wrapper@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 { BarChart } from "react-native-charts-wrapper";
@@ -73,17 +73,17 @@ const BarChartDemo = () => {
export default BarChartDemo;
```
-## 使用 Codegen
+## Use Codegen
-本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。
+If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/zh-cn/codegen.md).
## 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
{
@@ -94,18 +94,15 @@ export default BarChartDemo;
}
```
-### 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": {
@@ -114,22 +111,22 @@ export default BarChartDemo;
}
```
-点击右上角的 `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](/zh-cn/link-source-code.md).
-### 3.在 ArkTs 侧引入 BarCharts、LineCharts、HorizontalBarCharts 、BubbleCharts、PieCharts、RadarCharts、ScatterCharts、CandleStickCharts、CombinedCharts 组件
+### 3. Introducing BarCharts、LineCharts、HorizontalBarCharts 、BubbleCharts、PieCharts、RadarCharts、ScatterCharts、CandleStickCharts、CombinedCharts Component to ArkTS
-找到 **function buildCustomComponent()**,一般位于 `entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets`,添加:
+Find `function buildCustomRNComponent()`, which is usually located in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets`, and add the following code:
```diff
...
@@ -227,9 +224,9 @@ const arkTsComponentNames: Array = [
];
```
-### 4.在 ArkTs 侧引入 ChartsWrapperPackage
+### 4. Introducing ChartsWrapperPackage to ArkTS
-打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
+Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
```diff
...
@@ -243,31 +240,32 @@ 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-charts-wrapper/Releases](https://github.com/react-native-oh-library/react-native-charts-wrapper/releases)
+Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-charts-wrapper/Releases](https://github.com/react-native-oh-library/react-native-charts-wrapper/releases)
-## 属性
+## 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.
### Common Props
@@ -284,7 +282,7 @@ ohpm install
#### Legend
| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ------------------- | ------------------------ | -------------------------------------------- | -------- | ----------- |-------------------|
+| ------------------- | ------------------------ | -------------------------------------------- | -------- | ----------- | ----------------- |
| enabled | 是否设置图表图例部件 | bool | No | iOS/Android | Yes |
| text | 设置要显示为图例的文本 | string | No | iOS/Android | Yes |
| textColor | 设置图例文本的颜色 | number | No | iOS/Android | NO |
@@ -356,7 +354,7 @@ ohpm install
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---------------------------- | -------------------- | ----------- | -------- | ----------- | ----------------- |
| animation | 设置图表动画 | object | No | iOS/Android | Yes |
-| chartBackgroundColor | 设置图表背景颜色 | number | No | iOS/Android | NO |
+| chartBackgroundColor | 设置图表背景颜色 | number | No | iOS/Android | NO |
| logEnabled | 启用日志 | bool | No | iOS/Android | NO |
| noDataText | 设置无数据文本 | string | No | iOS/Android | Yes |
| noDataTextColor | 设置无数据文本颜色 | number | No | iOS/Android | Yes |
@@ -370,27 +368,27 @@ ohpm install
### BarLineChartBase
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-|------------------------|-------------------------------------------------------------| ------------------------------- | -------- | ----------- | ----------------- |
-| drawGridBackground | 是否设置网格背景颜色 | bool | No | iOS/Android | Yes |
-| gridBackgroundColor | 设置网格背景颜色 | number | No | iOS/Android | Yes |
-| drawBorders | 是否设置边框 | bool | No | iOS/Android | Yes |
-| borderColor | 设置边框颜色 | number | No | iOS/Android | Yes |
-| borderWidth | 设置边框宽度 | number | No | iOS/Android | Yes |
-| minOffset | 设置最小偏移 | number | No | iOS/Android | Yes |
-| maxVisibleValueCount | 设置最大条目数 | number | No | iOS/Android | Yes |
-| visibleRange | 限制通过捏合和缩放可以看到的最大和最小 x 范围 | object | No | iOS/Android | NO |
-| autoScaleMinMaxEnabled | 是否设置 Y 轴的自动缩放标记 | bool | No | iOS/Android | Yes |
-| keepPositionOnRotation | 设置图表在旋转(方向更改)后是否应保持其位置(缩放/滚动 | bool | No | iOS/Android | NO |
-| scaleEnabled | 是否启用缩放 | bool | No | iOS/Android | Yes |
-| scaleXEnabled | 是否启用 X 轴缩放 | bool | No | iOS/Android | Yes |
-| scaleYEnabled | 是否启用 Y 轴缩放 | bool | No | iOS/Android | Yes |
-| dragEnabled | 是否设置拖动 | bool | No | iOS/Android | Yes |
-| pinchZoom | 如果设置为 true,则 x 和 y 轴都可以用 2 个手指同时缩放,如果为 false,x 轴和 y 轴可以单独缩放 | bool | No | iOS/Android | Yes |
-| doubleTapToZoomEnabled | 将此属性设置为 true 可通过双击图表启用放大功能 | bool | No | iOS/Android | Yes |
-| yAxis | 设置 Y 轴 | { left: YAxis, right: YAxis } | No | iOS/Android | Yes |
-| zoom | 按给定的比例因子放大或缩小 | object | No | iOS/Android | Yes |
-| viewPortOffsets | 设置当前 ViewPort 的自定义偏移(在视图两侧的偏移) | object | No | iOS/Android | Yes |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ---------------------- | --------------------------------------------------------------------------------------------- | ----------------------------- | -------- | ----------- | ----------------- |
+| drawGridBackground | 是否设置网格背景颜色 | bool | No | iOS/Android | Yes |
+| gridBackgroundColor | 设置网格背景颜色 | number | No | iOS/Android | Yes |
+| drawBorders | 是否设置边框 | bool | No | iOS/Android | Yes |
+| borderColor | 设置边框颜色 | number | No | iOS/Android | Yes |
+| borderWidth | 设置边框宽度 | number | No | iOS/Android | Yes |
+| minOffset | 设置最小偏移 | number | No | iOS/Android | Yes |
+| maxVisibleValueCount | 设置最大条目数 | number | No | iOS/Android | Yes |
+| visibleRange | 限制通过捏合和缩放可以看到的最大和最小 x 范围 | object | No | iOS/Android | NO |
+| autoScaleMinMaxEnabled | 是否设置 Y 轴的自动缩放标记 | bool | No | iOS/Android | Yes |
+| keepPositionOnRotation | 设置图表在旋转(方向更改)后是否应保持其位置(缩放/滚动 | bool | No | iOS/Android | NO |
+| scaleEnabled | 是否启用缩放 | bool | No | iOS/Android | Yes |
+| scaleXEnabled | 是否启用 X 轴缩放 | bool | No | iOS/Android | Yes |
+| scaleYEnabled | 是否启用 Y 轴缩放 | bool | No | iOS/Android | Yes |
+| dragEnabled | 是否设置拖动 | bool | No | iOS/Android | Yes |
+| pinchZoom | 如果设置为 true,则 x 和 y 轴都可以用 2 个手指同时缩放,如果为 false,x 轴和 y 轴可以单独缩放 | bool | No | iOS/Android | Yes |
+| doubleTapToZoomEnabled | 将此属性设置为 true 可通过双击图表启用放大功能 | bool | No | iOS/Android | Yes |
+| yAxis | 设置 Y 轴 | { left: YAxis, right: YAxis } | No | iOS/Android | Yes |
+| zoom | 按给定的比例因子放大或缩小 | object | No | iOS/Android | Yes |
+| viewPortOffsets | 设置当前 ViewPort 的自定义偏移(在视图两侧的偏移) | object | No | iOS/Android | Yes |
### Data Config Type
@@ -443,9 +441,9 @@ ohpm install
| ----------------- | --------------------------------------------------------------------- | ------- | -------- | ----------- | ----------------- |
| drawValueAboveBar | 如果设置为 true,则所有值都绘制在其条形上方,而不是绘制在其顶部下方。 | bool | No | iOS/Android | Yes |
| drawBarShadow | 如果设置为 true,则在每个条形后面绘制一个灰色区域,表示最大值 | bool | No | iOS/Android | Yes |
-| barWidth | 设置每个条形在x轴上应具有的宽度 | number | No | iOS/Android | Yes |
-| topRadius | 设置顶部圆角半径 | number | No | iOS/Android | Yes |
-| group | 所有BarDataSet对象组合在一起 | object | No | iOS/Android | Yes |
+| barWidth | 设置每个条形在 x 轴上应具有的宽度 | number | No | iOS/Android | Yes |
+| topRadius | 设置顶部圆角半径 | number | No | iOS/Android | Yes |
+| group | 所有 BarDataSet 对象组合在一起 | object | No | iOS/Android | Yes |
| data | 柱状图数据 | BarData | Yes | iOS/Android | Yes |
#### BarData Config
@@ -587,10 +585,10 @@ ohpm install
| common | 公共数据数据 | Data Config Type.Common | No | iOS/Android | Yes |
| barLineScatterCandleBubble | 柱状图、条形图、散点图、气泡图、烛台图的公共基础数据 | Data Config Type.CommonConfigType.barLineScatterCandleBubble | No | iOS/Android | Yes |
| lineScatterCandleRadar | 柱状图、烛台图、散点图、雷达图的公共基础数据 | Data Config Type.CommonConfigType.lineScatterCandleRadar | No | iOS/Android | Yes |
-| scatterShapeSize | 设置绘制的scattershape将具有的大小 | number | No | iOS/Android | Yes |
-| scatterShape | 设置绘制此DataSet时应使用的散点形状 | string | No | iOS/Android | Yes |
-| scatterShapeHoleColor | 设置形状中孔的颜色 | number | No | iOS/Android | Yes |
-| scatterShapeHoleRadius | 设置形状中孔的半径(适用于正方形、圆形和三角形) | number | No | iOS/Android | Yes |
+| scatterShapeSize | 设置绘制的 scattershape 将具有的大小 | number | No | iOS/Android | Yes |
+| scatterShape | 设置绘制此 DataSet 时应使用的散点形状 | string | No | iOS/Android | Yes |
+| scatterShapeHoleColor | 设置形状中孔的颜色 | number | No | iOS/Android | Yes |
+| scatterShapeHoleRadius | 设置形状中孔的半径(适用于正方形、圆形和三角形) | number | No | iOS/Android | Yes |
#### ScatterData Values
@@ -665,18 +663,20 @@ ohpm install
| ----- | ----------- | ------ | -------- | ----------- | ----------------- |
| value | 数据 | number | Yes | iOS/Android | Yes |
-## 遗留问题
-
-## 其他
-- 图例的maxSizePercent最大百分比属性在Android和iOS不生效, HarmonyOS与Android,iOS表现一致。[原库 issue](https://github.com/wuxudong/react-native-charts-wrapper/issues/995)
-- 图例的custom属性,设置后会覆盖原有的图例,但自定义图例也不显示在Android和iOS中,属性不生效, HarmonyOS与Android,iOS表现一致。[原库 issue](https://github.com/wuxudong/react-native-charts-wrapper/issues/996)
-- logEnabled 会开启安卓特有的日志logcat和 highlights属性在Android和iOS不生效, HarmonyOS与Android,iOS表现一致。[原库 issue](https://github.com/wuxudong/react-native-charts-wrapper/issues/998)
-- stackLabels 堆叠条形图设置无效果和 drawCubicIntensity 曲线角度属性在Android和iOS不生效, HarmonyOS与Android,iOS表现一致。[原库 issue](https://github.com/wuxudong/react-native-charts-wrapper/issues/997)
-- 在Android和iOS visibleRange 最大大小百分比限制通过缩放和缩放可以看到的最大和最小x范围不起作用, HarmonyOS与Android,iOS表现一致。[原库 issue](https://github.com/wuxudong/react-native-charts-wrapper/issues/999)
-- keepPositionOnRotation旋转后保持图表原始位置属性在Android和iOS不生效, HarmonyOS与Android,iOS表现一致。[原库 issue](https://github.com/wuxudong/react-native-charts-wrapper/issues/999)
-- valueFormatter格式化数据属性在Android和iOS不生效, HarmonyOS与Android,iOS表现一致。[原库 issue](https://github.com/wuxudong/react-native-charts-wrapper/issues/935)
-- chartBackgroundColor图表背景颜色在原库中不生效,在原库中网格背景颜色与图表背景颜色设置的内容一样,则已不支持图表背景 HarmonyOS与Android,iOS表现一致。[原库 issue](https://github.com/wuxudong/react-native-charts-wrapper/issues/1001)
-- Legend中的text与data中label效果相同,原库中已不支持该属性。HarmonyOS与Android,ios表现一致。[原库 issue](https://github.com/wuxudong/react-native-charts-wrapper/issues/1003)
-## 开源协议
-
-本项目基于 [The MIT License (MIT)](https://mitlicense.org/) ,请自由地享受和参与开源。
+## Known Issues
+
+## Others
+
+- 图例的 maxSizePercent 最大百分比属性在 Android 和 iOS 不生效, HarmonyOS 与 Android,iOS 表现一致。[原库 issue](https://github.com/wuxudong/react-native-charts-wrapper/issues/995)
+- 图例的 custom 属性,设置后会覆盖原有的图例,但自定义图例也不显示在 Android 和 iOS 中,属性不生效, HarmonyOS 与 Android,iOS 表现一致。[原库 issue](https://github.com/wuxudong/react-native-charts-wrapper/issues/996)
+- logEnabled 会开启安卓特有的日志 logcat 和 highlights 属性在 Android 和 iOS 不生效, HarmonyOS 与 Android,iOS 表现一致。[原库 issue](https://github.com/wuxudong/react-native-charts-wrapper/issues/998)
+- stackLabels 堆叠条形图设置无效果和 drawCubicIntensity 曲线角度属性在 Android 和 iOS 不生效, HarmonyOS 与 Android,iOS 表现一致。[原库 issue](https://github.com/wuxudong/react-native-charts-wrapper/issues/997)
+- 在 Android 和 iOS visibleRange 最大大小百分比限制通过缩放和缩放可以看到的最大和最小 x 范围不起作用, HarmonyOS 与 Android,iOS 表现一致。[原库 issue](https://github.com/wuxudong/react-native-charts-wrapper/issues/999)
+- keepPositionOnRotation 旋转后保持图表原始位置属性在 Android 和 iOS 不生效, HarmonyOS 与 Android,iOS 表现一致。[原库 issue](https://github.com/wuxudong/react-native-charts-wrapper/issues/999)
+- valueFormatter 格式化数据属性在 Android 和 iOS 不生效, HarmonyOS 与 Android,iOS 表现一致。[原库 issue](https://github.com/wuxudong/react-native-charts-wrapper/issues/935)
+- chartBackgroundColor 图表背景颜色在原库中不生效,在原库中网格背景颜色与图表背景颜色设置的内容一样,则已不支持图表背景 HarmonyOS 与 Android,iOS 表现一致。[原库 issue](https://github.com/wuxudong/react-native-charts-wrapper/issues/1001)
+- Legend 中的 text 与 data 中 label 效果相同,原库中已不支持该属性。HarmonyOS 与 Android,ios 表现一致。[原库 issue](https://github.com/wuxudong/react-native-charts-wrapper/issues/1003)
+
+## License
+
+This project is licensed under [The MIT License (MIT)](https://mitlicense.org/).
--
Gitee
From 17463ef6fbc110efc31fc07dbaa9a5e6772dfaf3 Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 14:56:06 +0800
Subject: [PATCH 12/53] docs: [Issues: #IB07UG] react-native-communications.md
---
en/react-native-communications.md | 101 +++++++++++++++---------------
1 file changed, 52 insertions(+), 49 deletions(-)
diff --git a/en/react-native-communications.md b/en/react-native-communications.md
index cff9fe5f..e2e0bbec 100644
--- a/en/react-native-communications.md
+++ b/en/react-native-communications.md
@@ -1,5 +1,6 @@
-> 模板版本:v0.2.2
+
+> Template version: v0.2.2
react-native-communications
@@ -13,11 +14,11 @@
-> [!TIP] [Github 地址](https://github.com/davebeehively/react-native-communications)
+> [!TIP] [GitHub address](https://github.com/davebeehively/react-native-communications)
-## 安装与使用
+## Installation and Usage
-进入到工程目录并输入以下命令:
+Go to the project directory and execute the following instruction:
@@ -35,35 +36,36 @@ yarn add react-native-communications@2.2.1
->[!WARNING] 使用时 import 的库名不变。
+> [!WARNING] The name of the imported repository remains unchanged.
```js
-var React = require('react-native');
-var {
- StyleSheet,
- View,
- TouchableOpacity,
- Text
-} = React;
+var React = require("react-native");
+var { StyleSheet, View, TouchableOpacity, Text } = React;
-import { phonecall, text, textWithoutEncoding, email, web } from 'react-native-communications';
+import {
+ phonecall,
+ text,
+ textWithoutEncoding,
+ email,
+ web,
+} from "react-native-communications";
const RNCommunications = () => {
const handleButton1Press = () => {
- phonecall('0123456789', false)
- }
+ phonecall("0123456789", false);
+ };
const handleButton2Press = () => {
- email(['email@xxx.com'], null, null, 'My Subject', 'My body text')
- }
+ email(["email@xxx.com"], null, null, "My Subject", "My body text");
+ };
const handleButton3Press = () => {
- text('0123456789')
- }
+ text("0123456789");
+ };
const handleButton4Press = () => {
- web('https://www.baidu.com')
- }
+ web("https://www.baidu.com");
+ };
const handleButton5Press = () => {
- textWithoutEncoding('0123456789', "9999999")
- }
+ textWithoutEncoding("0123456789", "9999999");
+ };
return (
@@ -89,50 +91,51 @@ const RNCommunications = () => {
var styles = StyleSheet.create({
container: {
flex: 1,
- justifyContent: 'center',
- alignItems: 'center',
+ justifyContent: "center",
+ alignItems: "center",
},
button: {
padding: 10,
margin: 5,
- backgroundColor: 'white',
+ backgroundColor: "white",
borderRadius: 5,
- }
+ },
});
export default RNCommunications;
```
-## 约束与限制
-### 兼容性
+## Constraints
+
+### Compatibility
+
+This document is verified based on the following versions:
-本文档内容基于以下版本验证通过:
+1.RNOH: 0.72.27; SDK: HarmonyOS-Next-DB1 5.0.0.25; IDE: DevEco Studio 5.0.3.400SP7; ROM: 3.0.0.25;
-1.RNOH: 0.72.27; SDK:HarmonyOS-Next-DB1 5.0.0.25; IDE:DevEco Studio 5.0.3.400SP7; 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;
-## 静态方法
+## Static Methods
-> [!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 |
-| ---- | ----------- | ---- | -------- | -------- | ------------------ |
-| phonecall | 拨打电话 | function | yes | All | yes |
-| email | 发送电子邮件 | function | yes | All | no |
-| text | 发送文本消息 | function | yes | All | yes |
-| textWithoutEncoding | 发送文本消息,但是不进行编码处理 | function | yes | All | yes |
-| web | 打开指定的网页 URL | function | yes | All | yes |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ------------------- | -------------------------------- | -------- | -------- | -------- | ----------------- |
+| phonecall | 拨打电话 | function | yes | All | yes |
+| email | 发送电子邮件 | function | yes | All | no |
+| text | 发送文本消息 | function | yes | All | yes |
+| textWithoutEncoding | 发送文本消息,但是不进行编码处理 | function | yes | All | yes |
+| web | 打开指定的网页 URL | function | yes | All | yes |
-## 遗留问题
+## Known Issues
-- [ ] HarmonyOS 侧没有邮箱应用,导致email方法无法打开发送邮件界面。
-- [ ] text添加body之后,没法在短信界面拆分进短信输入栏,框架侧接口Linking.canOpenURL不支持。
+- [ ] HarmonyOS 侧没有邮箱应用,导致 email 方法无法打开发送邮件界面。
+- [ ] text 添加 body 之后,没法在短信界面拆分进短信输入栏,框架侧接口 Linking.canOpenURL 不支持。
-## 其他
+## Others
-## 开源协议
+## License
-本项目基于 [The MIT License (MIT)](https://github.com/davebeehively/react-native-communications/blob/master/LICENSE) ,请自由地享受和参与开源。
+This project is licensed under [The MIT License (MIT)](https://github.com/davebeehively/react-native-communications/blob/master/LICENSE).
-
\ No newline at end of file
+
--
Gitee
From f4dd5353fae946f7f3acec5375a664db417129c7 Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 14:56:14 +0800
Subject: [PATCH 13/53] docs: [Issues: #IB07UG] react-native-config.md
---
en/react-native-config.md | 106 ++++++++++++++++++++------------------
1 file changed, 56 insertions(+), 50 deletions(-)
diff --git a/en/react-native-config.md b/en/react-native-config.md
index 7b294613..52320a6e 100644
--- a/en/react-native-config.md
+++ b/en/react-native-config.md
@@ -1,4 +1,4 @@
-> 模板版本:v0.2.2
+> Template version: v0.2.2
react-native-config
@@ -12,29 +12,35 @@
-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-config)
-## 基本用法
+> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-config)
+
+## Basic Usage
+
在 React Native 应用程序的根目录中创建一个新`.env`文件
+
```bash
API_URL=https://myapi.com
GOOGLE_MAPS_API_KEY=abcdefgh
```
-然后从您的应用程序访问那里定义的变量:
+
+然后从您的应用程序访问那里定义的变量:
+
```bash
import Config from "react-native-config";
Config.API_URL; // 'https://myapi.com'
Config.GOOGLE_MAPS_API_KEY; // 'abcdefgh'
```
+
请记住,此模块不会混淆或加密机密以进行打包,因此请勿将敏感密钥存储在`.env`中[基本上不可能阻止用户对移动应用程序机密进行逆向工程](https://rammic.github.io/2015/07/28/hiding-secrets-in-android-apps/),因此请在设计应用程序(和 API)时牢记这一点。
-## 安装与使用
+## Installation and Usage
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-library/react-native-config Releases](https://github.com/react-native-oh-library/react-native-config/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-library/react-native-config Releases](https://github.com/react-native-oh-library/react-native-config/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 (#).
#### npm
@@ -48,10 +54,9 @@ npm install @react-native-oh-tpl/react-native-config@file:#
yarn add @react-native-oh-tpl/react-native-config@file:#
```
+The following code shows the basic use scenario of the repository:
-下面的代码展示了这个库的基本使用场景:
-
-> [!WARNING] 使用时 import 的库名不变。
+> [!WARNING] The name of the imported repository remains unchanged.
```
import React, {Component} from 'react';
@@ -84,17 +89,17 @@ const styles = StyleSheet.create({
});
```
-## 使用 Codegen
+## Use Codegen
-本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。
+If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/zh-cn/codegen.md).
## 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
{
@@ -105,7 +110,7 @@ const styles = StyleSheet.create({
}
```
-### 2.引入原生端代码
+### 2. Introducing Native Code
该库仅支持源码形式引入
@@ -129,7 +134,7 @@ modules:[
]
```
-打开 `entry/oh-package.json5`,添加以下依赖
+Open `entry/oh-package.json5` file and add the following dependencies:
```json
"dependencies": {
@@ -138,18 +143,18 @@ modules:[
}
```
-点击右上角的 `sync` 按钮
+Click the `sync` button in the upper right corner.
-或者在终端执行:
+Alternatively, run the following instruction on the terminal:
```bash
cd entry
ohpm install
```
-### 3.在 ArkTs 侧引入 RNConfigPackage
+### 3. Introducing RNConfigPackage to ArkTS
-打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
+Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
```diff
import type { RNPackageContext, RNPackage } from 'rnoh/ts';
@@ -164,45 +169,48 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
}
```
-### 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.
### 多环境
-将不同环境的配置保存在不同的文件中:`.env.staging`,`.env.production`等等。
-默认情况下,`react-native-config `将从`.env`中读取。最简单的方法是用环境变量告诉它读取什么文件,以命令行中使用IDE下的`hvigor.js`的方式(不推荐)。
+
+将不同环境的配置保存在不同的文件中: `.env.staging`,`.env.production`等等。
+默认情况下,`react-native-config `将从`.env`中读取。最简单的方法是用环境变量告诉它读取什么文件,以命令行中使用 IDE 下的`hvigor.js`的方式(不推荐)。
例如在`CMD`窗口下
-首先从RN工程根目录 `cd harmony` 进入harmony目录
+首先从 RN 工程根目录 `cd harmony` 进入 harmony 目录
-然后先停止守护进程:
+然后先停止守护进程:
```bash
"D:\DevEcoStudio\tools\node\node.exe" "D:\DevEcoStudio\tools\hvigor\bin\hvigorw.js" --stop-daemon-all
```
-*注意,命令中`node.exe`与`hvigor.js`路径为`DevEco Studio`安装目录下的`tools`目录下,需根据实际情况更改。
+\*注意,命令中`node.exe`与`hvigor.js`路径为`DevEco Studio`安装目录下的`tools`目录下,需根据实际情况更改。
-然后设置环境变量`ENVFILE`为想要指定的配置文件名(注意:文件名后不要加空格),并用`hvigor.js`构建工程,例如:
+然后设置环境变量`ENVFILE`为想要指定的配置文件名(注意: 文件名后不要加空格),并用`hvigor.js`构建工程,例如:
```bash
set ENVFILE=.env.staging&&"D:\DevEcoStudio\tools\node\node.exe" "D:\DevEcoStudio\tools\hvigor\bin\hvigorw.js" --mode module -p module=entry@default -p product=default -p requiredDeviceType=phone assembleHap --analyze=normal --parallel --increm
```
-之后可打开`DevEco Studio`构建运行,但此时为保证所设环境变量与工程构建在同一进程,不可在`DevEco Studio`的终端中以hvigor命令构建工程。
+
+之后可打开`DevEco Studio`构建运行,但此时为保证所设环境变量与工程构建在同一进程,不可在`DevEco Studio`的终端中以 hvigor 命令构建工程。
#### 建立映射
-或者,您可以定义一个映射来将构建与环境文件关联起来,可以在`harmony`工程根目录的`build-profile.json5`中的`products`中的`buildOption`节点下的`arkOptions`子节点中通过增加`buildProfileFields`字段配置映射,字段中以键值对的方式配置,其中key值为小写的工程构建类型,value为该构建类型下所要读取的文件名
+或者,您可以定义一个映射来将构建与环境文件关联起来,可以在`harmony`工程根目录的`build-profile.json5`中的`products`中的`buildOption`节点下的`arkOptions`子节点中通过增加`buildProfileFields`字段配置映射,字段中以键值对的方式配置,其中 key 值为小写的工程构建类型,value 为该构建类型下所要读取的文件名
+
```json
"products": [
{
@@ -222,30 +230,28 @@ set ENVFILE=.env.staging&&"D:\DevEcoStudio\tools\node\node.exe" "D:\DevEcoStudio
]
```
-## 约束与限制
-
-### 兼容性
-
-要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。
+## Constraints
-请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-library/react-native-config Releases](https://github.com/react-native-oh-library/react-native-config/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.
-> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
+Check the release version information in the release address of the third-party library: [@react-native-oh-library/react-native-config Releases](https://github.com/react-native-oh-library/react-native-config/releases)
-> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
+## Properties
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| --------------- | --------------------------------- | -------- | -------- | ----------- | ----------------- |
-| Config | 类中属性名及其值对应.env文件中所定义的键值对 | Object | no | Android/iOS | yes |
+> [!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 |
+| ------ | --------------------------------------------- | ------ | -------- | ----------- | ----------------- |
+| Config | 类中属性名及其值对应.env 文件中所定义的键值对 | Object | no | Android/iOS | yes |
-## 其他
+## Known Issues
-## 开源协议
+## Others
-本项目基于 [The MIT License (MIT)](https://github.com/lugg/react-native-config/blob/master/LICENSE) ,请自由地享受和参与开源。
+## License
+This project is licensed under [The MIT License (MIT)](https://github.com/lugg/react-native-config/blob/master/LICENSE).
--
Gitee
From 36ef7af9c87a9cdcd0f2b62938c8ba7d5150a1e0 Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 14:56:22 +0800
Subject: [PATCH 14/53] docs: [Issues: #IB07UG] react-native-contacts.md
---
en/react-native-contacts.md | 142 +++++++++++++++++-------------------
1 file changed, 68 insertions(+), 74 deletions(-)
diff --git a/en/react-native-contacts.md b/en/react-native-contacts.md
index 077197af..fb3879d2 100644
--- a/en/react-native-contacts.md
+++ b/en/react-native-contacts.md
@@ -1,6 +1,6 @@
-> 模板版本:v0.2.2
+> Template version: v0.2.2
react-native-contacts
@@ -14,15 +14,15 @@
-> [!tip] [Github 地址](https://github.com/react-native-oh-library/react-native-contacts)
+> [!tip] [GitHub address](https://github.com/react-native-oh-library/react-native-contacts)
-## 安装与使用
+## Installation and Usage
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-contacts Releases](https://github.com/react-native-oh-library/react-native-contacts/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-contacts Releases](https://github.com/react-native-oh-library/react-native-contacts/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 (#).
@@ -40,9 +40,9 @@ yarn add @react-native-oh-tpl/react-native-contacts@file:#
-快速使用:
+Quick use:
-> [!WARNING] 使用时 import 的库名不变。
+> [!WARNING] The name of the imported repository remains unchanged.
```js
import React, { useState } from "react";
@@ -332,17 +332,17 @@ export const ContactsDemo = () => {
};
```
-## 使用 Codegen
+## Use Codegen
-本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。
+If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/zh-cn/codegen.md).
## 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
{
@@ -353,18 +353,15 @@ export const ContactsDemo = () => {
}
```
-### 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": {
@@ -373,22 +370,22 @@ export const ContactsDemo = () => {
}
```
-点击右上角的 `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](/zh-cn/link-source-code.md).
-### 3.在 ArkTs 侧引入 ContactsPackage
+### 3. Introducing ContactsPackage to ArkTS
-打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
+Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
```diff
...
@@ -400,32 +397,32 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
}
```
-### 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
-### 兼容性
+### 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-contacts Releases](https://github.com/react-native-oh-library/react-native-contacts/releases)
+Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-contacts Releases](https://github.com/react-native-oh-library/react-native-contacts/releases)
-### 权限要求
+### Permission Requirements
[!tip] "ohos.permission.READ_CONTACTS","ohos.permission.WRITE_CONTACTS"权限等级为system_basic,授权方式为user_grant,[使用 ACL 签名的配置指导](https://developer.harmonyos.com/cn/docs/documentation/doc-guides-V3/signing-0000001587684945-V3#section157591551175916)
-打开`entry/src/main/module.json5`,添加:
+Open the `entry/src/main/module.json5` file and add the following code:
```json
"requestPermissions": [
@@ -455,36 +452,35 @@ ohpm install
## API
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | ----------- | ----------------- |
-| getAll: Promise | returns all contacts as an array of objects | function | no | android,ios | yes |
-| getAllWithoutPhotos:Promise | same as `getAll` on Android, but on iOS it will not return uris for contact photos (because there's a significant overhead in creating the images) | function | no | android,ios | yes |
-| getContactById(contactId): Promise | returns contact with defined contactId (or null if it doesn't exist)人 | function | no | android,ios | yes |
-| getCount(): Promise | returns the number of contacts | function | no | android,ios | yes |
-| getPhotoForId(contactId: string): Promise | Promise - returns a URI (or null) for a contacts photoURL | function | no | android,ios | yes |
-| addContact(contact: Partial): Promise| adds a contact to the AddressBook | function | no | android,ios | yes |
-| openContactForm(contact: Partial): Promise | create a new contact and display in contactsUI面 | function | no | android,ios | partially |
-| openExistingContact(contact: Contact): Promise | open existing contact (edit mode), where contact is an object with a valid recordID | function | no | android,ios | partially |
-| viewExistingContact(contact: { recordID: string }) | open existing contact (view mode), where contact is an object with a valid recordID面 | function | no | android,ios | partially |
-| editExistingContact(contact: Contact): Promise | add numbers to the contact, where the contact is an object with a valid recordID and an array of phoneNumbers面 | function | no | android,ios | no |
-| updateContact(contact: Partial & {recordID: string}): Promise | where contact is an object with a valid recordID | function | no | android,ios | yes |
-| deleteContact(contact: Contact): Promise | where contact is an object with a valid recordID | function | no | android,ios | yes |
-| getContactsMatchingString(str: string): Promise | where string is any string to match a name (first, middle, family) to | function | no | android,ios | yes |
-| getContactsByPhoneNumber(phoneNumber: string): Promise | where string is a phone number to match to. | function | no | android,ios | yes |
-| getContactsByEmailAddress(emailAddress: string): Promise | where string is an email address to match to. | function | no | android,ios | yes |
-| checkPermission(): Promise<'authorized' \| 'denied' \| 'undefined'>; | checks permission to access Contacts ios only | function | no | ios | yes |
-| requestPermission(): Promise<'authorized' \| 'denied' \| 'undefined'> | request permission to access Contacts ios only | function | no | ios | yes |
-| writePhotoToPath(contactId: string, file: string): Promise | writes the contact photo to a given path android only | function | no | android | no |
-
+> [!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 |
+| ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | ----------- | ----------------- |
+| getAll: Promise | returns all contacts as an array of objects | function | no | android,ios | yes |
+| getAllWithoutPhotos:Promise | same as `getAll` on Android, but on iOS it will not return uris for contact photos (because there's a significant overhead in creating the images) | function | no | android,ios | yes |
+| getContactById(contactId): Promise | returns contact with defined contactId (or null if it doesn't exist)人 | function | no | android,ios | yes |
+| getCount(): Promise | returns the number of contacts | function | no | android,ios | yes |
+| getPhotoForId(contactId: string): Promise | Promise - returns a URI (or null) for a contacts photoURL | function | no | android,ios | yes |
+| addContact(contact: Partial): Promise | adds a contact to the AddressBook | function | no | android,ios | yes |
+| openContactForm(contact: Partial): Promise | create a new contact and display in contactsUI 面 | function | no | android,ios | partially |
+| openExistingContact(contact: Contact): Promise | open existing contact (edit mode), where contact is an object with a valid recordID | function | no | android,ios | partially |
+| viewExistingContact(contact: { recordID: string }) | open existing contact (view mode), where contact is an object with a valid recordID 面 | function | no | android,ios | partially |
+| editExistingContact(contact: Contact): Promise | add numbers to the contact, where the contact is an object with a valid recordID and an array of phoneNumbers 面 | function | no | android,ios | no |
+| updateContact(contact: Partial & {recordID: string}): Promise | where contact is an object with a valid recordID | function | no | android,ios | yes |
+| deleteContact(contact: Contact): Promise | where contact is an object with a valid recordID | function | no | android,ios | yes |
+| getContactsMatchingString(str: string): Promise | where string is any string to match a name (first, middle, family) to | function | no | android,ios | yes |
+| getContactsByPhoneNumber(phoneNumber: string): Promise | where string is a phone number to match to. | function | no | android,ios | yes |
+| getContactsByEmailAddress(emailAddress: string): Promise | where string is an email address to match to. | function | no | android,ios | yes |
+| checkPermission(): Promise<'authorized' \| 'denied' \| 'undefined'>; | checks permission to access Contacts ios only | function | no | ios | yes |
+| requestPermission(): Promise<'authorized' \| 'denied' \| 'undefined'> | request permission to access Contacts ios only | function | no | ios | yes |
+| writePhotoToPath(contactId: string, file: string): Promise | writes the contact photo to a given path android only | function | no | android | no |
**Contacts**
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
-| recordID | 联系人id | string | no | android,ios | yes |
+| recordID | 联系人 id | string | no | android,ios | yes |
| backTitle | 返回键标题 | string | no | android,ios | no |
| company | 公司 | string|null | no | android,ios | yes |
| emailAddresses | 电子邮箱地址 | EmailAddress[] | no | android,ios | yes |
@@ -506,7 +502,6 @@ ohpm install
| urlAddresses | 图片地址 | UrlAddress[] | no | android,ios | no |
| note | 备注 | string | no | android,ios | yes |
-
**EmailAddress**
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
@@ -552,19 +547,18 @@ ohpm install
| url | 路径 | string | no | android,ios | yes |
| label | 标题 | string | no | android,ios | yes |
+## Known Issues
-## 遗留问题
-
-- [ ] openContactForm:跳转到系统联系人界面只支持姓名和电话参数传递,需要系统联系人应用支持所有属性,另外创建成功之后无法返回联系人信息,联系人应用目前不支持。[issue#1](https://github.com/react-native-oh-library/react-native-contacts/issues/1)
-- [ ] openExistingContact:联系人应用新增和编辑是同一个界面,目前参数只支持姓名和电话传递,编辑成功之后也无法拿到联系人信息[issue#1](https://github.com/react-native-oh-library/react-native-contacts/issues/1)
-- [ ] viewExistingContact:查看界面只有姓名和电话信息,需要联系人应用补齐所有属性[issue#1](https://github.com/react-native-oh-library/react-native-contacts/issues/1)
-- [ ] editExistingContact:没有单独的只支持编辑电话号码的页面,目前同编辑页面[issue#1](https://github.com/react-native-oh-library/react-native-contacts/issues/1)
-- [ ] writePhotoToPath:系统联系人应用不支持[issue#1](https://github.com/react-native-oh-library/react-native-contacts/issues/1)
+- [ ] openContactForm: 跳转到系统联系人界面只支持姓名和电话参数传递,需要系统联系人应用支持所有属性,另外创建成功之后无法返回联系人信息,联系人应用目前不支持。[issue#1](https://github.com/react-native-oh-library/react-native-contacts/issues/1)
+- [ ] openExistingContact: 联系人应用新增和编辑是同一个界面,目前参数只支持姓名和电话传递,编辑成功之后也无法拿到联系人信息[issue#1](https://github.com/react-native-oh-library/react-native-contacts/issues/1)
+- [ ] viewExistingContact: 查看界面只有姓名和电话信息,需要联系人应用补齐所有属性[issue#1](https://github.com/react-native-oh-library/react-native-contacts/issues/1)
+- [ ] editExistingContact: 没有单独的只支持编辑电话号码的页面,目前同编辑页面[issue#1](https://github.com/react-native-oh-library/react-native-contacts/issues/1)
+- [ ] writePhotoToPath: 系统联系人应用不支持[issue#1](https://github.com/react-native-oh-library/react-native-contacts/issues/1)
-## 其他
+## Others
-## 开源协议
+## License
-本项目基于 [The MIT License (MIT)](https://github.com/morenoh149/react-native-contacts/blob/master/LICENSE) ,请自由地享受和参与开源。
+This project is licensed under [The MIT License (MIT)](https://github.com/morenoh149/react-native-contacts/blob/master/LICENSE).
--
Gitee
From 0c9ef9c54216461439d4ca6cebbb4791f4cd2414 Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 14:56:30 +0800
Subject: [PATCH 15/53] docs: [Issues: #IB07UG]
react-native-context-menu-view.md
---
en/react-native-context-menu-view.md | 139 +++++++++++++--------------
1 file changed, 67 insertions(+), 72 deletions(-)
diff --git a/en/react-native-context-menu-view.md b/en/react-native-context-menu-view.md
index 63154607..2d3ffc1e 100644
--- a/en/react-native-context-menu-view.md
+++ b/en/react-native-context-menu-view.md
@@ -1,4 +1,4 @@
-> 模板版本:v0.2.2
+> Template version: v0.2.2
react-native-context-menu-view
@@ -12,17 +12,15 @@
+> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-context-menu-view)
+## Installation and Usage
-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-context-menu-view)
+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-context-menu-view Releases](https://github.com/react-native-oh-library/react-native-context-menu-view/releases).
-## 安装与使用
+Go to the project directory and execute the following instruction:
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-context-menu-view Releases](https://github.com/react-native-oh-library/react-native-context-menu-view/releases),并下载适用版本的 tgz 包。
-
-进入到工程目录并输入以下命令:
-
-> [!TIP] # 处替换为 tgz 包的路径
+> [!TIP] Replace the content with the path of the .tgz package at the comment sign (#).
@@ -40,9 +38,9 @@ yarn add @react-native-oh-tpl/react-native-context-menu-view@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 ContextMenu from "react-native-context-menu-view";
@@ -65,11 +63,11 @@ const Example = () => {
## 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
{
@@ -80,18 +78,15 @@ const Example = () => {
}
```
-### 2.引入原生端代码
-
-目前有两种方法:
+### 2. Introducing Native Code
-1. 通过 har 包引入(在 IDE 完善相关功能后该方法会被遗弃,目前首选此方法);
-2. 直接链接源码。
+Currently, two methods are available:
-方法一:通过 har 包引入(推荐)
+Method 1 (recommended): Use the HAR file.
-> [!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": {
@@ -100,22 +95,22 @@ const Example = () => {
}
```
-点击右上角的 `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](/zh-cn/link-source-code.md).
-### 3.配置 CMakeLists 和引入 ContextMenuPackage
+### 3. Configuring CMakeLists and Introducing ContextMenuPackage
-打开 `entry/src/main/cpp/CMakeLists.txt`,添加:
+Open `entry/src/main/cpp/CMakeLists.txt` and add the following code:
```diff
project(rnapp)
@@ -153,7 +148,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"
@@ -172,9 +167,9 @@ std::vector> PackageProvider::getPackages(Package::Cont
}
```
-### 4.在 ArkTs 侧引入 ContextMenuPackage
+### 4. Introducing ContextMenuPackage to ArkTS
-打开 `entry/src/main/ets/RNPackagesFactory.ets`,添加:
+Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
```diff
...
@@ -188,77 +183,77 @@ 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-context-menu-view Releases](https://github.com/react-native-oh-library/react-native-context-menu-view/releases)
+Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-context-menu-view Releases](https://github.com/react-native-oh-library/react-native-context-menu-view/releases)
-## 属性
+## 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 |
-| ---------------------- | ------------------------------------------------------------ | -------- | -------- | ---------------------- | ----------------- |
-| title | The title above the popup menu. | string | no | Android/iOS | yes |
-| actions | Menu props. | array | no | Android(partially)/iOS | partially |
-| previewBackgroundColor | The background color of the preview. | string | no | NA | no |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ---------------------- | ------------------------------------------------------------------------------------------ | -------- | -------- | ---------------------- | ----------------- |
+| title | The title above the popup menu. | string | no | Android/iOS | yes |
+| actions | Menu props. | array | no | Android(partially)/iOS | partially |
+| previewBackgroundColor | The background color of the preview. | string | no | NA | no |
| dropdownMenuMode | When set to true, the context menu is triggered with a single tap instead of a long press. | boolean | no | Android/iOS | yes |
-| disabled | Disable menu interaction. | boolean | no | Android/iOS | yes |
-| onPress | When the popup is opened and the user picks an option. | callback | no | Android/iOS | yes |
-| onPreviewPress | When the context menu preview is tapped. | callback | no | iOS | yes |
-| onCancel | When the popup is opened and the user cancels. | callback | no | Android/iOS | yes |
+| disabled | Disable menu interaction. | boolean | no | Android/iOS | yes |
+| onPress | When the popup is opened and the user picks an option. | callback | no | Android/iOS | yes |
+| onPreviewPress | When the context menu preview is tapped. | callback | no | iOS | yes |
+| onCancel | When the popup is opened and the user cancels. | callback | no | Android/iOS | yes |
## actions
-> [!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 |
-| -------------- | ------------------------------------------------------------ | ------- | -------- | ----------- | ----------------- |
-| title | the title of the action | string | no | Android/iOS | yes |
-| subtitle | the subtitle of the action | string | no | iOS 15+ | yes |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| -------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------- | -------- | ----------- | ----------------- |
+| title | the title of the action | string | no | Android/iOS | yes |
+| subtitle | the subtitle of the action | string | no | iOS 15+ | yes |
| systemIcon | refers to an icon name within [SF Symbols](https://developer.apple.com/design/human-interface-guidelines/sf-symbols/overview/) | string | no | iOS | yes |
-| icon | Custom Icons. | string | no | Android/iOS | yes |
-| iconColor | will change the color of the icon provided to the `icon` prop and has no effect on `systemIcon` (default: black) | string | no | Android/iOS | yes |
-| destructive | items are rendered in red | boolean | no | iOS | yes |
-| selected | items have a checkmark next to them | boolean | no | iOS | yes |
-| disabled | marks whether the action is disabled or not | boolean | no | Android/iOS | yes |
-| inlineChildren | marks whether its children (if any) should be rendered inline instead of in their own child menu | boolean | no | iOS | partially |
-| actions | will provide a one level deep nested menu | array | no | Android/iOS | partially |
+| icon | Custom Icons. | string | no | Android/iOS | yes |
+| iconColor | will change the color of the icon provided to the `icon` prop and has no effect on `systemIcon` (default: black) | string | no | Android/iOS | yes |
+| destructive | items are rendered in red | boolean | no | iOS | yes |
+| selected | items have a checkmark next to them | boolean | no | iOS | yes |
+| disabled | marks whether the action is disabled or not | boolean | no | Android/iOS | yes |
+| inlineChildren | marks whether its children (if any) should be rendered inline instead of in their own child menu | boolean | no | iOS | partially |
+| actions | will provide a one level deep nested menu | array | no | Android/iOS | partially |
-## 遗留问题
+## Known Issues
-## 其他
+## Others
-1.previewBackgroundColor属性,经过验证在iOS和Android均无效果。
+1.previewBackgroundColor 属性,经过验证在 iOS 和 Android 均无效果。
-2.actions属性是个结构体函数,所以包含其他上文列举属性,例如previewBackgroundColor等。所以,属于部分支持
+2.actions 属性是个结构体函数,所以包含其他上文列举属性,例如 previewBackgroundColor 等。所以,属于部分支持
-3.该库的具体逻辑实现,在不同平台,均为调用平台对应的底层Menu接口进行相关操作。所以,不同平台上,动效展示等会有所不同。
+3.该库的具体逻辑实现,在不同平台,均为调用平台对应的底层 Menu 接口进行相关操作。所以,不同平台上,动效展示等会有所不同。
-4.onPress方法的callback参考:{ nativeEvent: { index, indexPath, name } }.
+4.onPress 方法的 callback 参考: { nativeEvent: { index, indexPath, name } }.
-5.当systemIcon和icon同时配置的时候,在Harmony Next平台上,systemIcon的优先级高于icon
+5.当 systemIcon 和 icon 同时配置的时候,在 Harmony Next 平台上,systemIcon 的优先级高于 icon
-## 开源协议
+## License
-本项目基于 [The MIT License (MIT)](https://github.com/mpiannucci/react-native-context-menu-view/blob/main/LICENSE) ,请自由地享受和参与开源。
+This project is licensed under [The MIT License (MIT)](https://github.com/mpiannucci/react-native-context-menu-view/blob/main/LICENSE).
--
Gitee
From ebcbc648b6a50971251a487849f5bd5056aab5e6 Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 14:56:38 +0800
Subject: [PATCH 16/53] docs: [Issues: #IB07UG] react-native-document-picker.md
---
en/react-native-document-picker.md | 452 ++++++++++++++++-------------
1 file changed, 254 insertions(+), 198 deletions(-)
diff --git a/en/react-native-document-picker.md b/en/react-native-document-picker.md
index 8da343cc..7afed0c4 100644
--- a/en/react-native-document-picker.md
+++ b/en/react-native-document-picker.md
@@ -1,4 +1,4 @@
-> 模板版本:v0.2.2
+> Template version: v0.2.2
react-native-document-picker
@@ -13,21 +13,19 @@
+> [!TIP] [GitHub address](https://github.com/react-native-oh-library/document-picker)
+## Installation and Usage
-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/document-picker)
+Find the matching version information in the release address of a third-party library and download an applicable .tgz package: [@react-native-oh-library/react-native-document-picker Releases](https://github.com/react-native-oh-library/document-picker/releases).
-## 安装与使用
+Go to the project directory and execute the following instruction:
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-library/react-native-document-picker Releases](https://github.com/react-native-oh-library/document-picker/releases),并下载适用版本的 tgz 包。
-
-进入到工程目录并输入以下命令:
-
->[!TIP] # 处替换为 tgz 包的路径
+> [!TIP] Replace the content with the path of the .tgz package at the comment sign (#).
-#### npm
+#### npm
```bash
npm install @react-native-oh-tpl/react-native-document-picker@file:#
@@ -41,105 +39,136 @@ yarn add @react-native-oh-tpl/react-native-document-picker@file:#
-下面的代码展示了这个库的基本使用场景:
+The following code shows the basic use scenario of the repository:
->[!WARNING] 使用时 import 的库名不变。
+> [!WARNING] The name of the imported repository remains unchanged.
```tsx
import React, { useState } from "react";
-import { Text, TouchableOpacity, View, StyleSheet, Switch, ScrollView } from 'react-native';
-import { pick, types, pickDirectory, pickSingle, DocumentPickerOptions } from 'react-native-document-picker';
+import {
+ Text,
+ TouchableOpacity,
+ View,
+ StyleSheet,
+ Switch,
+ ScrollView,
+} from "react-native";
+import {
+ pick,
+ types,
+ pickDirectory,
+ pickSingle,
+ DocumentPickerOptions,
+} from "react-native-document-picker";
const typeList = Object.keys(types);
interface MultiSelectProps {
- onSelectValue?: (val: string[]) => void
+ onSelectValue?: (val: string[]) => void;
}
interface UiSelItem {
- label: keyof typeof types,
- selected: boolean,
- index: number
+ label: keyof typeof types;
+ selected: boolean;
+ index: number;
}
-type DirType = 'documentDirectory' | 'cachesDirectory'
+type DirType = "documentDirectory" | "cachesDirectory";
interface DirOpt {
- label: DirType,
- selected: boolean
+ label: DirType;
+ selected: boolean;
}
const MultiSelect: React.FC = ({ onSelectValue }) => {
-
- const [typeUi, setTypeUi] = useState(typeList.map((val, index) => ({
- label: val as keyof typeof types,
- selected: false,
- index
- })))
-
- const onClickSelLabel = (val: typeof typeUi[0]) => {
- // 选择allfile不行选择其它的
- if (typeUi.find(t => t.label === 'allFiles')?.selected && val.label !== 'allFiles') {
+ const [typeUi, setTypeUi] = useState(
+ typeList.map((val, index) => ({
+ label: val as keyof typeof types,
+ selected: false,
+ index,
+ }))
+ );
+
+ const onClickSelLabel = (val: (typeof typeUi)[0]) => {
+ if (
+ typeUi.find((t) => t.label === "allFiles")?.selected &&
+ val.label !== "allFiles"
+ ) {
return;
}
let newList = [];
- if (val.label === 'allFiles') {
- newList = typeUi.map(s => {
- return s.label === 'allFiles' ? { ...s, selected: !s.selected } : { ...s, selected: false }
- })
+ if (val.label === "allFiles") {
+ newList = typeUi.map((s) => {
+ return s.label === "allFiles"
+ ? { ...s, selected: !s.selected }
+ : { ...s, selected: false };
+ });
} else {
- newList = typeUi.map(s => {
- return val.index === s.index ? { ...s, selected: !s.selected } : { ...s }
- })
+ newList = typeUi.map((s) => {
+ return val.index === s.index
+ ? { ...s, selected: !s.selected }
+ : { ...s };
+ });
}
- const extList = newList.filter(t => t.selected).map(t => types[t.label]).reduce((res, typeStr) => {
- res.push(...typeStr.split(' '))
- return res;
- }, [] as string[]);
+ const extList = newList
+ .filter((t) => t.selected)
+ .map((t) => types[t.label])
+ .reduce((res, typeStr) => {
+ res.push(...typeStr.split(" "));
+ return res;
+ }, [] as string[]);
if (onSelectValue) {
- onSelectValue(extList)
+ onSelectValue(extList);
}
setTypeUi(newList);
- }
+ };
- return <>
-
-
- picker 的文件类型
-
- {
- typeUi.map(s =>
- {
- onClickSelLabel(s);
- }} >
-
-
- {s.label}
-
+ return (
+ <>
+
+
+
+ picker 的文件类型
+
+
+ {typeUi.map((s) => (
+ {
+ onClickSelLabel(s);
+ }}
+ >
+
+ {s.label}
- )
- }
-
- >
-}
+ ))}
+
+ >
+ );
+};
export default function DocumentPickerDemo(): JSX.Element {
-
- const [pickResult, setPickResult] = useState('');
- // 是否允许多选
+ const [pickResult, setPickResult] = useState("");
const [allowMultiSelection, setAllowMultiSelection] = useState(true);
- // 选择文件类型
const [fileTypes, setFileTypes] = useState([]);
- // copyTo 文件夹
const [dirUi, setDirui] = useState>([
- { label: 'documentDirectory', selected: false },
- { label: 'cachesDirectory', selected: false },
+ { label: "documentDirectory", selected: false },
+ { label: "cachesDirectory", selected: false },
]);
- const copyTo = dirUi.find(d => d.selected)?.label;
+ const copyTo = dirUi.find((d) => d.selected)?.label;
- const pickOpt: DocumentPickerOptions<'harmony'> = {
+ const pickOpt: DocumentPickerOptions<"harmony"> = {
allowMultiSelection,
};
if (copyTo) {
@@ -150,15 +179,15 @@ export default function DocumentPickerDemo(): JSX.Element {
}
const onDirSelect = (val: DirOpt) => {
- const newUiList = dirUi.map(d => {
+ const newUiList = dirUi.map((d) => {
if (val.label === d.label) {
- return { ...d, selected: !d.selected }
+ return { ...d, selected: !d.selected };
} else {
- return { ...d, selected: false }
+ return { ...d, selected: false };
}
});
setDirui(newUiList);
- }
+ };
const pickFile = async () => {
try {
@@ -167,7 +196,7 @@ export default function DocumentPickerDemo(): JSX.Element {
} catch (err) {
console.log(err);
}
- }
+ };
const pickS = async () => {
try {
@@ -176,95 +205,127 @@ export default function DocumentPickerDemo(): JSX.Element {
} catch (err) {
console.log(err);
}
- }
+ };
const pickDir = async () => {
const res = await pickDirectory();
console.log(res);
- }
+ };
- return
-
- {JSON.stringify(pickOpt)}
-
-
-
-
-
- 是否多选
-
-
-
-
-
- copyTo文件夹
-
-
-
- {
- dirUi.map(s =>
- {
- onDirSelect(s);
- }} >
-
-
- {s.label}
-
-
-
- )
- }
-
+ return (
+
+ {JSON.stringify(pickOpt)}
-
-
- pick file
+
+
+
+
+ 是否多选
-
-
-
- pick file single
+
+
+
+
+
+
+ copyTo文件夹
-
-
-
- pick Dir
+
+
+
+ {dirUi.map((s) => (
+ {
+ onDirSelect(s);
+ }}
+ >
+
+ {s.label}
+
+
+ ))}
+
+
+
+ pick file
+
+
+ pick file single
+
+
+ pick Dir
+
+
+
+ 选择结果
-
-
- 选择结果
-
-
- {pickResult}
-
-
+
+ {pickResult}
+
+ );
}
const styles = StyleSheet.create({
- TextInput: { height: 40, borderColor: '#ccc', borderWidth: 1, borderRadius: 4, width: '90%' },
- btn: { borderRadius: 10, display: 'flex', justifyContent: 'center', alignItems: 'center', padding: 10, margin: 10, backgroundColor: 'blue' },
- btnText: { fontWeight: 'bold', color: '#fff', fontSize: 20 },
- selectBtn: { padding: 8, margin: 3, fontSize: 18, borderWidth: 1, borderRadius: 8, borderColor: '#753c13' },
- selectBtnActive: { padding: 8, margin: 3, backgroundColor: '#e2803b', fontSize: 18, borderRadius: 8, borderWidth: 1 }
+ TextInput: {
+ height: 40,
+ borderColor: "#ccc",
+ borderWidth: 1,
+ borderRadius: 4,
+ width: "90%",
+ },
+ btn: {
+ borderRadius: 10,
+ display: "flex",
+ justifyContent: "center",
+ alignItems: "center",
+ padding: 10,
+ margin: 10,
+ backgroundColor: "blue",
+ },
+ btnText: { fontWeight: "bold", color: "#fff", fontSize: 20 },
+ selectBtn: {
+ padding: 8,
+ margin: 3,
+ fontSize: 18,
+ borderWidth: 1,
+ borderRadius: 8,
+ borderColor: "#753c13",
+ },
+ selectBtnActive: {
+ padding: 8,
+ margin: 3,
+ backgroundColor: "#e2803b",
+ fontSize: 18,
+ borderRadius: 8,
+ borderWidth: 1,
+ },
});
-
-
```
-## 使用 Codegen(如本库已适配了 Codegen )
+## Use Codegen
-本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。
+If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/zh-cn/codegen.md).
## 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
{
@@ -275,18 +336,15 @@ const styles = StyleSheet.create({
}
```
-### 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": {
@@ -295,22 +353,22 @@ 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] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
+> [!TIP] For details, see [Directly Linking Source Code](/zh-cn/link-source-code.md).
-### 3.在 ArkTs 侧引入 DocumentPickerPackage
+### 3. Introducing DocumentPickerPackage to ArkTS
-打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
+Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
```diff
...
@@ -324,72 +382,70 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
}
```
-### 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
-### 兼容性
+### 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-library/react-native-document-picker Releases](https://github.com/react-native-oh-library/document-picker/releases)
+Check the release version information in the release address of the third-party library: [@react-native-oh-library/react-native-document-picker Releases](https://github.com/react-native-oh-library/document-picker/releases)
-
-## 属性
+## 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.
-### option pick方法的传参选项
+### option pick 方法的传参选项
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ---- | ----------- | ---- | -------- | -------- | ------------------ |
-| allowMultiSelection | Whether selecting multiple files is allowed. For pick, this is false by default. allowMultiSelection is false for pickSingle and cannot be overridden. | boolean | no | IOS/Android | yes |
-| type | The type or types of documents to allow selection of. An array of strings or single string. | string or Array | no | IOS/Android | yes |
-| copyTo | Copy the selected file to the specified folder. | "cachesDirectory" \| "documentDirectory" | no | IOS/Android | yes |
-| presentationStyle | Controls how the picker is presented, e.g. on an iPad you may want to present it fullscreen. Defaults to pageSheet. | 'fullScreen' \| 'pageSheet' \| 'formSheet' \| 'overFullScreen' | no | IOS | no |
-| transitionStyle | Configure the transition style of the picker. Defaults to coverVertical. | 'coverVertical' \| 'flipHorizontal' \| 'crossDissolve' \| 'partialCurl' | no | IOS | no |
-| mode | Defaults to import. If mode is set to import the document picker imports the file from outside to inside the sandbox, otherwise if mode is set to open the document picker opens the file in-place. | "import" \| "open" | no | IOS | no |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | -------- | ----------- | ----------------- |
+| allowMultiSelection | Whether selecting multiple files is allowed. For pick, this is false by default. allowMultiSelection is false for pickSingle and cannot be overridden. | boolean | no | IOS/Android | yes |
+| type | The type or types of documents to allow selection of. An array of strings or single string. | string or Array | no | IOS/Android | yes |
+| copyTo | Copy the selected file to the specified folder. | "cachesDirectory" \| "documentDirectory" | no | IOS/Android | yes |
+| presentationStyle | Controls how the picker is presented, e.g. on an iPad you may want to present it fullscreen. Defaults to pageSheet. | 'fullScreen' \| 'pageSheet' \| 'formSheet' \| 'overFullScreen' | no | IOS | no |
+| transitionStyle | Configure the transition style of the picker. Defaults to coverVertical. | 'coverVertical' \| 'flipHorizontal' \| 'crossDissolve' \| 'partialCurl' | no | IOS | no |
+| mode | Defaults to import. If mode is set to import the document picker imports the file from outside to inside the sandbox, otherwise if mode is set to open the document picker opens the file in-place. | "import" \| "open" | no | IOS | no |
## 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.
+> [!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 |
-|----------------|-------------------------------| -- | -------- | ----------- | ----------------- |
-| pick | The method for picking a file. | function | No | IOS/Android | yes |
-| pickSingle | Select a single file | function | No | IOS/Android | yes |
-| pickDirectory | Opens a directory picker. | function | No | IOS/Android | no |
-| isCancel | If the user cancels the document picker without choosing a file (by pressing the system back button on Android or the Cancel button on iOS), the Promise will be rejected with a cancellation error. You can check for this error using DocumentPicker.isCancel(err). | function | No | IOS/Android | yes |
-| isInProgress | If the user somehow manages to open multiple file pickers (e.g. due the app being unresponsive), then only the picked result from the last opened picker will be considered and the promises from previous opened pickers will be rejected with an error that you can check using DocumentPicker.isInProgress() | function | No | IOS/Android | yes |
-| releaseSecureAccess | If mode is set to open, iOS is giving you secure access to a file located outside from your sandbox. In that case Apple is asking you to release the access as soon as you finish using the resource. | function | No | IOS | no |
-| types | File type object. eg type.images、types.pdf | function | No | IOS/Android | yes |
-| perPlatformTypes | Different platforms, file type object map | function | No | IOS/Android | yes |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | ----------- | ----------------- |
+| pick | The method for picking a file. | function | No | IOS/Android | yes |
+| pickSingle | Select a single file | function | No | IOS/Android | yes |
+| pickDirectory | Opens a directory picker. | function | No | IOS/Android | no |
+| isCancel | If the user cancels the document picker without choosing a file (by pressing the system back button on Android or the Cancel button on iOS), the Promise will be rejected with a cancellation error. You can check for this error using DocumentPicker.isCancel(err). | function | No | IOS/Android | yes |
+| isInProgress | If the user somehow manages to open multiple file pickers (e.g. due the app being unresponsive), then only the picked result from the last opened picker will be considered and the promises from previous opened pickers will be rejected with an error that you can check using DocumentPicker.isInProgress() | function | No | IOS/Android | yes |
+| releaseSecureAccess | If mode is set to open, iOS is giving you secure access to a file located outside from your sandbox. In that case Apple is asking you to release the access as soon as you finish using the resource. | function | No | IOS | no |
+| types | File type object. eg type.images、types.pdf | function | No | IOS/Android | yes |
+| perPlatformTypes | Different platforms, file type object map | function | No | IOS/Android | yes |
+## Known Issues
-## 遗留问题
+- [ ] HarmonyOS 端 file picker selectMode 设置选文件夹无效: [issue#1](https://github.com/react-native-oh-library/document-picker/issues/1)
+- [ ] releaseSecureAccess 选择沙箱路径外文件无法实现, HarmonyOS 暂无此能力接口: [issue#2](https://github.com/react-native-oh-library/document-picker/issues/2)
-- [ ] HarmonyOS 端file picker selectMode设置选文件夹无效: [issue#1](https://github.com/react-native-oh-library/document-picker/issues/1)
-- [ ] releaseSecureAccess选择沙箱路径外文件无法实现, HarmonyOS 暂无此能力接口: [issue#2](https://github.com/react-native-oh-library/document-picker/issues/2)
+## Others
-## 其他
- 因权限问题无法读写图库资源,文件管理中从图库选择文件暂不支持。
-## 开源协议
+## License
-本项目基于 [The MIT License (MIT)](https://github.com/react-native-documents/document-picker/blob/master/LICENSE.md) ,请自由地享受和参与开源。
+This project is licensed under [The MIT License (MIT)](https://github.com/react-native-documents/document-picker/blob/master/LICENSE.md).
--
Gitee
From 4ec27f834c0da2753d415c6049068ffad4c353f8 Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 14:56:45 +0800
Subject: [PATCH 17/53] docs: [Issues: #IB07UG] react-native-dropdown-picker.md
---
en/react-native-dropdown-picker.md | 47 +++++++++++++++---------------
1 file changed, 24 insertions(+), 23 deletions(-)
diff --git a/en/react-native-dropdown-picker.md b/en/react-native-dropdown-picker.md
index 1c069d3c..5c863838 100644
--- a/en/react-native-dropdown-picker.md
+++ b/en/react-native-dropdown-picker.md
@@ -1,4 +1,4 @@
-模板版本:v0.2.2
+Template version: v0.2.2
react-native-dropdown-picker
@@ -13,9 +13,9 @@
-> [!TIP] [Github 地址](https://github.com/hossein-zare/react-native-dropdown-picker)
+> [!TIP] [GitHub address](https://github.com/hossein-zare/react-native-dropdown-picker)
-## 安装与使用
+## Installation and Usage
@@ -33,9 +33,9 @@ yarn add react-native-dropdown-picker@5.4.6
-下面的代码展示了这个库的基本使用场景:
+The following code shows the basic use scenario of the repository:
-> [!WARNING] 使用时 import 的库名不变。
+> [!WARNING] The name of the imported repository remains unchanged.
```js
import React, { useState } from "react";
@@ -86,22 +86,23 @@ export default function App() {
}
```
-## 约束与限制
+## Constraints
-### 兼容性
+### Compatibility
-本文档内容基于以下版本验证通过:
+This document is verified based on the following versions:
1. RNOH: 0.72.27; SDK: HarmonyOS-Next-DB1 5.0.0.25 (API Version 12 Canary4); IDE: DevEco Studio 5.0.3.400SP7; ROM: 3.0.0.29;
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;
-## 属性
-> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
+## Properties
-> [!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.
+
+> [!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 |
-|----------------------------|------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|----------|----------|-------------------|
+| -------------------------- | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | -------- | -------- | ----------------- |
| items | State variable that holds the items. | array | yes | All | yes |
| value | State variable that specifies the value of the selected item. It's an array of values for multiple item pickers. | string\|string[] | yes | All | yes |
| open | State variable that specifies whether the picker is open. | boolean | yes | All | yes |
@@ -155,7 +156,7 @@ export default function App() {
| activityIndicatorSize | Changes the default size of the ActivityIndicator. | number | no | All | yes |
| searchable | Enables the search feature in the drop-down menu / modal. | boolean | no | All | yes |
| searchTextInputProps | Adds native props for the text input. | object | no | All | yes |
-| searchWithRegionalAccents | Allows searching without typing local accents. | boolean | no | All | no |
+| searchWithRegionalAccents | Allows searching without typing local accents. | boolean | no | All | no |
| disableLocalSearch | Disables search between local items. This comes in handy for remote search. | boolean | no | All | yes |
| addCustomItem | Shows the searched text as an item when there's nothing to show. | boolean | no | All | yes |
| searchPlaceholder | Changes the placeholder text of the text input. Both of the following properties are available. | string | no | All | yes |
@@ -210,26 +211,26 @@ export default function App() {
| modalTitleStyle | Set modalTitleStyle | object | no | All | yes |
| rtl | Makes the component right to left. | boolean | no | All | yes |
+## Static Methods
-## 静态方法
-
-> [!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 |
-|-------------------|-------------------------------------------------------|----------|----------|----------|-------------------|
+| ----------------- | ----------------------------------------------------- | -------- | -------- | -------- | ----------------- |
| setLanguage | You can also change the default language globally. | function | no | All | yes |
| addTranslation | You are able to add a new translation to the package. | function | no | All | yes |
| modifyTranslation | Modify an existing translation | function | no | All | yes |
| addTheme | Add a theme | function | no | All | yes |
| setTheme | Change the default theme | function | no | All | yes |
-## 遗留问题
-- [ ] 方法String.prototype.normalize('NFD')在RN框架下有问题,导致属性searchWithRegionalAccents不生效。
+## Known Issues
+
+- [ ] 方法 String.prototype.normalize('NFD')在 RN 框架下有问题,导致属性 searchWithRegionalAccents 不生效。
-## 其他
+## Others
-## 开源协议
+## License
-本项目基于 [The MIT License (MIT)](https://github.com/hossein-zare/react-native-dropdown-picker/blob/5.x/LICENSE) ,请自由地享受和参与开源。
+This project is licensed under [The MIT License (MIT)](https://github.com/hossein-zare/react-native-dropdown-picker/blob/5.x/LICENSE).
--
Gitee
From 2bceba1f6b2a56d887aaf26cfabec3c352ab0e9c Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 14:56:53 +0800
Subject: [PATCH 18/53] docs: [Issues: #IB07UG] react-native-dropdownalert.md
---
en/react-native-dropdownalert.md | 71 +++++++++++++++-----------------
1 file changed, 33 insertions(+), 38 deletions(-)
diff --git a/en/react-native-dropdownalert.md b/en/react-native-dropdownalert.md
index c319b12a..9d13c8d7 100644
--- a/en/react-native-dropdownalert.md
+++ b/en/react-native-dropdownalert.md
@@ -1,4 +1,4 @@
-> 模板版本:v0.2.2
+> Template version: v0.2.2
react-native-dropdownalert
@@ -12,15 +12,15 @@
-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-dropdownalert)
+> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-dropdownalert)
-## 安装与使用
+## Installation and Usage
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-dropdownalert Releases](https://github.com/react-native-oh-library/react-native-dropdownalert/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-dropdownalert Releases](https://github.com/react-native-oh-library/react-native-dropdownalert/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-dropdownalert@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 React, { useRef, useState } from "react";
@@ -243,13 +243,13 @@ const styles = StyleSheet.create({
export default App;
```
-## 约束与限制
+## 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-dropdownalert Releases](https://github.com/react-native-oh-library/react-native-dropdownalert/releases)
+Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-dropdownalert Releases](https://github.com/react-native-oh-library/react-native-dropdownalert/releases)
## DropdownAlert
@@ -257,11 +257,11 @@ export default App;
DropdownAlertType 是 DropdownAlert 库导出的一个枚举对象,列举了弹框的类型。
-#### DropdownAlertType 属性
+#### DropdownAlertType Property
-> [!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 |
| ------- | ------------ | ------ | ------------ | -------- | ----------------- |
@@ -274,7 +274,7 @@ DropdownAlertType 是 DropdownAlert 库导出的一个枚举对象,列举了
DropdownAlertDismissAction 是 DropdownAlert 库导出的一个枚举对象,列举了弹框消失的动作类型。
-#### DropdownAlertDismissAction 属性
+#### DropdownAlertDismissAction Property
| Name | Description | Type | **Required** | Platform | HarmonyOS Support |
| ------------ | ----------------- | ------ | ------------ | -------- | ----------------- |
@@ -288,7 +288,7 @@ DropdownAlertDismissAction 是 DropdownAlert 库导出的一个枚举对象,
DropdownAlertColor 是 DropdownAlert 库导出的一个枚举对象,列举了弹框的颜色
-#### DropdownAlertColor 属性
+#### DropdownAlertColor Property
| Name | Description | Type | **Required** | Platform | HarmonyOS Support |
| ------- | -------------- | ------ | ------------ | -------- | ----------------- |
@@ -302,7 +302,7 @@ DropdownAlertColor 是 DropdownAlert 库导出的一个枚举对象,列举了
DropDownAlertImage 是 DropdownAlert 库导出的一个枚举对象,列举了弹框的图片资源。
-#### DropDownAlertImage 属性
+#### DropDownAlertImage Property
| Name | Description | Type | **Required** | Platform | HarmonyOS Support |
| ------- | ---------------------------------------------------------------------- | ------------------- | ------------ | -------- | ----------------- |
@@ -316,7 +316,7 @@ DropDownAlertImage 是 DropdownAlert 库导出的一个枚举对象,列举了
DropdownAlertToValue 是 DropdownAlert 库导出的一个枚举对象,有两种值 Alert 和 Dismiss。
-#### DropdownAlertToValue 属性
+#### DropdownAlertToValue Property
| Name | Description | Type | **Required** | Platform | HarmonyOS Support |
| ------- | ----------- | ------ | ------------ | -------- | ----------------- |
@@ -327,7 +327,7 @@ DropdownAlertToValue 是 DropdownAlert 库导出的一个枚举对象,有两
DropDownAlertTestID 是 DropdownAlert 库导出的一个枚举对象,列举了弹框的测试 ID。
-#### DropDownAlertTestID 属性
+#### DropDownAlertTestID Property
| Name | Description | Type | **Required** | Platform | HarmonyOS Support |
| ------------ | ----------------- | ------ | ------------ | -------- | ----------------- |
@@ -345,7 +345,7 @@ DropDownAlertTestID 是 DropdownAlert 库导出的一个枚举对象,列举了
DropdownAlertData 是 DropdownAlert 库导出的一个 class 对象,定义了弹框的数据内容,如标题、提示信息等。
-#### DropdownAlertData 属性
+#### DropdownAlertData Property
| Name | Description | Type | **Required** | Platform | HarmonyOS Support |
| -------- | --------------------------------------- | ------------------- | ------------ | -------- | ----------------- |
@@ -360,18 +360,18 @@ DropdownAlertData 是 DropdownAlert 库导出的一个 class 对象,定义了
DropdownAlertData 是 DropdownAlert 库导出的一个 class 对象,定义了弹框弹出位置,有顶部弹出和底部弹出两种。
-#### DropdownAlertPosition 属性
+#### DropdownAlertPosition Property
| Name | Description | Type | **Required** | Platform | HarmonyOS Support |
| ------ | ---------------------- | ----------------- | ------------ | -------- | ----------------- |
| Top | 顶部弹出,值为'top' | DropdownAlertType | no | All | yes |
| Bottom | 底部弹出,值为'bottom' | string | no | All | yes |
-### DropdownAlert 组件
+### DropdownAlert components
DropdownAlert 是 DropdownAlert 库导出的核心组件,定义了弹框所有属性,与 DropdownAlertProps 属性一致。
-#### DropdownAlert 属性
+#### DropdownAlert Property
| Name | Description | Type | **Required** | Platform | HarmonyOS Support |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------ | ------------ | -------- | ----------------- |
@@ -390,10 +390,10 @@ DropdownAlert 是 DropdownAlert 库导出的核心组件,定义了弹框所有
| dismissInterval | 弹窗自动消失的时间毫秒值 | number | no | All | yes |
| titleNumberOfLines | 弹窗标题的最大行数, | number | no | All | yes |
| messageNumberOfLines | 弹窗正文的最大行数,超过则省略 | number | no | All | yes |
-| elevation | 高度 | number | no | All | no |
-| zIndex | z 轴的值,类型 | number | no | All | no |
+| elevation | 高度 | number | no | All | yes |
+| zIndex | z 轴的值,类型 | number | no | All | yes |
| panResponderDismissDistance | 下滑弹窗消失距离 | number | no | All | yes |
-| animatedViewStyle | DropAlert 对象内部的 animatedView 样式 | ViewStyle | no | All | no |
+| animatedViewStyle | DropAlert 对象内部的 animatedView 样式 | ViewStyle | no | All | yes |
| alertViewStyle | DropAlert 对象内部的 alertViewStyle 样式 | ViewStyle | no | All | yes |
| safeViewStyle | DropAlert 对象内部的 safeView 样式 | ViewStyle | no | All | yes |
| textViewStyle | DropAlert 对象内部的 textView 样式 | ViewStyle | no | All | yes |
@@ -406,11 +406,11 @@ DropdownAlert 是 DropdownAlert 库导出的核心组件,定义了弹框所有
| onDismissCancel | 弹窗关闭触发的函数,支持的关闭方式为点击 cancel | function | no | All | yes |
| onDismissPress | 弹窗关闭触发的函数,支持的关闭方式为点击弹窗 | function | no | All | yes |
| onDismissPanResponder | 弹窗关闭触发的函数,支持的关闭方式为向下滑动,仅在 alertPosition 为“bottom”时生效 | function | no | All | yes |
-| onDismissProgrammatic | 弹窗关闭触发的函数,支持的关闭方式为程序式关闭,也是默认的值,如果非上面四种关闭方式,则默认触发此关闭函数。 | function | no | All | no |
+| onDismissProgrammatic | 弹窗关闭触发的函数,支持的关闭方式为程序式关闭,也是默认的值,如果非上面四种关闭方式,则默认触发此关闭函数。 | function | no | All | yes |
| showCancel | 是否显示弹窗的 cancel 模块 | boolean | no | All | yes |
| onDismissPressDisabled | 是否允许通过点击关闭弹窗 | boolean | no | All | yes |
| panResponderEnabled | 是否允许通过向下滑动关闭弹窗,仅在 alertPosition 为“bottom”时生效 | boolean | no | All | yes |
-| translucent | 是否半透明 | boolean | no | All | no |
+| translucent | 是否半透明 | boolean | no | All | yes |
| updateStatusBar | 是否更新状态栏 | boolean | no | All | yes |
| activeStatusBarStyle | 弹框出现时,将状态栏置为设置的样式,需要配合 updateStatusBar=true 才生效 | StatusBarStyle | no | Android | yes |
| inactiveStatusBarStyle | 弹框消失时,将状态栏置为设置的样式,需要配合 updateStatusBar=true 才生效 | StatusBarStyle | no | Android | yes |
@@ -433,15 +433,10 @@ DropdownAlert 是 DropdownAlert 库导出的核心组件,定义了弹框所有
| children | 弹窗子元素 | ReactNode | no | All | yes |
| alertPosition | top' 或者 'bottom' | string | no | All | yes |
-## 遗留问题
+## Known Issues
-## 其他
+## Others
-- DropdownAlert 组件的 animatedViewStyle 属性不生效,设置之后弹窗变为黑色,与 iOS/Android 一致 [issue#314](https://github.com/testshallpass/react-native-dropdownalert/issues/314)
-- DropdownAlert 组件的 zindex 属性不生效,层级关系并未体现,与 iOS/Android 一致 [issue#315](https://github.com/testshallpass/react-native-dropdownalert/issues/315)
-- DropdownAlert 组件的 translucent 属性不生效,没有显示出状态栏半透明的效果,与 Android 一致 [issue#316](https://github.com/testshallpass/react-native-dropdownalert/issues/316)
-- DropdownAlert 组件绑定的 onDismissProgrammatic 函数无法触发,与 iOS/Android 一致 [issue#317](https://github.com/testshallpass/react-native-dropdownalert/issues/317)
+## License
-## 开源协议
-
-本项目基于 [The MIT License (MIT)](https://github.com/react-native-oh-library/react-native-dropdownalert/blob/master/LICENSE) ,请自由地享受和参与开源。
+This project is licensed under [The MIT License (MIT)](https://github.com/react-native-oh-library/react-native-dropdownalert/blob/master/LICENSE).
--
Gitee
From 9cc0a97cfc86e67fb062d68182bbfd6d49a86b85 Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 14:57:02 +0800
Subject: [PATCH 19/53] docs: [Issues: #IB07UG] react-native-easy-grid.md
---
en/react-native-easy-grid.md | 72 ++++++++++++++++--------------------
1 file changed, 32 insertions(+), 40 deletions(-)
diff --git a/en/react-native-easy-grid.md b/en/react-native-easy-grid.md
index ad983a82..c02b59f7 100644
--- a/en/react-native-easy-grid.md
+++ b/en/react-native-easy-grid.md
@@ -1,6 +1,6 @@
-> 模板版本:v0.2.2
+> Template version: v0.2.2
react-native-easy-grid
@@ -14,12 +14,11 @@
-> [!TIP] [Github 地址](https://github.com/GeekyAnts/react-native-easy-grid)
+> [!TIP] [GitHub address](https://github.com/GeekyAnts/react-native-easy-grid)
+## Installation and Usage
-## 安装与使用
-
-进入到工程目录并输入以下命令:
+Go to the project directory and execute the following instruction:
#### **npm**
@@ -30,74 +29,67 @@ npm install react-native-easy-grid@0.2.2
#### **yarn**
```bash
-yarn add react-native-easy-grid@0.2.2
+yarn add react-native-easy-grid@0.2.2
```
+The following code shows the basic use scenario of the repository:
-下面的代码展示了这个库的基本使用场景:
-
-> [!WARNING] 使用时 import 的库名不变。
-
+> [!WARNING] The name of the imported repository remains unchanged.
```js
-
import React from "react";
-import { Text } from 'react-native';
+import { Text } from "react-native";
import { Col, Row, Grid } from "react-native-easy-grid";
const App = () => {
-
return (
-
-
-
+
+
+
-
+
-
-
-
+
+
+
- )
-
+ );
};
export default App;
-
```
-## 约束与限制
-
-##### 兼容性
-本文档内容基于以下版本验证通过:
+## Constraints
-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;
+##### Compatibility
+This document is verified based on the following versions:
-## 属性
+RNOH: 0.72.27; SDK: HarmonyOS-NEXT Developer Beta1 5.0.0.25 ; IDE: DevEco Studio 5.0.3.400SP7; ROM: 3.0.0.25;
-Grid、Row、Col组件接收所有 [React Native View](https://reactnative.dev/docs/view#props)组件的Props
+## Properties
-> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
+Grid、Row、Col 组件接收所有 [React Native View](https://reactnative.dev/docs/view#props)组件的 Props
-> [!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.
-**RowProps和ColProps的公共属性:**
+> [!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 |
-| ---- | ----------- | ---- | -------- | -------- | ------------------ |
-| size | 布局占比 | number | no | iOS,Android | yes |
-| onPress:() => void | 点击事件 | function | no | iOS,Android | yes |
+**RowProps 和 ColProps 的公共属性: **
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ------------------- | ----------- | -------- | -------- | ----------- | ----------------- |
+| size | 布局占比 | number | no | iOS,Android | yes |
+| onPress: () => void | 点击事件 | function | no | iOS,Android | yes |
-## 遗留问题
+## Known Issues
-## 开源协议
+## License
-本项目基于 [Apache License 2.0](https://github.com/GeekyAnts/react-native-easy-grid/blob/master/LICENSE) ,请自由地享受和参与开源。
+This project is licensed under [Apache License 2.0](https://github.com/GeekyAnts/react-native-easy-grid/blob/master/LICENSE).
--
Gitee
From 70934b3043f4ad9a6210f8f5b2004635ca9213bb Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 14:57:10 +0800
Subject: [PATCH 20/53] docs: [Issues: #IB07UG]
react-native-element-dropdown.md
---
en/react-native-element-dropdown.md | 791 ++++++++++++++--------------
1 file changed, 399 insertions(+), 392 deletions(-)
diff --git a/en/react-native-element-dropdown.md b/en/react-native-element-dropdown.md
index 12695c9f..883bb1cd 100644
--- a/en/react-native-element-dropdown.md
+++ b/en/react-native-element-dropdown.md
@@ -1,5 +1,6 @@
-> 模板版本:v0.2.2
+
+> Template version: v0.2.2
react-native-element-dropdown
@@ -13,11 +14,11 @@
-> [!TIP] [Github 地址](https://github.com/hoaphantn7604/react-native-element-dropdown)
+> [!TIP] [GitHub address](https://github.com/hoaphantn7604/react-native-element-dropdown)
-## 安装与使用
+## Installation and Usage
-进入到工程目录并输入以下命令:
+Go to the project directory and execute the following instruction:
@@ -35,438 +36,444 @@ yarn add react-native-element-dropdown@2.12.1
-下面的代码展示了这个库的基本使用场景:
+The following code shows the basic use scenario of the repository:
-> [!WARNING] 使用时 import 的库名不变。
-### Dropdown example
-```js
- import React, { useState } from 'react';
- import { StyleSheet, Text, View } from 'react-native';
- import { Dropdown } from 'react-native-element-dropdown';
-
- const data = [
- { label: 'Item 1', value: '1' },
- { label: 'Item 2', value: '2' },
- { label: 'Item 3', value: '3' },
- { label: 'Item 4', value: '4' },
- { label: 'Item 5', value: '5' },
- { label: 'Item 6', value: '6' },
- { label: 'Item 7', value: '7' },
- { label: 'Item 8', value: '8' },
- ];
-
- const DropdownComponent = () => {
- const [value, setValue] = useState(null);
- const [isFocus, setIsFocus] = useState(false);
-
- const renderLabel = () => {
- if (value || isFocus) {
- return (
-
- Dropdown label
-
- );
- }
- return null;
- };
-
- return (
-
- {renderLabel()}
- setIsFocus(true)}
- onBlur={() => setIsFocus(false)}
- onChange={item => {
- setValue(item.value);
- setIsFocus(false);
- }}
- />
-
- );
- };
+> [!WARNING] The name of the imported repository remains unchanged.
- export default DropdownComponent;
+### Dropdown example
- const styles = StyleSheet.create({
- container: {
- backgroundColor: 'white',
- padding: 16,
- },
- dropdown: {
- height: 50,
- borderColor: 'gray',
- borderWidth: 0.5,
- borderRadius: 8,
- paddingHorizontal: 8,
- },
- icon: {
- marginRight: 5,
- },
- label: {
- position: 'absolute',
- backgroundColor: 'white',
- left: 22,
- top: 8,
- zIndex: 999,
- paddingHorizontal: 8,
- fontSize: 14,
- },
- placeholderStyle: {
- fontSize: 16,
- },
- selectedTextStyle: {
- fontSize: 16,
- },
- iconStyle: {
- width: 20,
- height: 20,
- },
- inputSearchStyle: {
- height: 40,
- fontSize: 16,
- },
- });
-```
-### MultiSelect example
```js
- import React, { useState } from 'react';
- import { StyleSheet, View } from 'react-native';
- import { MultiSelect } from 'react-native-element-dropdown';
-
- const data = [
- { label: 'Item 1', value: '1' },
- { label: 'Item 2', value: '2' },
- { label: 'Item 3', value: '3' },
- { label: 'Item 4', value: '4' },
- { label: 'Item 5', value: '5' },
- { label: 'Item 6', value: '6' },
- { label: 'Item 7', value: '7' },
- { label: 'Item 8', value: '8' },
- ];
-
- const MultiSelectComponent = () => {
- const [selected, setSelected] = useState([]);
-
- return (
-
- {
- setSelected(item);
- }}
- selectedStyle={styles.selectedStyle}
- />
-
- );
+import React, { useState } from "react";
+import { StyleSheet, Text, View } from "react-native";
+import { Dropdown } from "react-native-element-dropdown";
+
+const data = [
+ { label: "Item 1", value: "1" },
+ { label: "Item 2", value: "2" },
+ { label: "Item 3", value: "3" },
+ { label: "Item 4", value: "4" },
+ { label: "Item 5", value: "5" },
+ { label: "Item 6", value: "6" },
+ { label: "Item 7", value: "7" },
+ { label: "Item 8", value: "8" },
+];
+
+const DropdownComponent = () => {
+ const [value, setValue] = useState(null);
+ const [isFocus, setIsFocus] = useState(false);
+
+ const renderLabel = () => {
+ if (value || isFocus) {
+ return (
+
+ Dropdown label
+
+ );
+ }
+ return null;
};
- export default MultiSelectComponent;
-
- const styles = StyleSheet.create({
- container: { padding: 16 },
- dropdown: {
- height: 50,
- backgroundColor: 'transparent',
- borderBottomColor: 'gray',
- borderBottomWidth: 0.5,
- },
- placeholderStyle: {
- fontSize: 16,
- },
- selectedTextStyle: {
- fontSize: 14,
- },
- iconStyle: {
- width: 20,
- height: 20,
- },
- inputSearchStyle: {
- height: 40,
- fontSize: 16,
- },
- icon: {
- marginRight: 5,
- },
- selectedStyle: {
- borderRadius: 12,
- },
- });
+ return (
+
+ {renderLabel()}
+ setIsFocus(true)}
+ onBlur={() => setIsFocus(false)}
+ onChange={(item) => {
+ setValue(item.value);
+ setIsFocus(false);
+ }}
+ />
+
+ );
+};
+
+export default DropdownComponent;
+
+const styles = StyleSheet.create({
+ container: {
+ backgroundColor: "white",
+ padding: 16,
+ },
+ dropdown: {
+ height: 50,
+ borderColor: "gray",
+ borderWidth: 0.5,
+ borderRadius: 8,
+ paddingHorizontal: 8,
+ },
+ icon: {
+ marginRight: 5,
+ },
+ label: {
+ position: "absolute",
+ backgroundColor: "white",
+ left: 22,
+ top: 8,
+ zIndex: 999,
+ paddingHorizontal: 8,
+ fontSize: 14,
+ },
+ placeholderStyle: {
+ fontSize: 16,
+ },
+ selectedTextStyle: {
+ fontSize: 16,
+ },
+ iconStyle: {
+ width: 20,
+ height: 20,
+ },
+ inputSearchStyle: {
+ height: 40,
+ fontSize: 16,
+ },
+});
```
-### SelectCountry example
-```js
- import React, { useState } from 'react';
- import { StyleSheet } from 'react-native';
- import { SelectCountry } from 'react-native-element-dropdown';
-
- const local_data = [
- {
- value: '1',
- lable: 'Country 1',
- image: {
- uri: 'https://www.vigcenter.com/public/all/images/default-image.jpg',
- },
- },
- {
- value: '2',
- lable: 'Country 2',
- image: {
- uri: 'https://www.vigcenter.com/public/all/images/default-image.jpg',
- },
- },
- {
- value: '3',
- lable: 'Country 3',
- image: {
- uri: 'https://www.vigcenter.com/public/all/images/default-image.jpg',
- },
- },
- {
- value: '4',
- lable: 'Country 4',
- image: {
- uri: 'https://www.vigcenter.com/public/all/images/default-image.jpg',
- },
- },
- {
- value: '5',
- lable: 'Country 5',
- image: {
- uri: 'https://www.vigcenter.com/public/all/images/default-image.jpg',
- },
- },
- ];
- const SelectCountryScreen = _props => {
- const [country, setCountry] = useState('1');
+### MultiSelect example
- return (
- {
+ const [selected, setSelected] = useState([]);
+
+ return (
+
+ {
- setCountry(e.value);
+ value={selected}
+ onChange={(item) => {
+ setSelected(item);
}}
+ selectedStyle={styles.selectedStyle}
/>
- );
- };
+
+ );
+};
+
+export default MultiSelectComponent;
+
+const styles = StyleSheet.create({
+ container: { padding: 16 },
+ dropdown: {
+ height: 50,
+ backgroundColor: "transparent",
+ borderBottomColor: "gray",
+ borderBottomWidth: 0.5,
+ },
+ placeholderStyle: {
+ fontSize: 16,
+ },
+ selectedTextStyle: {
+ fontSize: 14,
+ },
+ iconStyle: {
+ width: 20,
+ height: 20,
+ },
+ inputSearchStyle: {
+ height: 40,
+ fontSize: 16,
+ },
+ icon: {
+ marginRight: 5,
+ },
+ selectedStyle: {
+ borderRadius: 12,
+ },
+});
+```
- export default SelectCountryScreen;
+### SelectCountry example
- const styles = StyleSheet.create({
- dropdown: {
- margin: 16,
- height: 50,
- borderBottomColor: 'gray',
- borderBottomWidth: 0.5,
- },
- imageStyle: {
- width: 24,
- height: 24,
+```js
+import React, { useState } from "react";
+import { StyleSheet } from "react-native";
+import { SelectCountry } from "react-native-element-dropdown";
+
+const local_data = [
+ {
+ value: "1",
+ lable: "Country 1",
+ image: {
+ uri: "https://www.vigcenter.com/public/all/images/default-image.jpg",
},
- placeholderStyle: {
- fontSize: 16,
+ },
+ {
+ value: "2",
+ lable: "Country 2",
+ image: {
+ uri: "https://www.vigcenter.com/public/all/images/default-image.jpg",
},
- selectedTextStyle: {
- fontSize: 16,
- marginLeft: 8,
+ },
+ {
+ value: "3",
+ lable: "Country 3",
+ image: {
+ uri: "https://www.vigcenter.com/public/all/images/default-image.jpg",
},
- iconStyle: {
- width: 20,
- height: 20,
+ },
+ {
+ value: "4",
+ lable: "Country 4",
+ image: {
+ uri: "https://www.vigcenter.com/public/all/images/default-image.jpg",
},
- inputSearchStyle: {
- height: 40,
- fontSize: 16,
+ },
+ {
+ value: "5",
+ lable: "Country 5",
+ image: {
+ uri: "https://www.vigcenter.com/public/all/images/default-image.jpg",
},
- });
+ },
+];
+
+const SelectCountryScreen = (_props) => {
+ const [country, setCountry] = useState("1");
+
+ return (
+ {
+ setCountry(e.value);
+ }}
+ />
+ );
+};
+
+export default SelectCountryScreen;
+
+const styles = StyleSheet.create({
+ dropdown: {
+ margin: 16,
+ height: 50,
+ borderBottomColor: "gray",
+ borderBottomWidth: 0.5,
+ },
+ imageStyle: {
+ width: 24,
+ height: 24,
+ },
+ placeholderStyle: {
+ fontSize: 16,
+ },
+ selectedTextStyle: {
+ fontSize: 16,
+ marginLeft: 8,
+ },
+ iconStyle: {
+ width: 20,
+ height: 20,
+ },
+ inputSearchStyle: {
+ height: 40,
+ fontSize: 16,
+ },
+});
```
+## 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.403; 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
-
-## 属性
-
-详细请查看 [react-native-element-dropdown的文档介绍](https://github.com/hoaphantn7604/react-native-element-dropdown)
-
-> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-**Dropdown**:单选组件
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ------------------ | ----------------------------------------------- | --------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
-| mode | Mode 'modal' is show the dropdown in the middle of the screen. | 'default' or 'modal' of 'auto' | No | All | Yes |
-| data | Data is a plain array | Array | Yes | All | Yes |
-| labelField | Extract the label from the data item | String | Yes | All | Yes |
-| valueField | Extract the primary key from the data item | String | Yes | All | Yes |
-| searchField | Specify the field of data list you want to search | String | No | All | Yes |
-| onChange | Selection callback | (item: object) => void | Yes | All | Yes |
-| onChangeText | Callback that is called when the text input's text changes | (search: string) => void | No | All | Yes |
-| value | Set default value | Item | No | All | Yes |
-| placeholder | The string that will be rendered before dropdown has been selected | String | No | All | Yes |
-| placeholderStyle | Styling for text placeholder | TextStyle | No | All | Yes |
-| selectedTextStyle | Styling for selected text | TextStyle | No | All | Yes |
-| selectedTextProps | Text Props for selected text. Ex: numberOfLines={1} | TextProps | No | All | Yes |
-| style | Styling for view container | ViewStyle | No | All | Yes |
-| containerStyle | Styling for list container | ViewStyle | No | All | Yes |
-| maxHeight | Customize max height for list container | Number | No | All | Yes |
-| minHeight | Customize min height for list container | Number | No | All | Yes |
-| fontFamily | Customize font style | String | No | All | Yes |
-| iconStyle | Styling for icon | ImageStyle | No | All | Yes |
-| iconColor | Color of icons | String | No | All | Yes |
-| itemContainerStyle | Styling for item container in list | TextStyle | No | All | Yes |
-| itemTextStyle | Styling for text item in list | TextStyle | No | All | Yes |
-| activeColor | Background color for item selected in list container | String | No | All | Yes |
-| search | Show or hide input search | Boolean | No | All | Yes |
-| searchQuery | Callback used to filter the list of items | (keyword: string, labelValue: string) => Boolean| No | All | Yes |
-| inputSearchStyle | Styling for input search | ViewStyle | No | All | Yes |
-| searchPlaceholder | The string that will be rendered before text input has been entered | String | No | All | Yes |
-| renderInputSearch | Customize TextInput search | (onSearch: (text:string) => void) => JSX.Element| No | All | Yes |
-| disable | Specifies the disabled state of the Dropdown | Boolean | No | All | Yes |
-| dropdownPosition | Dropdown list position. Default is 'auto' | 'auto' or 'top' or 'bottom' | No | All | Yes |
-| autoScroll | Auto scroll to index item selected, default is true | Boolean | No | All | Yes |
-| showsVerticalScrollIndicator | When true, shows a vertical scroll indicator, default is true | Boolean | No | All | Yes |
-| renderLeftIcon | Customize left icon for dropdown | (visible?: boolean) => JSX.Element | No | All | Yes |
-| renderRightIcon | Customize right icon for dropdown | (visible?: boolean) => JSX.Element | No | All | Yes |
-| renderItem | Takes an item from data and renders it into the list | (item: object, selected: Boolean) => JSX.Element| No | All | Yes |
-| flatListProps | Customize FlatList element | FlatListProps | No | All | Yes |
-| inverted | Reverses the direction of scroll on top position mode. Default is true | Boolean | No | All | Yes |
-| onFocus | Callback that is called when the dropdown is focused | () => void | No | All | Yes |
-| onBlur | Callback that is called when the dropdown is blurred | () => void | No | All | Yes |
-| keyboardAvoiding | keyboardAvoiding default is true | Boolean | No | All | Yes |
-| backgroundColor | Set background color | String | No | All | Yes |
-| confirmSelectItem | Turn On confirm select item. Refer example/src/dropdown/example3 | Boolean | No | All | Yes |
-| onConfirmSelectItem | Selection callback. Refer example/src/dropdown/example3 | (item: object) => void | No | All | Yes |
-| testID | Used to locate this view in end-to-end tests | String | No | All | Yes |
-| itemTestIDField | Add this field to the input data. Ex: DATA = [{itemTestIDField: '', label: '', value:: ''}] | String | No | All | Yes |
-| accessibilityLabel | Set an accessibilityLabel on the view, so that people who use VoiceOver know what element they have selected | String | No | All | Yes |
-| itemAccessibilityLabelField | Add this field to the input data. Ex: DATA = [{itemAccessibilityLabelField: '', label: '', value:: ''}] | String | No | All | Yes |
-| closeModalWhenSelectedItem | By default, closeModalWhenSelectedItem is set to true. When closeModalWhenSelectedItem is set to false, the Modal won't close when an item is selected. | Boolean | No | All | Yes |
-| excludeItems | The array containing the items to be excluded. | Item[] | No | All | Yes |
-| excludeSearchItems | The array containing the items to be excluded. | Item[] | No | All | Yes |
-
-**MultiSelect**:多选组件
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
+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
+
+For details, see [react-native-element-dropdown](https://github.com/hoaphantn7604/react-native-element-dropdown)
+
+> [!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.
+
+**Dropdown**: 单选组件
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | -------- | -------- | ----------------- |
+| mode | Mode 'modal' is show the dropdown in the middle of the screen. | 'default' or 'modal' of 'auto' | No | All | Yes |
+| data | Data is a plain array | Array | Yes | All | Yes |
+| labelField | Extract the label from the data item | String | Yes | All | Yes |
+| valueField | Extract the primary key from the data item | String | Yes | All | Yes |
+| searchField | Specify the field of data list you want to search | String | No | All | Yes |
+| onChange | Selection callback | (item: object) => void | Yes | All | Yes |
+| onChangeText | Callback that is called when the text input's text changes | (search: string) => void | No | All | Yes |
+| value | Set default value | Item | No | All | Yes |
+| placeholder | The string that will be rendered before dropdown has been selected | String | No | All | Yes |
+| placeholderStyle | Styling for text placeholder | TextStyle | No | All | Yes |
+| selectedTextStyle | Styling for selected text | TextStyle | No | All | Yes |
+| selectedTextProps | Text Props for selected text. Ex: numberOfLines={1} | TextProps | No | All | Yes |
+| style | Styling for view container | ViewStyle | No | All | Yes |
+| containerStyle | Styling for list container | ViewStyle | No | All | Yes |
+| maxHeight | Customize max height for list container | Number | No | All | Yes |
+| minHeight | Customize min height for list container | Number | No | All | Yes |
+| fontFamily | Customize font style | String | No | All | Yes |
+| iconStyle | Styling for icon | ImageStyle | No | All | Yes |
+| iconColor | Color of icons | String | No | All | Yes |
+| itemContainerStyle | Styling for item container in list | TextStyle | No | All | Yes |
+| itemTextStyle | Styling for text item in list | TextStyle | No | All | Yes |
+| activeColor | Background color for item selected in list container | String | No | All | Yes |
+| search | Show or hide input search | Boolean | No | All | Yes |
+| searchQuery | Callback used to filter the list of items | (keyword: string, labelValue: string) => Boolean | No | All | Yes |
+| inputSearchStyle | Styling for input search | ViewStyle | No | All | Yes |
+| searchPlaceholder | The string that will be rendered before text input has been entered | String | No | All | Yes |
+| renderInputSearch | Customize TextInput search | (onSearch: (text:string) => void) => JSX.Element | No | All | Yes |
+| disable | Specifies the disabled state of the Dropdown | Boolean | No | All | Yes |
+| dropdownPosition | Dropdown list position. Default is 'auto' | 'auto' or 'top' or 'bottom' | No | All | Yes |
+| autoScroll | Auto scroll to index item selected, default is true | Boolean | No | All | Yes |
+| showsVerticalScrollIndicator | When true, shows a vertical scroll indicator, default is true | Boolean | No | All | Yes |
+| renderLeftIcon | Customize left icon for dropdown | (visible?: boolean) => JSX.Element | No | All | Yes |
+| renderRightIcon | Customize right icon for dropdown | (visible?: boolean) => JSX.Element | No | All | Yes |
+| renderItem | Takes an item from data and renders it into the list | (item: object, selected: Boolean) => JSX.Element | No | All | Yes |
+| flatListProps | Customize FlatList element | FlatListProps | No | All | Yes |
+| inverted | Reverses the direction of scroll on top position mode. Default is true | Boolean | No | All | Yes |
+| onFocus | Callback that is called when the dropdown is focused | () => void | No | All | Yes |
+| onBlur | Callback that is called when the dropdown is blurred | () => void | No | All | Yes |
+| keyboardAvoiding | keyboardAvoiding default is true | Boolean | No | All | Yes |
+| backgroundColor | Set background color | String | No | All | Yes |
+| confirmSelectItem | Turn On confirm select item. Refer example/src/dropdown/example3 | Boolean | No | All | Yes |
+| onConfirmSelectItem | Selection callback. Refer example/src/dropdown/example3 | (item: object) => void | No | All | Yes |
+| testID | Used to locate this view in end-to-end tests | String | No | All | Yes |
+| itemTestIDField | Add this field to the input data. Ex: DATA = [{itemTestIDField: '', label: '', value:: ''}] | String | No | All | Yes |
+| accessibilityLabel | Set an accessibilityLabel on the view, so that people who use VoiceOver know what element they have selected | String | No | All | Yes |
+| itemAccessibilityLabelField | Add this field to the input data. Ex: DATA = [{itemAccessibilityLabelField: '', label: '', value:: ''}] | String | No | All | Yes |
+| closeModalWhenSelectedItem | By default, closeModalWhenSelectedItem is set to true. When closeModalWhenSelectedItem is set to false, the Modal won't close when an item is selected. | Boolean | No | All | Yes |
+| excludeItems | The array containing the items to be excluded. | Item[] | No | All | Yes |
+| excludeSearchItems | The array containing the items to be excluded. | Item[] | No | All | Yes |
+
+**MultiSelect**: 多选组件
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------------ | -----------------------------------------------------| --------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
-| mode | Mode 'modal' is show the dropdown in the middle of the screen. | 'default' or 'modal' of 'auto' | No | All | Yes |
-| data | Data is a plain array | Array | Yes | All | Yes |
-| labelField | Extract the label from the data item | String | Yes | All | Yes |
-| valueField | Extract the primary key from the data item | String | Yes | All | Yes |
-| searchField | Specify the field of data list you want to search | String | No | All | Yes |
-| onChange | Selection callback. A array containing the "valueField". | (value[]) => void | Yes | All | Yes |
-| onChangeText | Callback that is called when the text input's text changes | (search: string) => void | No | All | Yes |
-| value | Set default value. A array containing the "valueField". | Item[] | No | All | Yes |
-| placeholder | The string that will be rendered before dropdown has been selected | String | No | All | Yes |
-| placeholderStyle | Styling for text placeholder | TextStyle | No | All | Yes |
-| style | Styling for view container | ViewStyle | No | All | Yes |
-| containerStyle | Styling for list container | ViewStyle | No | All | Yes |
-| maxHeight | Customize max height for list container | Number | No | All | Yes |
-| minHeight | Customize min height for list container | Number | No | All | Yes |
-| maxSelect | maximum number of items that can be selected | Number | No | All | Yes |
-| fontFamily | Customize font style | String | No | All | Yes |
-| iconStyle | Styling for icon | ImageStyle | No | All | Yes |
-| iconColor | Color of icons | String | No | All | Yes |
-| activeColor | Background color for item selected in list container | String | No | All | Yes |
-| itemContainerStyle | Styling for item container in list | TextStyle | No | All | Yes |
-| itemTextStyle | Styling for text item in list | TextStyle | No | All | Yes |
-| selectedStyle | Styling for selected view | ViewStyle | No | All | Yes |
-| selectedTextStyle | Styling for selected text | TextStyle | No | All | Yes |
-| selectedTextProps | Text Props for selected text. Ex: numberOfLines={1} | TextProps | No | All | Yes |
-| renderSelectedItem | Takes an item from data and renders it into the list selected | (item: object, unSelect?: () => void) => JSX.Element | No | All | Yes |
-| alwaysRenderSelectedItem | Always show the list of selected items | Boolean | No | All | Yes |
-| visibleSelectedItem | Option to hide selected item list, Ẽx: visibleSelectedItem={false} | Boolean | No | All | Yes |
-| search | Show or hide input search | Boolean | No | All | Yes |
-| searchQuery | Callback used to filter the list of items | (keyword: string, labelValue: string) => Boolean | No | All | Yes |
-| inputSearchStyle | Styling for input search | ViewStyle | No | All | Yes |
-| searchPlaceholder | The string that will be rendered before text input has been entered | String | No | All | Yes |
-| renderInputSearch | Customize TextInput search | (onSearch: (text:string) => void) => JSX.Element | No | All | Yes |
-| disable | Specifies the disabled state of the Dropdown | Boolean | No | All | Yes |
-| dropdownPosition | Dropdown list position. Default is 'auto' | 'auto' or 'top' or 'bottom' | No | All | Yes |
-| showsVerticalScrollIndicator | When true, shows a vertical scroll indicator, default is true | Boolean | No | All | Yes |
-| renderLeftIcon | Customize left icon for dropdown | (visible?: boolean) => JSX.Element | No | All | Yes |
-| renderRightIcon | Customize right icon for dropdown | (visible?: boolean) => JSX.Element | No | All | Yes |
-| renderItem | Takes an item from data and renders it into the list | (item: object, selected: Boolean) => JSX.Element | No | All | Yes |
-| flatListProps | Customize FlatList element | FlatListProps | No | All | Yes |
-| inverted | Reverses the direction of scroll on top position mode. Default is true | Boolean | No | All | Yes |
-| onFocus | Callback that is called when the dropdown is focused | () => void | No | All | Yes |
-| onBlur | Callback that is called when the dropdown is blurred | () => void | No | All | Yes |
-| keyboardAvoiding | keyboardAvoiding default is true | Boolean | No | All | Yes |
-| inside | inside default is false | Boolean | No | All | Yes |
-| backgroundColor | Set background color | String | No | All | Yes |
-| confirmSelectItem | Turn On confirm select item. Refer example/src/dropdown/example7 | Boolean | No | All | Yes |
-| confirmUnSelectItem | Turn On confirm un-select item. Refer example/src/dropdown/example7 | Boolean | No | All | Yes |
-| onConfirmSelectItem | Selection callback. Refer example/src/dropdown/example7 | (item: any) => void | No | All | Yes |
-| testID | Used to locate this view in end-to-end tests | String | No | All | Yes |
-| itemTestIDField | Add this field to the input data. Ex: DATA = [{itemTestIDField: '', label: '', value:: ''}] | String | No | All | Yes |
-| accessibilityLabel | Set an accessibilityLabel on the view, so that people who use VoiceOver know what element they have selected | String | No | All | Yes |
-| itemAccessibilityLabelField | Add this field to the input data. Ex: DATA = [{itemAccessibilityLabelField: '', label: '', value:: ''}] | String | No | All | Yes |
-| excludeItems | The array containing the items to be excluded. | Item[] | No | All | |
-| excludeSearchItems | The array containing the items to be excluded. | Item[] | No | All | Yes |
-
-**SelectCountry**:选择国家/地区组件,接收所有Dropdown的props并新增了以下props
+| mode | Mode 'modal' is show the dropdown in the middle of the screen. | 'default' or 'modal' of 'auto' | No | All | Yes |
+| data | Data is a plain array | Array | Yes | All | Yes |
+| labelField | Extract the label from the data item | String | Yes | All | Yes |
+| valueField | Extract the primary key from the data item | String | Yes | All | Yes |
+| searchField | Specify the field of data list you want to search | String | No | All | Yes |
+| onChange | Selection callback. A array containing the "valueField". | (value[]) => void | Yes | All | Yes |
+| onChangeText | Callback that is called when the text input's text changes | (search: string) => void | No | All | Yes |
+| value | Set default value. A array containing the "valueField". | Item[] | No | All | Yes |
+| placeholder | The string that will be rendered before dropdown has been selected | String | No | All | Yes |
+| placeholderStyle | Styling for text placeholder | TextStyle | No | All | Yes |
+| style | Styling for view container | ViewStyle | No | All | Yes |
+| containerStyle | Styling for list container | ViewStyle | No | All | Yes |
+| maxHeight | Customize max height for list container | Number | No | All | Yes |
+| minHeight | Customize min height for list container | Number | No | All | Yes |
+| maxSelect | maximum number of items that can be selected | Number | No | All | Yes |
+| fontFamily | Customize font style | String | No | All | Yes |
+| iconStyle | Styling for icon | ImageStyle | No | All | Yes |
+| iconColor | Color of icons | String | No | All | Yes |
+| activeColor | Background color for item selected in list container | String | No | All | Yes |
+| itemContainerStyle | Styling for item container in list | TextStyle | No | All | Yes |
+| itemTextStyle | Styling for text item in list | TextStyle | No | All | Yes |
+| selectedStyle | Styling for selected view | ViewStyle | No | All | Yes |
+| selectedTextStyle | Styling for selected text | TextStyle | No | All | Yes |
+| selectedTextProps | Text Props for selected text. Ex: numberOfLines={1} | TextProps | No | All | Yes |
+| renderSelectedItem | Takes an item from data and renders it into the list selected | (item: object, unSelect?: () => void) => JSX.Element | No | All | Yes |
+| alwaysRenderSelectedItem | Always show the list of selected items | Boolean | No | All | Yes |
+| visibleSelectedItem | Option to hide selected item list, Ẽx: visibleSelectedItem={false} | Boolean | No | All | Yes |
+| search | Show or hide input search | Boolean | No | All | Yes |
+| searchQuery | Callback used to filter the list of items | (keyword: string, labelValue: string) => Boolean | No | All | Yes |
+| inputSearchStyle | Styling for input search | ViewStyle | No | All | Yes |
+| searchPlaceholder | The string that will be rendered before text input has been entered | String | No | All | Yes |
+| renderInputSearch | Customize TextInput search | (onSearch: (text:string) => void) => JSX.Element | No | All | Yes |
+| disable | Specifies the disabled state of the Dropdown | Boolean | No | All | Yes |
+| dropdownPosition | Dropdown list position. Default is 'auto' | 'auto' or 'top' or 'bottom' | No | All | Yes |
+| showsVerticalScrollIndicator | When true, shows a vertical scroll indicator, default is true | Boolean | No | All | Yes |
+| renderLeftIcon | Customize left icon for dropdown | (visible?: boolean) => JSX.Element | No | All | Yes |
+| renderRightIcon | Customize right icon for dropdown | (visible?: boolean) => JSX.Element | No | All | Yes |
+| renderItem | Takes an item from data and renders it into the list | (item: object, selected: Boolean) => JSX.Element | No | All | Yes |
+| flatListProps | Customize FlatList element | FlatListProps | No | All | Yes |
+| inverted | Reverses the direction of scroll on top position mode. Default is true | Boolean | No | All | Yes |
+| onFocus | Callback that is called when the dropdown is focused | () => void | No | All | Yes |
+| onBlur | Callback that is called when the dropdown is blurred | () => void | No | All | Yes |
+| keyboardAvoiding | keyboardAvoiding default is true | Boolean | No | All | Yes |
+| inside | inside default is false | Boolean | No | All | Yes |
+| backgroundColor | Set background color | String | No | All | Yes |
+| confirmSelectItem | Turn On confirm select item. Refer example/src/dropdown/example7 | Boolean | No | All | Yes |
+| confirmUnSelectItem | Turn On confirm un-select item. Refer example/src/dropdown/example7 | Boolean | No | All | Yes |
+| onConfirmSelectItem | Selection callback. Refer example/src/dropdown/example7 | (item: any) => void | No | All | Yes |
+| testID | Used to locate this view in end-to-end tests | String | No | All | Yes |
+| itemTestIDField | Add this field to the input data. Ex: DATA = [{itemTestIDField: '', label: '', value:: ''}] | String | No | All | Yes |
+| accessibilityLabel | Set an accessibilityLabel on the view, so that people who use VoiceOver know what element they have selected | String | No | All | Yes |
+| itemAccessibilityLabelField | Add this field to the input data. Ex: DATA = [{itemAccessibilityLabelField: '', label: '', value:: ''}] | String | No | All | Yes |
+| excludeItems | The array containing the items to be excluded. | Item[] | No | All | |
+| excludeSearchItems | The array containing the items to be excluded. | Item[] | No | All | Yes |
+
+**SelectCountry**: 选择国家/地区组件,接收所有 Dropdown 的 props 并新增了以下 props
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---------- | ------------------------------------ | ---------- | -------- | -------- | ----------------- |
| imageField | Extract the image from the data item | String | Yes | All | Yes |
| imageStyle | Styling for image | ImageStyle | No | All | Yes |
-## **Method**:静态方法
+## **Method**: Static Methods
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ----- | ------------------- | ---------- | -------- | -------- | ----------------- |
| open | Open dropdown list | () => void | No | All | Yes |
| close | Close dropdown list | () => void | No | All | Yes |
-## 遗留问题
+## Known Issues
+
+## Others
-## 其他
+## License
-## 开源协议
+This project is licensed under [The MIT License (MIT)](https://github.com/hoaphantn7604/react-native-element-dropdown/blob/master/LICENSE),请自由地享受和参与开源。
-本项目基于 [The MIT License (MIT)](https://github.com/hoaphantn7604/react-native-element-dropdown/blob/master/LICENSE),请自由地享受和参与开源。
-
\ No newline at end of file
+
--
Gitee
From 8ef8c9051fb25a0234864ede343358ec23b7e237 Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 14:57:18 +0800
Subject: [PATCH 21/53] docs: [Issues: #IB07UG] react-native-elements.md
---
en/react-native-elements.md | 255 ++++++++++++++++++++----------------
1 file changed, 140 insertions(+), 115 deletions(-)
diff --git a/en/react-native-elements.md b/en/react-native-elements.md
index 6775bdb8..0aeaf6a1 100644
--- a/en/react-native-elements.md
+++ b/en/react-native-elements.md
@@ -1,4 +1,4 @@
-> Template version:v0.2.2
+> Template version: v0.2.2
@@ -14,16 +14,15 @@
-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-share)
+> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-share)
+## 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-share Releases](https://github.com/react-native-oh-library/react-native-share/releases).
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-share Releases](https://github.com/react-native-oh-library/react-native-share/releases),并下载适用版本的 tgz 包。
+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 (#).
@@ -40,7 +39,7 @@ yarn add @react-native-oh-tpl/react-native-share@file:#
```
-进入项目的 HarmonyOS 工程 harmony,打开 `entry/src/main/module.json5`,在module中添加:querySchemes字段,表示允许当前应用进行跳转查询的URI schemes,只允许entry类型模块配置,最多50个。例如如需要查询是否可以跳转微博,可以添加
+进入项目的 HarmonyOS 工程 harmony,打开 `entry/src/main/module.json5`,在module中添加: querySchemes字段,表示允许当前应用进行跳转查询的URI schemes,只允许entry类型模块配置,最多50个。例如如需要查询是否可以跳转微博,可以添加
```diff
@@ -50,9 +49,9 @@ yarn add @react-native-oh-tpl/react-native-share@file:#
```
-下面的代码展示了这个库的基本使用场景:
+The following code shows the basic use scenario of the repository:
-> [!WARNING] 使用时 import 的库名不变。
+> [!WARNING] The name of the imported repository remains unchanged.
```js
@@ -63,10 +62,10 @@ yarn add @react-native-oh-tpl/react-native-share@file:#
function App() {
return (
{}}>
- {
+ {
RNShare.open({
- title:'分享标题',
- subject:'分享摘要',
+ title:'share title',
+ subject:'Share Summary',
url:'https://www.baidu.com/'
}).then((res) => {
@@ -81,17 +80,17 @@ yarn add @react-native-oh-tpl/react-native-share@file:#
```
-## 使用 Codegen
+## Use Codegen
-本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。
+If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/zh-cn/codegen.md).
## 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.json` 添加 overrides 字段
+### 1. Adding the overrides Field to oh-package.json5 File in the Root Directory of the Project
```json
{
@@ -102,19 +101,15 @@ yarn add @react-native-oh-tpl/react-native-share@file:#
}
```
-### 2.引入原生端代码
-
-目前有两种方法:
+### 2. Introducing Native Code
-1. 通过 har 包引入(在 IDE 完善相关功能后该方法会被遗弃,目前首选此方法);
+Currently, two methods are available:
-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
@@ -125,22 +120,22 @@ yarn add @react-native-oh-tpl/react-native-share@file:#
```
-点击右上角的 `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](/zh-cn/link-source-code.md).
-### 3.在 ArkTs 侧引入 RNSharePackage
+### 3. Introducing RNSharePackage to ArkTS
-打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
+Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
```diff
+ import {RNSharePackage} from '@react-native-oh-tpl/react-native-share/ts';
@@ -153,33 +148,32 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
}
```
-### 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
-### 兼容性
+### 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-share Releases](https://github.com/react-native-oh-library/react-native-share/releases)
+Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-share Releases](https://github.com/react-native-oh-library/react-native-share/releases)
-## 属性
+## 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.
**Overlay**:分享面板弹窗组件
@@ -188,7 +182,7 @@ ohpm install
| visible | 是否显示 | boolean | no | iOS,Android | yes |
| children | JSX element | React.ReactNode | no | iOS,Android | yes |
-**Button**:分享按钮
+**Button**: 分享按钮
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
@@ -198,7 +192,7 @@ ohpm install
| textStyle | text属性 | [TextStyle](https://reactnative.dev/docs/text#props) | no | iOS,Android | yes |
| children | JSX element | React.ReactNode | no | iOS,Android | yes |
-**ShareSheet**:分享面板组件
+**ShareSheet**: 分享面板组件
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
@@ -208,7 +202,7 @@ ohpm install
| overlayStyle | 分享面板CSS属性 | [ ViewStyle ](https://reactnative.dev/docs/view#props) | no | iOS,Android | yes |
| children | JSX element | React.ReactNode | no | iOS,Android | yes |
-**Sheet**:分享面板组件的子组件,ShareSheet包含Sheet
+**Sheet**: 分享面板组件的子组件,ShareSheet包含Sheet
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
@@ -217,9 +211,9 @@ ohpm install
## 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 |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
@@ -228,7 +222,7 @@ ohpm install
| shareSingle: (options: ShareSingleOptions) => Promise | 三方分APP分享 | fuction | yes | iOS,Android | partially |
| isPackageInstalled: (packagename: string) => Promise | 三方APP是否已在本机安装 | fuction | yes | iOS,Android | no |
-**ShareOptions** :系统分享参数
+**ShareOptions** : 系统分享参数
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
@@ -242,14 +236,14 @@ ohpm install
| subject | 分享内容摘要 | string | no | iOS,Android | yes |
| email | 收件人邮箱地址 | string | no | iOS,Android | no |
| recipient | 接收短信消息的号码 | string | no | iOS,Android | yes |
-| excludedActivityTypes | 系统分享面板操作区不应显示的能力列表(harmonyOS中传参例如['0','1'],对应解释为: 0:复制到剪切板,1:保存到媒体库,2:保存到文件管理器 ,3:打印,4:保存到中转站) | ActivityType[] \| string[] | no | iOS,Android | partially |
+| excludedActivityTypes | 系统分享面板操作区不应显示的能力列表(harmonyOS中传参例如['0','1'],对应解释为: 0:复制到剪切板,1:保存到媒体库,2:保存到文件管理器 ,3:打印,4:保存到中转站) | ActivityType[] \| string[] | no | iOS,Android | partially |
| failOnCancel | 分享失败的是否抛出异 | boolean | no | iOS,Android | yes |
| showAppsToView | 是否显示可以预览分享文件的APP | boolean | no | Android | no |
| saveToFiles | 是否保存分享的路径文件到本地 | boolean | no | iOS,Android | yes |
| activityItemSources | 系统分享面板中自定义分享数据 | ActivityItemSource[] | no | iOS | no |
| isNewTask | 是否开启Activity的启动模式FLAG_ACTIVITY_NEW_TASK | boolean | no | Android | no |
-**ShareSingleOptions** :三方APP分享参数
+**ShareSingleOptions** : 三方APP分享参数
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
@@ -271,7 +265,7 @@ ohpm install
| attributionURL | 属性路径(social为instagramstories,facebookstories传参) | string | no | iOS,Android | no |
| backgroundVideo | 背景视频(social为instagramstories,facebookstories传参) | string | no | iOS,Android | no |
-**Social**:可支持的三方APP种类
+**Social**: 可支持的三方APP种类
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
@@ -294,7 +288,7 @@ ohpm install
| VIBER | viber | string | yes | iOS,Android | no |
| DISCORD | discord | string | yes | iOS,Android | no |
-**ShareAsset** :分享图片、视频数据枚举
+**ShareAsset** : 分享图片、视频数据枚举
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
@@ -303,42 +297,41 @@ ohpm install
| StickerImage | social为instagramstories,facebookstories时分享的贴纸图 | enum | no | no,Android | no |
| BackgroundAndStickerImage | social为instagramstories,facebookstories时分享的背景贴纸 | enum | no | iOS,Android | no |
-**ActivityType**:系统分享面板上支持的分享操作
+**ActivityType**: 系统分享面板上支持的分享操作
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
| ActivityType | default \| addToReadingList \| airDrop \| assignToContact \| copyToPasteBoard \| mail \| message \| openInIBooks \| postToFacebook \| postToFlickr \| postToTencentWeibo \| postToTwitter \| postToVimeo \| postToWeibo \| print \| saveToCameraRoll \| markupAsPDF | string | no | iOS,Android | no |
-
-**ShareSingleResult**:调用三方分享接口返回的数据类型
+**ShareSingleResult**: 调用三方分享接口返回的数据类型
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
| message | 返回的消息 | string | yes | iOS,Android | yes |
| success | 是否成功 | boolean | yes | iOS,Android | yes |
-**ShareOpenResult**: 调用系统分享接口返回的数据类型
+**ShareOpenResult**: 调用系统分享接口返回的数据类型
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
| message | 返回的消息 | string | yes | iOS,Android | yes |
| success | 是否成功 | boolean | yes | iOS,Android | yes |
-**IsPackageInstalledResult**:调用是否安装三方应用接口返回的数据类型
+**IsPackageInstalledResult**: 调用是否安装三方应用接口返回的数据类型
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
| message | 返回的消息 | string | yes | iOS,Android | yes |
| isInstalled | 三方APP是否已安装 | boolean | yes | iOS,Android | yes |
-**ActivityItem**:系统面板分享类型
+**ActivityItem**: 系统面板分享类型
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
| type |活动面板类型 text \| url | string | yes | iOS | no |
| content | 内容 | boolean | yes | iOS | no |
-**LinkMetadata**:系统分享中自定义分享操作的元数据
+**LinkMetadata**: 系统分享中自定义分享操作的元数据
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
@@ -350,7 +343,7 @@ ohpm install
| remoteVideoUrl | URL的代表视频相对应的远程URL | boolean | no | iOS | no |
| video | URL的代表视频数据 | boolean | no | iOS | no |
-**ActivityItemSource**:系统分享中自定义分享数据
+**ActivityItemSource**: 系统分享中自定义分享数据
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
@@ -361,16 +354,14 @@ ohpm install
| thumbnailImage | 分享数据的缩略图 | string | no | iOS | no |
| linkMetadata | 分享的数据 | LinkMetadata | no | iOS | no |
+## Known Issues
-## 遗留问题
-
-- [ ] 无法分享三方APP问题:[issue#1](https://github.com/react-native-oh-library/react-native-share/issues/1)
-
+- [ ] 无法分享三方APP问题: [issue#1](https://github.com/react-native-oh-library/react-native-share/issues/1)
-## 其他
+## Others
-## 开源协议
+## License
-本项目基于 [The MIT License (MIT)](https://github.com/react-native-share/react-native-share/blob/main/LICENSE) ,请自由地享受和参与开源。
+This project is licensed under [The MIT License (MIT)](https://github.com/react-native-share/react-native-share/blob/main/LICENSE).
\ No newline at end of file
--
Gitee
From 478dad305a727c559f31b242970ca2b81d107517 Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 15:01:18 +0800
Subject: [PATCH 45/53] docs: [Issues: #IB07UG] react-native-skia.md
---
en/react-native-skia.md | 713 +++++++++++-----------------------------
1 file changed, 186 insertions(+), 527 deletions(-)
diff --git a/en/react-native-skia.md b/en/react-native-skia.md
index ac8debb8..95ee95f5 100644
--- a/en/react-native-skia.md
+++ b/en/react-native-skia.md
@@ -1,4 +1,4 @@
-模板版本:v0.2.2
+Template version: v0.2.2
react-native-skia
@@ -13,15 +13,15 @@
-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-skia)
+> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-skia)
-## 安装与使用
+## Installation and Usage
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-skia Releases](https://github.com/react-native-oh-library/react-native-skia/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-skia Releases](https://github.com/react-native-oh-library/react-native-skia/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 (#).
@@ -39,9 +39,9 @@ yarn add @react-native-oh-tpl/react-native-skia@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 React from "react";
@@ -67,11 +67,11 @@ export default App;
## 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
{
@@ -82,18 +82,15 @@ export default App;
}
```
-### 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": {
@@ -102,22 +99,22 @@ export default App;
}
```
-点击右上角的 `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](/zh-cn/link-source-code.md).
-### 3.配置 CMakeLists 和引入 SkiaPackage
+### 3. Configuring CMakeLists and Introducing SkiaPackage
-打开 `entry/src/main/cpp/CMakeLists.txt`,添加:
+Open `entry/src/main/cpp/CMakeLists.txt` and add the following code:
```diff
project(rnapp)
@@ -155,7 +152,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"
@@ -174,9 +171,9 @@ std::vector> PackageProvider::getPackages(Package::Cont
}
```
-### 4.在 ArkTs 侧引入 SkiaDomView 组件
+### 4. Introducing SkiaDomView Component to ArkTS
-找到 `function buildCustomRNComponent()`,一般位于 `entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets`,添加:
+Find `function buildCustomRNComponent()`, which is usually located in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets`, and add the following code:
```diff
...
@@ -196,9 +193,9 @@ export function buildCustomRNComponent(ctx: ComponentBuilderContext) {
...
```
-> [!TIP] 本库使用了混合方案,需要添加组件名。
+> [!TIP] If the repository uses a mixed solution, the component name needs to be added.
-在`entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets` 找到常量 `arkTsComponentNames` 在其数组里添加组件名
+Find the constant `arkTsComponentNames` in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets` and add the component name to the array.
```diff
const arkTsComponentNames: Array = [
@@ -209,9 +206,9 @@ const arkTsComponentNames: Array = [
];
```
-### 5.在 ArkTs 侧引入 RNSkiaPackage
+### 5. Introducing RNSkiaPackage to ArkTS
-打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
+Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
```diff
...
@@ -225,56 +222,52 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
}
```
-### 6.运行
+### 6. 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-skia Releases](https://github.com/react-native-oh-library/react-native-skia/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.
-> [!tip] [skia 官方文档](https://shopify.github.io/react-native-skia/docs/getting-started/installation)
+Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-skia Releases](https://github.com/react-native-oh-library/react-native-skia/releases)
-> [!tip] 使用此库需要配置 [@react-native-oh-tpl/react-native-reanimated](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-reanimated.md)
-
-## 组件
+## Components
### Canvas
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
+#### Properties
-> [!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 |
-| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------ | -------- | ----------- | ----------------- |
-| style | View style | ViewStyle | no | android/ios | yes |
-| ref | Reference to the SkiaView object | Ref | no | android/ios | yes |
-| mode | By default, the canvas is only updated when the drawing tree or animation values change. With mode="continuous", the canvas will redraw on every frame | default \| continuous | no | android/ios | yes |
-| onSize | Reanimated value to which the canvas size will be assigned | SharedValue | no | android/ios | yes |
-| onLayout | Invoked on mount and on layout changes | NativeEvent | no | android/ios | 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 |
+> | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------ | -------- | ----------- | ----------------- |
+> | style | View style | ViewStyle | no | android/ios | yes |
+> | ref | Reference to the SkiaView object | Ref | no | android/ios | yes |
+> | mode | By default, the canvas is only updated when the drawing tree or animation values change. With mode="continuous", the canvas will redraw on every frame | default/continuous | no | android/ios | yes |
+> | onSize | Reanimated value to which the canvas size will be assigned | SharedValue | no | android/ios | yes |
+> | onLayout | Invoked on mount and on layout changes | NativeEvent | no | android/ios | yes |
### Group
-#### 属性
+#### 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 |
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | -------- | ----------- | ----------------- |
@@ -286,11 +279,11 @@ ohpm install
### Path
-#### 属性
+#### 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 |
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------- | -------- | ----------- | ----------------- |
@@ -299,234 +292,90 @@ ohpm install
| end | Trims the end of the path. Value is in the range `[0, 1]` (default is 1). | number | no | android/ios | yes |
| stroke | Turns this path into the filled equivalent of the stroked path. This will fail if the path is a hairline. `StrokeOptions` describes how the stroked path should look. It contains three properties: `width`, `strokeMiterLimit` and, `precision` | StrokeOptions | no | android/ios | yes |
-### Rect
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ------ | ------------------------ | ------ | -------- | ----------- | ----------------- |
-| x | X coordinate. | number | yes | android/ios | yes |
-| y | Y coordinate. | number | yes | android/ios | yes |
-| width | Width of the rectangle. | number | yes | android/ios | yes |
-| height | Height of the rectangle. | number | yes | android/ios | yes |
-
-### RoundedRect
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ------ | -------------------------------------------------- | ---------------- | -------- | ----------- | ----------------- |
-| x | X coordinate. | SkPath`or`string | yes | android/ios | yes |
-| y | Y coordinate. | number | yes | android/ios | yes |
-| width | Width of the rectangle. | number | yes | android/ios | yes |
-| height | Height of the rectangle. | StrokeOptions | yes | android/ios | yes |
-| r | Corner radius. Defaults to `ry` if specified or 0. | number`or`Vector | no | android/ios | yes |
-
-### DiffRect
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
+### Polygons
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
+#### Properties
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ----- | ---------------- | ------------- | -------- | ----------- | ----------------- |
-| outer | Outer rectangle. | Rect \| RRect | yes | android/ios | yes |
-| inner | Inner rectangle. | Rect \| RRect | yes | android/ios | yes |
+> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
-### Line
+> [!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 |
+| ------ | ------------------------ | ---------------- | -------- | ----------- | ----------------- |
+| x | X coordinate. | SkPath`or`string | no | android/ios | yes |
+| y | Y coordinate. | number | no | android/ios | yes |
+| width | Width of the rectangle. | number | no | android/ios | yes |
+| height | Height of the rectangle. | StrokeOptions | no | android/ios | yes |
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
+### Ellipses
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
+#### Properties
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ---- | ------------ | ----- | -------- | ----------- | ----------------- |
-| p1 | Start point. | Point | yes | android/ios | yes |
-| p2 | End point. | Point | yes | android/ios | yes |
+> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
-### Points
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | -------- | ----------- | ----------------- |
-| points | Points to draw. | Point | yes | android/ios | yes |
-| mode | How should the points be connected. Can be `points` (no connection), `lines` (connect pairs of points), or `polygon` (connect lines). Default is `points`. | PointMode | yes | android/ios | yes |
-
-### Circle
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!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 | Platfor | HarmonyOS Support |
| ---- | ------------ | ------ | -------- | ----------- | ----------------- |
-| cx | Start point. | number | yes | android/ios | yes |
-| cy | End point. | number | yes | android/ios | yes |
-| r | Radius. | number | yes | android/ios | yes |
-
-### Oval
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platfor | HarmonyOS Support |
-| ------ | --------------------------------------- | ------ | -------- | ----------- | ----------------- |
-| x | X coordinate of the bounding rectangle. | number | yes | android/ios | yes |
-| y | Y coordinate of the bounding rectangle. | number | yes | android/ios | yes |
-| width | Width of the bounding rectangle. | number | yes | android/ios | yes |
-| height | Height of the bounding rectangle. | number | yes | android/ios | yes |
+| cx | Start point. | number | no | android/ios | yes |
+| cy | End point. | number | no | android/ios | yes |
+| r` | Radius. | number | no | android/ios | yes |
### Atlas
-#### 属性
+#### 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 | Type | Description | Required | android/ios | HarmonyOS Support |
-| ---------- | ----------------- | ----------------------------------------------------------------- | -------- | ----------- | ----------------- |
-| image | `SkImage or null` | Altas: image containing the sprites. | yes | android/ios | yes |
-| sprites | `SkRect[]` | locations of sprites in atlas. | yes | android/ios | yes |
-| transforms | `RSXform[]` | Rotation/scale transforms to be applied for each sprite. | yes | android/ios | yes |
-| colors | `SkColor[]` | Optional. Color to blend the sprites with. | no | android/ios | yes |
-| blendMode | `BlendMode` | Optional. Blend mode used to combine sprites and colors together. | no | android/ios | yes |
+| Name | Type | Description | Required | android/ios | HarmonyOS Support |
+| ---------- | ----------------- | ------------------------------------------------------------------------- | -------- | ----------- | ----------------- |
+| image | `SkImage or null` | Altas: image containing the sprites. | no | android/ios | yes |
+| sprites | `SkRect[]` | locations of sprites in atlas. | no | android/ios | yes |
+| transforms | `RSXform[]` | Rotation/scale transforms to be applied for each sprite. | no | android/ios | yes |
+| colors | `SkColor[]` | Optional. Color to blend the sprites with. | yes | android/ios | yes |
+| blendMode | `BlendMode` | Optional. Blend mode used to combine sprites and colors together.\*\*\*\* | yes | android/ios | yes |
### Vertices
-#### 属性
+#### 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 | Type | Description | Required | android/ios | HarmonyOS Support |
| --------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----------- | ----------------- |
-| vertices | `Point[]` | Vertices to draw | yes | android/ios | yes |
-| mode | `VertexMode` | Can be `triangles`, `trianglesStrip` or `triangleFan`. Default is `triangles` | no | android/ios | yes |
-| indices | `number[]` | Indices of the vertices that form the triangles. If not provided, the order of the vertices will be taken. Using this property enables you not to duplicate vertices. | no | android/ios | yes |
-| textures | `Point[]`. | [Texture mapping](https://en.wikipedia.org/wiki/Texture_mapping). The texture is the shader provided by the paint. | yes | android/ios | yes |
-| colors | `string[]` | Optional colors to be associated to each vertex | no | android/ios | yes |
-| blendMode | `BlendMode` | If `colors` is provided, colors are blended with the paint using the blend mode. Default is `dstOver` if colors are provided, `srcOver` if not. | no | android/ios | yes |
+| vertices | `Point[]` | Vertices to draw | no | android/ios | yes |
+| mode | `VertexMode` | Can be `triangles`, `trianglesStrip` or `triangleFan`. Default is `triangles` | yes | android/ios | yes |
+| indices | `number[]` | Indices of the vertices that form the triangles. If not provided, the order of the vertices will be taken. Using this property enables you not to duplicate vertices. | yes | android/ios | yes |
+| textures | `Point[]`. | [Texture mapping](https://en.wikipedia.org/wiki/Texture_mapping). The texture is the shader provided by the paint. | no | android/ios | yes |
+| colors | `string[]` | Optional colors to be associated to each vertex | yes | android/ios | yes |
+| blendMode | `BlendMode` | If `colors` is provided, colors are blended with the paint using the blend mode. Default is `dstOver` if colors are provided, `srcOver` if not. | yes | android/ios | yes |
### Patch
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
+#### Properties
-| Name | Type | Description | Required | android/ios | HarmonyOS Support |
-| --------- | ---------------- | ------------------------------------------------------------ | -------- | ----------- | ----------------- |
-| patch | `CubicBezier[4]` | Specifies four cubic Bezier starting at the top-left corner, in clockwise order, sharing every fourth point. The last cubic Bezier ends at the first point. | yes | android/ios | yes |
-| textures | `Point[]`. | [Texture mapping](https://en.wikipedia.org/wiki/Texture_mapping). The texture is the shader provided by the paint | yes | android/ios | yes |
-| colors | `string[]` | Optional colors to be associated to each corner | no | android/ios | yes |
-| blendMode | `BlendMode` | If `colors` is provided, colors are blended with the paint using the blend mode. Default is `dstOver` if colors are provided, `srcOver` if not | no | android/ios | yes |
+> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
-### Picture
+> [!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.
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Type | Description | Required | android/ios | HarmonyOS Support |
-| ------- | --------- | ----------------- | -------- | ----------- | ----------------- |
-| picture | SkPicture | Picture to render | yes | android/ios | yes |
-
-### Box
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Type | Description | Required | android/ios | HarmonyOS Support |
-| ---- | ----------------- | ------------------------- | -------- | ----------- | ----------------- |
-| box | SkRRect \| SkRect | The destination rectangle | yes | android/ios | yes |
-
-### BoxShadow
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Type | Description | Required | android/ios | HarmonyOS Support |
-| ------ | ------- | ----------------------------------------------- | -------- | ----------- | ----------------- |
-| dx | number | The X offset of the shadow. | no | android/ios | yes |
-| dy | number | The Y offset of the shadow. | no | android/ios | yes |
-| spread | number | Optional colors to be associated to each corner | no | android/ios | yes |
-| blur | number | The blur radius for the shadow | yes | android/ios | yes |
-| color | Color | The color of the drop shadow | no | android/ios | yes |
-| inner | boolean | Shadows are drawn within the input content | no | android/ios | yes |
-
-### Shader
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Type | Description | Required | android/ios | HarmonyOS Support |
-| -------- | -------------------------------------------------------------------------- | ----------------------------- | -------- | ----------- | ----------------- |
-| source | RuntimeEffect | Compiled shaders | yes | android/ios | yes |
-| uniforms | { [name: string]: number \| Vector \| Vector[] \| number[] \| number[][] } | uniform values | yes | android/ios | yes |
-| children | Shader | Shaders to be used as uniform | yes | android/ios | yes |
-
-### ImageShader
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | android/ios | HarmonyOS Support |
-| --------- | ------------------------------------------------------------------------------------------------------------------------ | ----------------- | -------- | ----------- | ----------------- |
-| image | Image instance. | SkImage | yes | android/ios | yes |
-| tx | Can be `clamp`, `repeat`, `mirror`, or `decal`. | TileMode shaders | no | android/ios | yes |
-| ty | Can be `clamp`, `repeat`, `mirror`, or `decal`. | TileMode values | no | android/ios | yes |
-| fm | Can be `linear` or `nearest`. | FilterMode values | no | android/ios | yes |
-| mm | Can be `none` or `last`. | MipmapMode | no | android/ios | yes |
-| fit | Calculate the transformation matrix to fit the rectangle defined by `fitRect`. | Fit | no | android/ios | yes |
-| rect | The destination rectangle to calculate the transformation matrix via the `fit` property. | SkRect | no | android/ios | yes |
-| transform | The origin property is a helper to set the origin of the transformation. This property is not inherited by its children. | Transforms2d | no | android/ios | yes |
+| Name | Type | Description | Required | android/ios | HarmonyOS Support |
+| --------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----------- | ----------------- |
+| cubics | `CubicBezier[4]` | Specifies four cubic Bezier starting at the top-left corner, in clockwise order, sharing every fourth point. The last cubic Bezier ends at the first point. | no | android/ios | yes |
+| textures | `Point[]`. | [Texture mapping](https://en.wikipedia.org/wiki/Texture_mapping). The texture is the shader provided by the paint | no | android/ios | yes |
+| colors | `string[]` | Optional colors to be associated to each corner | yes | android/ios | yes |
+| blendMode | `BlendMode` | If `colors` is provided, colors are blended with the paint using the blend mode. Default is `dstOver` if colors are provided, `srcOver` if not | yes | android/ios | yes |
### Gradients 公共属性
-#### 属性
+#### 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 |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------ | -------- | ----------- | ----------------- |
@@ -538,11 +387,11 @@ ohpm install
### LinearGradient
-#### 属性
+#### 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 |
| ----- | ------------------------------- | ----- | -------- | ----------- | ----------------- |
@@ -551,11 +400,11 @@ ohpm install
### RadialGradient
-#### 属性
+#### 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 |
| ---- | ----------------------- | ------ | -------- | ----------- | ----------------- |
@@ -564,11 +413,11 @@ ohpm install
### TwoPointConicalGradient
-#### 属性
+#### 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 |
| ------ | --------------------------- | ------ | -------- | ----------- | ----------------- |
@@ -579,11 +428,11 @@ ohpm install
### SweepGradient
-#### 属性
+#### 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 |
| ----- | -------------------------------------- | ------ | -------- | ----------- | ----------------- |
@@ -593,45 +442,45 @@ ohpm install
### FractalNoise
-#### 属性
+#### 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 |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------ | ------ | -------- | ----------- | ----------------- |
| freqX | base frequency in the X direction; range [0.0, 1.0] | number | yes | android/ios | yes |
| freqY | base frequency in the Y direction; range [0.0, 1.0] | number | yes | android/ios | yes |
-| octaves | octaves | number | no | android/ios | yes |
-| seed | seed | number | no | android/ios | yes |
+| octaves | | number | yes | android/ios | yes |
+| seed | | number | yes | android/ios | yes |
| tileWidth | if this and `tileHeight` are non-zero, the frequencies will be modified so that the noise will be tileable for the given size. | number | no | android/ios | yes |
| tileHeight | if this and `tileWidth` are non-zero, the frequencies will be modified so that the noise will be tileable for the given size. | number | no | android/ios | yes |
### Turbulence
-#### 属性
+#### 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 |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------ | ------ | -------- | ----------- | ----------------- |
| freqX | base frequency in the X direction; range [0.0, 1.0] | number | yes | android/ios | yes |
| freqY | base frequency in the Y direction; range [0.0, 1.0] | number | yes | android/ios | yes |
-| octaves | octaves | number | no | android/ios | yes |
-| seed | seed | number | no | android/ios | yes |
+| octaves | | number | yes | android/ios | yes |
+| seed | | number | yes | android/ios | yes |
| tileWidth | if this and `tileHeight` are non-zero, the frequencies will be modified so that the noise will be tileable for the given size. | number | no | android/ios | yes |
| tileHeight | if this and `tileWidth` are non-zero, the frequencies will be modified so that the noise will be tileable for the given size. | number | no | android/ios | yes |
### Blend
-#### 属性
+#### 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 |
| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | -------- | ----------- | ----------------- |
@@ -640,11 +489,11 @@ ohpm install
### ColorShader
-#### 属性
+#### 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 |
| ----- | ----------- | ------ | -------- | ----------- | ----------------- |
@@ -652,40 +501,40 @@ ohpm install
### DiscretePathEffect
-#### 属性
+#### 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 |
| --------- | ------------------------------------------------------------- | ---------- | -------- | ----------- | ----------------- |
| length | length of the subsegments. | number | yes | android/ios | yes |
| deviation | limit of the movement of the endpoints. | number | yes | android/ios | yes |
-| seed | modifies the randomness. See SkDiscretePathEffect.h for more. | number | no | android/ios | yes |
+| seed | modifies the randomness. See SkDiscretePathEffect.h for more. | number | yes | android/ios | yes |
| children | Optional path effect to apply. | PathEffect | no | android/ios | yes |
### DashPathEffect
-#### 属性
+#### 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 |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------- | ---------- | -------- | ----------- | ----------------- |
| intervals | even number of entries with even indices specifying the length of the "on" intervals, and the odd index specifying the length of "off". | number[] | yes | android/ios | yes |
-| phase | offset into the intervals array. Defaults to 0. | number | no | android/ios | yes |
+| phase | offset into the intervals array. Defaults to 0. | number | yes | android/ios | yes |
| children | Optional path effect to apply. | PathEffect | no | android/ios | yes |
### CornerPathEffect
-#### 属性
+#### 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 |
| -------- | ------------------------------ | ---------- | -------- | ----------- | ----------------- |
@@ -694,11 +543,11 @@ ohpm install
### Path1DPathEffect
-#### 属性
+#### 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 |
| -------- | ------------------------------------------------------------------------------- | ----------------- | -------- | ----------- | ----------------- |
@@ -710,11 +559,11 @@ ohpm install
### Path2DPathEffect
-#### 属性
+#### 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 |
| -------- | ----------------------------- | ---------- | -------- | ----------- | ----------------- |
@@ -724,11 +573,11 @@ ohpm install
### Line2DPathEffect
-#### 属性
+#### 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 |
| -------- | ----------------------------- | ---------- | -------- | ----------- | ----------------- |
@@ -736,194 +585,28 @@ ohpm install
| matrix | Matrix to be applied | IMatrix | yes | android/ios | yes |
| children | Optional path effect to apply | PathEffect | no | android/ios | yes |
-### Shadow
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ---------- | ------------------------------------------------------ | ----------- | -------- | ----------- | ----------------- |
-| dx | The X offset of the shadow. | number | yes | android/ios | yes |
-| dy | The Y offset of the shadow. | number | no | android/ios | yes |
-| blur | The blur radius for the shadow | number | no | android/ios | yes |
-| color | The color of the drop shadow | Color | no | android/ios | yes |
-| inner | Shadows are drawn within the input content | boolean | no | android/ios | yes |
-| shadowOnly | If true, the result does not include the input content | boolean | no | android/ios | yes |
-| children | Optional image filter to be applied first | ImageFilter | no | android/ios | yes |
-
-### Blur
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| -------- | ------------------------------------------------------------- | ---------------- | -------- | ----------- | ----------------- |
-| blur | The Gaussian sigma blur value | number`or`Vector | yes | android/ios | yes |
-| mode | `mirror`, `repeat`, `clamp`, or `decal` (default is `decal`). | TileMode | no | android/ios | yes |
-| children | Optional image filter to be applied first. | ImageFilter | no | android/ios | yes |
-
-### DisplacementMap
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| -------- | ------------------------------------------------------------------------------------ | ------------ | -------- | ----------- | ----------------- |
-| channelX | Color channel to be used along the X axis. Possible values are `r`, `g`, `b`, or `a` | ColorChannel | yes | android/ios | yes |
-| channelY | Color channel to be used along the Y axis. Possible values are `r`, `g`, `b`, or `a` | ColorChannel | no | android/ios | yes |
-| scale | Displacement scale factor to be used | number | no | android/ios | yes |
-| children | Optional image filter to be applied first | ImageFilter | no | android/ios | yes |
-
-### Offset
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| -------- | ------------------------------------------ | ----------- | -------- | ----------- | ----------------- |
-| x | Offset along the X axis. | number | yes | android/ios | yes |
-| y | Offset along the Y axis. | number | yes | android/ios | yes |
-| children | Optional image filter to be applied first. | ImageFilter | no | android/ios | yes |
-
-### Morphology
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| -------- | ------------------------------------------------------------------- | ---------------- | -------- | ----------- | ----------------- |
-| operator | whether to erode (i.e., thin) or dilate (fatten). Default is dilate | erode`or`dilate | yes | android/ios | yes |
-| radius | Radius of the effect. | number`or`Vector | yes | android/ios | yes |
-| children | Optional image filter to be applied first. | ImageFilter | no | android/ios | yes |
-
-### RuntimeShader
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| -------- | ------------------------------------------ | --------------- | -------- | ----------- | ----------------- |
-| source | Shader to use as an image filter | SkRuntimeEffect | yes | android/ios | yes |
-| children | Optional image filter to be applied first. | ImageFilter | no | android/ios | yes |
-
-### BlurMask
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ---------- | --------------------------------------------------------------------- | --------- | -------- | ----------- | ----------------- |
-| blur | Standard deviation of the Gaussian blur. Must be > 0. | number | yes | android/ios | yes |
-| style | Can be `normal`, `solid`, `outer`, or `inner` (default is `normal`). | BlurStyle | no | android/ios | yes |
-| respectCTM | if true the blur's sigma is modified by the CTM (default is `false`). | bool | no | android/ios | yes |
-
-### ColorMatrix
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| -------- | ------------------------------------------ | ----------- | -------- | ----------- | ----------------- |
-| matrix | Color Matrix (5x4) | number[] | yes | android/ios | yes |
-| children | Optional color filter to be applied first. | ColorFilter | no | android/ios | yes |
-
-### BlendColor
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| -------- | ----------------------------------------------------------------------------------------- | ----------- | -------- | ----------- | ----------------- |
-| color | Color | Color | yes | android/ios | yes |
-| mode | Sets the blend mode that is, the mode used to combine source color with destination color | BlendMode | yes | android/ios | yes |
-| children | Optional color filter to be applied first. | ColorFilter | no | android/ios | yes |
-
-### Lerp
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| -------- | ------------------------------------------ | ----------- | -------- | ----------- | ----------------- |
-| t | Value between 0 and 1. | number | yes | android/ios | yes |
-| children | Optional color filter to be applied first. | ColorFilter | yes | android/ios | yes |
-
-### LinearToSRGBGamma
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| -------- | ------------------------------------------ | ----------- | -------- | ----------- | ----------------- |
-| children | Optional color filter to be applied first. | ColorFilter | no | android/ios | yes |
-
-### SRGBToLinearGamma
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| -------- | ------------------------------------------ | ----------- | -------- | ----------- | ----------------- |
-| children | Optional color filter to be applied first. | ColorFilter | no | android/ios | yes |
-
### Mask
-#### 属性
+#### 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 |
| -------- | ---------------------------------------------------- | ------------------ | -------- | ----------- | ----------------- |
| mode | Is it a luminance or alpha mask (default is `alpha`) | alpha \| luminance | no | android/ios | yes |
-| clip | clip the mask so it doesn't exceed the content | boolean | no | android/ios | yes |
+| clip | clip the mask so it doesn't exceed the content | bool | no | android/ios | yes |
| mask | ReactNode | ReactNode[] | yes | android/ios | yes |
| children | ReactNode | ReactNode[] | yes | android/ios | yes |
### Image
-#### 属性
+#### 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 |
| ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -------- | ----------- | ----------------- |
@@ -934,13 +617,13 @@ ohpm install
| height | The height of the destination image. | number | yes | android/ios | yes |
| fit | The method used to fit the image into the rectangle. Values can be `contain`, `fill`, `cover`, `fitHeight`, `fitWidth`, `scaleDown`, or `none` (the default is `contain`). | Fit | no | android/ios | yes |
-### ImageSVG
+### SVG Image
-#### 属性
+#### 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 |
| ------ | ------------------------------------------- | ------ | -------- | ----------- | ----------------- |
@@ -952,11 +635,11 @@ ohpm install
### Paragraph
-#### 属性
+#### 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 |
| --------- | --------------------------------------------- | ----------- | -------- | ----------- | ----------------- |
@@ -967,11 +650,11 @@ ohpm install
### Text
-#### 属性
+#### 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 |
| ---- | --------------------------------------------- | ------ | -------- | ----------- | ----------------- |
@@ -982,11 +665,11 @@ ohpm install
### Glyphs
-#### 属性
+#### 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 |
| ------ | ---------------------------------------------------------- | ------- | -------- | ----------- | ----------------- |
@@ -995,27 +678,27 @@ ohpm install
| y | y coordinate of the origin of the entire run. Default is 0 | number | yno | android/ios | yes |
| font | Font to use | SkFont | yes | android/ios | yes |
-### TextPath
+### Text Path
-#### 属性
+#### 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 |
| ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | -------- | ----------- | ----------------- |
| path | Path to draw. Can be a string using the [SVG Path notation](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#line_commands) or an object created with `Skia.Path.Make()` | Path \| string | yes | android/ios | yes |
| text | Text to draw | string | yes | android/ios | yes |
-| font | Font to use | SkFont | yes | android/ios | yes |
+| font | Font to use | | | | |
-### TextBlob
+### Text Path
-#### 属性
+#### 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 |
| ---- | ---------------------------------------------------------- | -------- | -------- | ----------- | ----------------- |
@@ -1023,48 +706,24 @@ ohpm install
| x | x coordinate of the origin of the entire run. Default is 0 | number | no | android/ios | yes |
| y | y coordinate of the origin of the entire run. Default is 0 | number | no | android/ios | yes |
-### BackdropFilter
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ------ | --------------------------------------------------------------------------------------- | ------------------------ | -------- | ----------- | ----------------- |
-| filter | Applies an image filter to the area behind the canvas or behind a defined clipping mask | ReactNode \| ReactNode[] | yes | android/ios | yes |
-
-### BackdropBlur
-
-#### 属性
-
-> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
-
-> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ---- | ----------- | ------ | -------- | ----------- | ----------------- |
-| blur | Blur radius | number | yes | android/ios | yes |
-
## RNSkiaModule 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 |
| ------- | ---------------- | -------- | -------- | ----------- | ----------------- |
| install | initialized skia | function | yes | android/ios | yes |
-## 遗留问题
+## Known Issues
- [x] Text 组件无法使用 问题: [issue#Text 暂不支持](https://github.com/react-native-oh-library/react-native-skia/issues/5)
- [ ] Video 组件无法使用 问题: [issue#Video 暂不支持](https://github.com/react-native-oh-library/react-native-skia/issues/6)
- [x] Image 组件无法使用 问题: [issue#Image 暂不支持](https://github.com/react-native-oh-library/react-native-skia/issues/7)
-## 其他
+## Others
-## 开源协议
+## License
-本项目基于 [The MIT License (MIT)](https://github.com/react-native-oh-library/react-native-skia/blob/sig/LICENSE.md) ,请自由地享受和参与开源。
+This project is licensed under [The MIT License (MIT)](https://github.com/react-native-oh-library/react-native-skia/blob/sig/LICENSE.md).
--
Gitee
From 921f597ff4a9d9548226edcba237cfd7fa5adad8 Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 15:01:25 +0800
Subject: [PATCH 46/53] docs: [Issues: #IB07UG] react-native-system-setting.md
---
en/react-native-system-setting.md | 130 ++++++++++++++----------------
1 file changed, 62 insertions(+), 68 deletions(-)
diff --git a/en/react-native-system-setting.md b/en/react-native-system-setting.md
index c152a6fc..3a2420bf 100644
--- a/en/react-native-system-setting.md
+++ b/en/react-native-system-setting.md
@@ -1,4 +1,4 @@
-> 模板版本:v0.2.2
+> Template version: v0.2.2
react-native-system-setting
@@ -13,18 +13,15 @@
+> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-system-setting)
+## 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-library/react-native-system-setting Releases](https://github.com/react-native-oh-library/react-native-system-setting/releases).
-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-system-setting)
+Go to the project directory and execute the following instruction:
-## 安装与使用
-
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-library/react-native-system-setting Releases](https://github.com/react-native-oh-library/react-native-system-setting/releases),并下载适用版本的 tgz 包。
-
-进入到工程目录并输入以下命令:
-
->[!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-system-setting@file:#
-下面的代码展示了这个库的基本使用场景:
+The following code shows the basic use scenario of the repository:
->[!WARNING] 使用时 import 的库名不变。
+>[!WARNING] The name of the imported repository remains unchanged.
```tsx
import React, { useEffect, useState } from 'react'
@@ -63,11 +60,11 @@ const SystemSettingDemo: React.FC = (): JSX.Element => {
- Bluetooth(蓝牙模块)
+ Bluetooth(Bluetooth module)
- 蓝牙状态:{bluetoothEnabled === true ? '开启' : '关闭'}
+ Bluetooth status:{bluetoothEnabled === true ? 'open' : 'close'}
{
@@ -75,28 +72,28 @@ const SystemSettingDemo: React.FC = (): JSX.Element => {
}}
style={styles.moduleButton}
>
- 获取蓝牙状态
+ Get Bluetooth status {
SystemSetting.switchBluetooth(() => {
- console.log('跳转完成')
+ console.log('Jump completed')
})
}}
style={styles.moduleButton}
>
- 切换蓝牙状态(跳转设置)
+ Switch Bluetooth status(Jump settings) {
SystemSetting.switchBluetoothSilence(() => {
- console.log('切换完成')
+ console.log('Switching completed')
})
}}
style={styles.moduleButton}
>
- 切换蓝牙状态
+ Switch Bluetooth status {
@@ -107,7 +104,7 @@ const SystemSettingDemo: React.FC = (): JSX.Element => {
}}
style={styles.moduleButton}
>
- 开启蓝牙状态监听器
+ Enable Bluetooth status listener {
@@ -115,7 +112,7 @@ const SystemSettingDemo: React.FC = (): JSX.Element => {
}}
style={styles.moduleButton}
>
- 关闭蓝牙状态监听器
+ Turn off Bluetooth status listener
@@ -155,16 +152,16 @@ const styles = StyleSheet.create({
export default SystemSettingDemo
```
-## 使用 Codegen
-本库已经适配了 Codegen ,在使用前需要主动执行生成三方库桥接代码,详细请参考 [Codegen 文档](/zh-cn/codegen.md)。
+## Use Codegen
+If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/zh-cn/codegen.md).
## 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
{
@@ -175,18 +172,15 @@ export default SystemSettingDemo
}
```
-### 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": {
@@ -195,23 +189,23 @@ export default SystemSettingDemo
}
```
-点击右上角的 `sync` 按钮
+Click the `sync` button in the upper right corner.
-或者在终端执行:
+Alternatively, run the following instruction on the terminal:
```bash
cd entry
ohpm install
```
-方法二:直接链接源码
-
-> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
+Method 2: Directly link to the source code.
+> [!TIP] For details, see [Directly Linking Source Code](/zh-cn/link-source-code.md).
-### 3.在 ArkTs 侧引入 RNSystemSettingPackage
-打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
+### 3. Introducing RNSystemSettingPackage to ArkTS
+
+Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
```diff
...
@@ -225,42 +219,42 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
}
```
-### 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
-### 兼容性
+### 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-library/react-native-system-setting Releases](https://github.com/react-native-oh-library/react-native-system-setting/releases)。
+Check the release version information in the release address of the third-party library: [@react-native-oh-library/react-native-system-setting Releases](https://github.com/react-native-oh-library/react-native-system-setting/releases)。
-### 权限要求
+### Permission Requirements
-由于此库涉及蓝牙、亮度等系统控制功能,使用对应接口时则需要配置对应的权限,权限需配置在entry/src/main目录下module.json5文件中。其中部分权限需弹窗向用户申请授权。具体权限配置见文档:[程序访问控制](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/Readme-CN.md#/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/app-permission-mgmt-overview.md)。
+由于此库涉及蓝牙、亮度等系统控制功能,使用对应接口时则需要配置对应的权限,权限需配置在entry/src/main目录下module.json5文件中。其中部分权限需弹窗向用户申请授权。具体权限配置见文档: [程序访问控制](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/Readme-CN.md#/openharmony/docs/blob/master/zh-cn/application-dev/security/AccessToken/app-permission-mgmt-overview.md)。
-此库部分功能与接口需要normal权限:ohos.permission.ACCESS_BLUETOOTH、ohos.permission.GET_WIFI_INFO。
+此库部分功能与接口需要normal权限: ohos.permission.ACCESS_BLUETOOTH、ohos.permission.GET_WIFI_INFO。
-此库部分功能与接口需要full sdk与system_basic权限:ohos.permission.MANAGE_SECURE_SETTINGS、ohos.permission.MANAGE_WIFI_CONNECTION等,[full sdk获取地址](https://eco-betaclub.rnd.huawei.com/#/download/DevEco%20Studio/newest),[system_basic权限获取方式](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/determine-application-mode-0000001774120042-V5)。
+此库部分功能与接口需要full sdk与system_basic权限: ohos.permission.MANAGE_SECURE_SETTINGS、ohos.permission.MANAGE_WIFI_CONNECTION等,[full sdk获取地址](https://eco-betaclub.rnd.huawei.com/#/download/DevEco%20Studio/newest),[system_basic权限获取方式](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/determine-application-mode-0000001774120042-V5)。
## 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.
-详情请见[react-native-system-setting](https://github.com/c19354837/react-native-system-setting/tree/master)
+For details, see [react-native-system-setting](https://github.com/c19354837/react-native-system-setting/tree/master)
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------------------- | ------------------------------------------------------------ | ------------------------ | -------- | ----------- | ----------------- |
@@ -298,21 +292,21 @@ ohpm install
| removeListener | you can use this to remove the listener which return by `add*Listener(callback)` | listener | No | iOS/Android | yes |
| openAppSystemSettings | open app's setting page | no | No | iOS/Android | yes |
-## 其他
+## Others
-由于仅支持Android/iOS特有功能,HarmonyOS暂无法实现的接口:[issue#11](https://github.com/react-native-oh-library/react-native-system-setting/issues/11)
+由于仅支持Android/iOS特有功能,HarmonyOS暂无法实现的接口: [issue#11](https://github.com/react-native-oh-library/react-native-system-setting/issues/11)
-## 遗留问题
+## Known Issues
-- [ ] 由于系统音量权限问题,HarmonyOS暂无法实现的接口:[issue#3](https://github.com/react-native-oh-library/react-native-system-setting/issues/3)
-- [ ] 由于系统亮度与亮度模式权限问题,HarmonyOS暂无法实现的接口:[issue#4](https://github.com/react-native-oh-library/react-native-system-setting/issues/4)
-- [ ] 由于系统WiFi权限问题,HarmonyOS暂无法实现的接口:[issue#5](https://github.com/react-native-oh-library/react-native-system-setting/issues/5)
-- [ ] 由于系统未支持删除音量监听器,HarmonyOS暂无法实现的接口:[issue#6](https://github.com/react-native-oh-library/react-native-system-setting/issues/6)
-- [ ] 由于系统未支持位置服务模式监听器相关接口,HarmonyOS暂无法实现的接口:[issue#7](https://github.com/react-native-oh-library/react-native-system-setting/issues/7)
-- [ ] 由于系统未支持位置服务模式获取相关接口,HarmonyOS暂无法实现的接口:[issue#8](https://github.com/react-native-oh-library/react-native-system-setting/issues/8)
-- [ ] 由于系统未支持获取飞行模式状态相关接口,HarmonyOS暂无法实现的接口:[issue#9](https://github.com/react-native-oh-library/react-native-system-setting/issues/9)
-- [ ] 由于系统未支持飞行模式开关监听器相关接口,HarmonyOS暂无法实现的接口:[issue#10](https://github.com/react-native-oh-library/react-native-system-setting/issues/10)
+- [ ] 由于系统音量权限问题,HarmonyOS暂无法实现的接口: [issue#3](https://github.com/react-native-oh-library/react-native-system-setting/issues/3)
+- [ ] 由于系统亮度与亮度模式权限问题,HarmonyOS暂无法实现的接口: [issue#4](https://github.com/react-native-oh-library/react-native-system-setting/issues/4)
+- [ ] 由于系统WiFi权限问题,HarmonyOS暂无法实现的接口: [issue#5](https://github.com/react-native-oh-library/react-native-system-setting/issues/5)
+- [ ] 由于系统未支持删除音量监听器,HarmonyOS暂无法实现的接口: [issue#6](https://github.com/react-native-oh-library/react-native-system-setting/issues/6)
+- [ ] 由于系统未支持位置服务模式监听器相关接口,HarmonyOS暂无法实现的接口: [issue#7](https://github.com/react-native-oh-library/react-native-system-setting/issues/7)
+- [ ] 由于系统未支持位置服务模式获取相关接口,HarmonyOS暂无法实现的接口: [issue#8](https://github.com/react-native-oh-library/react-native-system-setting/issues/8)
+- [ ] 由于系统未支持获取飞行模式状态相关接口,HarmonyOS暂无法实现的接口: [issue#9](https://github.com/react-native-oh-library/react-native-system-setting/issues/9)
+- [ ] 由于系统未支持飞行模式开关监听器相关接口,HarmonyOS暂无法实现的接口: [issue#10](https://github.com/react-native-oh-library/react-native-system-setting/issues/10)
-## 开源协议
+## License
-本项目基于 [The MIT License (MIT)](https://github.com/c19354837/react-native-system-setting/blob/master/LICENSE.md) ,请自由地享受和参与开源。
\ No newline at end of file
+This project is licensed under [The MIT License (MIT)](https://github.com/c19354837/react-native-system-setting/blob/master/LICENSE.md).
\ No newline at end of file
--
Gitee
From 7aa88f7a91e982af7187b58d4b65e02927e2be78 Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 15:01:33 +0800
Subject: [PATCH 47/53] docs: [Issues: #IB07UG] react-native-track-player.md
---
en/react-native-track-player.md | 91 ++++++++++++++++-----------------
1 file changed, 43 insertions(+), 48 deletions(-)
diff --git a/en/react-native-track-player.md b/en/react-native-track-player.md
index 334cd0dc..e70bd1bc 100644
--- a/en/react-native-track-player.md
+++ b/en/react-native-track-player.md
@@ -1,4 +1,4 @@
-> 模板版本:v0.2.2
+> Template version: v0.2.2
react-native-track-player
@@ -12,17 +12,15 @@
+> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-track-player)
+## Installation and Usage
-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-track-player)
+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-track-player Releases](https://github.com/react-native-oh-library/react-native-track-player/releases).
-## 安装与使用
+Go to the project directory and execute the following instruction:
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-track-player Releases](https://github.com/react-native-oh-library/react-native-track-player/releases),并下载适用版本的 tgz 包。
-
-进入到工程目录并输入以下命令:
-
-> [!TIP] # 处替换为 tgz 包的路径
+> [!TIP] Replace the content with the path of the .tgz package at the comment sign (#).
@@ -40,9 +38,9 @@ yarn add @react-native-oh-tpl/react-native-track-player@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 React, { useEffect } from "react";
@@ -79,12 +77,11 @@ const TrackPlayerDemo = () => {
}]);
}
- // 开始播放歌曲
const startExample = () => {
// Start playing it
TrackPlayer.play();
}
- // 暂停播放歌曲
+
const pauseExample = () => {
TrackPlayer.pause();
}
@@ -133,17 +130,17 @@ const styles = StyleSheet.create({
export default TrackPlayerDemo;
```
-## 使用 Codegen
+## Use Codegen
-本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。
+If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/zh-cn/codegen.md).
## 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
{
@@ -154,18 +151,17 @@ export default TrackPlayerDemo;
}
```
-### 2.引入原生端代码
+### 2. Introducing Native Code
-目前有两种方法:
+Currently, two methods are available:
-1. 通过 har 包引入(在 IDE 完善相关功能后该方法会被遗弃,目前首选此方法);
-2. 直接链接源码。
-方法一:通过 har 包引入(推荐)
-> [!TIP] har 包位于三方库安装路径的 `harmony` 文件夹下。
+Method 1 (recommended): Use the HAR file.
-打开 `entry/oh-package.json5`,添加以下依赖
+> [!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library.
+
+Open `entry/oh-package.json5` file and add the following dependencies:
```json
"dependencies": {
@@ -174,22 +170,22 @@ export default TrackPlayerDemo;
}
```
-点击右上角的 `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](/zh-cn/link-source-code.md).
-### 3.在 ArkTs 侧引入 RNTrackPlayerPackage
+### 3. Introducing RNTrackPlayerPackage to ArkTS
-打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
+Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
```diff
...
@@ -203,32 +199,32 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
}
```
-### 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
-### 兼容性
+### 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-track-player Releases](https://github.com/react-native-oh-library/react-native-track-player/releases)
+Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-track-player Releases](https://github.com/react-native-oh-library/react-native-track-player/releases)
-### 权限要求
+### Permission Requirements
-#### 在 entry 目录下的module.json5中添加权限
+#### Include applicable permissions in the module.json5 file within the entry directory.
-打开 `entry/src/main/module.json5`,添加:
+Open the `entry/src/main/module.json5` file and add the following code:
```diff
...
@@ -254,12 +250,11 @@ ohpm install
]
```
-
## 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 |
| ------------------------ | ------------------------------------------------------------ | ------- | -------- | ----------- | ----------------- |
@@ -422,7 +417,7 @@ ohpm install
| ----- | ----------------------- | ------ | -------- | ----------- | ----------------- |
| index | The index of the track. | number | Yes | iOS/Android | Yes |
-## 遗留问题
+## Known Issues
- [ ] 目前harmonyOS设置metadata仅支持现有API中参数,对于genre、rating、isLiveStream、elapsedTime四个参数均未适配harmonyOS Next。[issue#3](https://github.com/react-native-oh-library/react-native-track-player/issues/3)
- [ ] 目前仅支持setupPlayer接口的调用,不支持该接口携带的参数对播放器进行相关的设置,该接口参数均未适配harmonyOS Next。[issue#4](https://github.com/react-native-oh-library/react-native-track-player/issues/4)
@@ -430,9 +425,9 @@ ohpm install
- [ ] 目前harmonyOS中支持九种固定的播放速率,其他播放速率均未问题适配harmonyOS Next。[issue#6](https://github.com/react-native-oh-library/react-native-track-player/issues/6)
- [ ] 目前harmonyOS不支持对播控中心的更新设置,updateOptions接口未适配harmonyOS Next。[issue#7](https://github.com/react-native-oh-library/react-native-track-player/issues/7)
-## 其他
+## Others
-## 开源协议
+## License
-本项目基于 [The Apache License(Apache)](https://github.com/doublesymmetry/react-native-track-player/blob/main/LICENSE) ,请自由地享受和参与开源。
+This project is licensed under [The Apache License(Apache)](https://github.com/doublesymmetry/react-native-track-player/blob/main/LICENSE).
--
Gitee
From bb67f0ab52a7648ff21b3dc5a8afc304a426ca9b Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 15:01:41 +0800
Subject: [PATCH 48/53] docs: [Issues: #IB07UG] react-native-ui-lib.md
---
en/react-native-ui-lib.md | 270 ++++++++++++++++++--------------------
1 file changed, 131 insertions(+), 139 deletions(-)
diff --git a/en/react-native-ui-lib.md b/en/react-native-ui-lib.md
index 490f1a8b..ea44a70e 100644
--- a/en/react-native-ui-lib.md
+++ b/en/react-native-ui-lib.md
@@ -1,4 +1,4 @@
-模板版本:v0.2.2
+Template version: v0.2.2
react-native-ui-lib
@@ -12,18 +12,15 @@
+> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-ui-lib)
+## 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-ui-lib Releases](https://github.com/react-native-oh-library/react-native-ui-lib/releases).
-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-ui-lib)
+The HarmonyOS implementation of this library depends on the native code from @react-native-oh-tpl/react-native-reanimated、@react-native-oh-tpl/react-native-gesture-handler. If this library is included into your HarmonyOS application, there is no need to include it again; you can skip the steps in this section and use it directly.
-## 安装与使用
-
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-ui-lib Releases](https://github.com/react-native-oh-library/react-native-ui-lib/releases),并下载适用版本的 tgz 包。
-
-本库 HarmonyOS 侧实现依赖@react-native-oh-tpl/react-native-reanimated和 @react-native-oh-tpl/react-native-gesture-handler的原生端代码,如已在 HarmonyOS 工程中引入过这些库,则无需再次引入,可跳过本章节步骤,直接使用。
-
-如未引入请参考[@react-native-oh-tpl/react-native-reanimated文档](/zh-cn/react-native-reanimated.md)和[@react-native-oh-tpl/react-native-gesture-handler文档](/zh-cn/react-native-gesture-handler.md)进行引入。
+If it is not included, follow the guide provided in [@react-native-oh-tpl/react-native-reanimated docs](/zh-cn/react-native-reanimated.md)、[@react-native-oh-tpl/react-native-gesture-handler docs](/zh-cn/react-native-gesture-handler.md) to add it to your project.
下面是根据使用组件情况按需引入依赖项:
@@ -32,9 +29,9 @@
- [@react-native-community/datetimepicker](/zh-cn/react-native-community-datetimepicker.md) (DateTimePicker 组件)
- [@react-native-community/netinfo](/zh-cn/react-native-community-netinfo.md) (ConnectionStatusBar 组件)
-进入到工程目录并输入以下命令:
+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 (#).
@@ -52,9 +49,9 @@ yarn add @react-native-oh-tpl/react-native-ui-lib@file:#
-下面的代码展示了这个库的基本使用场景:
+The following code shows the basic use scenario of the repository:
-> [!WARNING] 使用时 import 的库名不变。
+> [!WARNING] The name of the imported repository remains unchanged.
```jsx
import React, {Component} from 'react';
@@ -115,17 +112,17 @@ class MyScreen extends Component {
}
```
-## 使用 Codegen
+## Use Codegen
-本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。
+If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/zh-cn/codegen.md).
## 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
{
@@ -136,18 +133,15 @@ class MyScreen extends Component {
}
```
-### 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": {
@@ -156,22 +150,22 @@ class MyScreen extends Component {
}
```
-点击右上角的 `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](/zh-cn/link-source-code.md).
-### 3.配置 CMakeLists 和引入 UiLibPackage
+### 3. Configuring CMakeLists and Introducing UiLibPackage
-打开 `entry/src/main/cpp/CMakeLists.txt`,添加:
+Open `entry/src/main/cpp/CMakeLists.txt` and add the following code:
```diff
project(rnapp)
@@ -209,7 +203,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"
@@ -228,9 +222,9 @@ std::vector> PackageProvider::getPackages(Package::Cont
}
```
-### 4.在 ArkTs 侧引入 HighlighterView组件
+### 4. Introducing HighlighterView Component to ArkTS
-找到 `function buildCustomRNComponent()`,一般位于 `entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets`,添加:
+Find `function buildCustomRNComponent()`, which is usually located in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets`, and add the following code:
```diff
...
@@ -250,9 +244,9 @@ export function buildCustomRNComponent(ctx: ComponentBuilderContext) {
...
```
-> [!TIP] 本库使用了混合方案,需要添加组件名。(如使用混合方案)
+> [!TIP] If the repository uses a mixed solution, the component name needs to be added.
-在`entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets` 找到常量 `arkTsComponentNames` 在其数组里添加组件名
+Find the constant `arkTsComponentNames` in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets` and add the component name to the array.
```diff
const arkTsComponentNames: Array = [
@@ -263,9 +257,9 @@ const arkTsComponentNames: Array = [
];
```
-### 5.在 ArkTs 侧引入 UiLibPackage
+### 5. Introducing UiLibPackage to ArkTS
-打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
+Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
```diff
...
@@ -279,38 +273,36 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
}
```
-### 6.运行
+### 6. 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.
-要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。
+## Constraints
-请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-ui-lib Releases](https://github.com/react-native-oh-library/react-native-ui-lib/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-ui-lib Releases](https://github.com/react-native-oh-library/react-native-ui-lib/releases)
-## 组件
+## Components
-详细请查看 [react-native-ui-lib的文档介绍](https://wix.github.io/react-native-ui-lib/docs/getting-started/setup)
+For details, see [react-native-ui-lib docs](https://wix.github.io/react-native-ui-lib/docs/getting-started/setup)
-> [!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.
-**Text**:文本组件,该组件扩展了[Text](https://reactnative.dev/docs/text)属性。
+**Text**: 文本组件,该组件扩展了[Text](https://reactnative.dev/docs/text)属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------- | ------------------------------------------------------------ | ----------------------------------- | -------- | ----------- | ----------------- |
@@ -323,7 +315,7 @@ ohpm install
| underline | Whether to add an underline | boolean | no | iOS/Android | yes |
| uppercase | Whether to change the text to uppercase | boolean | no | iOS/Android | yes |
-**TouchableOpacity**:触摸反馈透明度组件,该组件扩展了[TouchableOpacity](https://reactnative.dev/docs/touchableopacity)属性。
+**TouchableOpacity**: 触摸反馈透明度组件,该组件扩展了[TouchableOpacity](https://reactnative.dev/docs/touchableopacity)属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- | ----------- | ----------------- |
@@ -337,7 +329,7 @@ ohpm install
| throttleTime | Throttle time in MS for onPress callback | number | no | iOS/Android | yes |
| useNative | Should use an enhanced native implementation with extra features | boolean | no | iOS/Android | yes |
-**View**:容器组件,该组件扩展了[View](https://reactnative.dev/docs/view)属性。
+**View**: 容器组件,该组件扩展了[View](https://reactnative.dev/docs/view)属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------- | ------------------------------------------------------------ | ---------------- | -------- | ----------- | ----------------- |
@@ -350,7 +342,7 @@ ohpm install
| style | Custom style | ViewStyle | no | iOS/Android | yes |
| useSafeArea | If true, will render as SafeAreaView | boolean | no | iOS/Android | yes |
-**ActionBar**:快速操作栏,每个操作都支持按钮组件道具,该组件扩展了[View](https://wix.github.io/react-native-ui-lib/docs/components/basic/View)属性。
+**ActionBar**: 快速操作栏,每个操作都支持按钮组件道具,该组件扩展了[View](https://wix.github.io/react-native-ui-lib/docs/components/basic/View)属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------- | ------------------------------------------------------------ | ------------- | -------- | ----------- | ----------------- |
@@ -362,7 +354,7 @@ ohpm install
| style | Component's style | ViewStyle | no | iOS/Android | yes |
| useSafeArea | In iOS, use safe area, in case component attached to the bottom | boolean | no | iOS/Android | yes |
-**Button**:按钮组件,该组件扩展了[TouchableOpacity](https://wix.github.io/react-native-ui-lib/docs/components/basic/TouchableOpacity)属性。
+**Button**: 按钮组件,该组件扩展了[TouchableOpacity](https://wix.github.io/react-native-ui-lib/docs/components/basic/TouchableOpacity)属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| :----------------------- | ------------------------------------------------------------ | ----------------------------------------------- | -------- | ----------- | ----------------- |
@@ -396,7 +388,7 @@ ohpm install
| size | Size of the button [large, medium, small, xSmall] | ButtonSize | no | iOS/Android | yes |
| supportRTL | whether the icon should flip horizontally on RTL locals | boolean | no | iOS/Android | yes |
-**Checkbox**:复选框组件,该组件扩展了[TouchableOpacity](https://wix.github.io/react-native-ui-lib/docs/components/basic/TouchableOpacity)属性。
+**Checkbox**: 复选框组件,该组件扩展了[TouchableOpacity](https://wix.github.io/react-native-ui-lib/docs/components/basic/TouchableOpacity)属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---------------- | ------------------------------------------------------------ | -------------------------- | -------- | ----------- | ----------------- |
@@ -417,7 +409,7 @@ ohpm install
| style | Custom styling for the Checkbox | ViewStyle | no | iOS/Android | yes |
| value | The Checkbox value. If true the switch will be turned on. Default value is false | boolean | no | iOS/Android | yes |
-**Chip**:芯片组件,该组件扩展了[TouchableOpacity](https://wix.github.io/react-native-ui-lib/docs/components/basic/TouchableOpacity),[View](https://wix.github.io/react-native-ui-lib/docs/components/basic/View)属性。
+**Chip**: 芯片组件,该组件扩展了[TouchableOpacity](https://wix.github.io/react-native-ui-lib/docs/components/basic/TouchableOpacity),[View](https://wix.github.io/react-native-ui-lib/docs/components/basic/View)属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------------- | ------------------------------------------------------------ | ----------------------------------------- | -------- | ----------- | ----------------- |
@@ -446,7 +438,7 @@ ohpm install
| useCounter | Display badge as counter (no background) | boolean | no | iOS/Android | yes |
| useSizeAsMinimum | Uses size as minWidth and minHeight | boolean | no | iOS/Android | yes |
-**RadioButton**:单选按钮组件。
+**RadioButton**: 单选按钮组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| -------------- | ------------------------------------------------------------ | --------------------------- | -------- | ----------- | ----------------- |
@@ -465,14 +457,14 @@ ohpm install
| size | The size of the radio button, affect both width & height | number | no | iOS/Android | yes |
| value | The identifier value of the radio button. must be different than other RadioButtons in the same group | string \| number \| boolean | no | iOS/Android | yes |
-**RadioGroup**:包裹单选按钮组件,和RadioButton配合使用。
+**RadioGroup**: 包裹单选按钮组件,和RadioButton配合使用。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- | ----------- | ----------------- |
| initialValue | The initial value of the selected radio button | string \| number \| boolean | no | iOS/Android | yes |
| onValueChange | Invoked once when value changes, by selecting one of the radio buttons in the group | ((value?: string) => void)\|((value?: number) => void)\|((value?: boolean) => void)\|((value?: any) => void) | no | iOS/Android | yes |
-**Slider**:滑块组件。
+**Slider**: 滑块组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------------- | ------------------------------------------------------------ | ------------------------------------ | -------- | ----------- | ----------------- |
@@ -504,7 +496,7 @@ ohpm install
| useRange | If true the Slider will display a second thumb for the min value | boolean | no | iOS/Android | yes |
| value | Initial value | number | no | iOS/Android | yes |
-**Switch**:开关切换组件。
+**Switch**: 开关切换组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------- | ------------------------------------------------------------ | ------------------------ | -------- | ----------- | ----------------- |
@@ -523,7 +515,7 @@ ohpm install
| value | The value of the switch. If true the switch will be turned on. Default value is false | boolean | no | iOS/Android | yes |
| width | The Switch width | number | no | iOS/Android | yes |
-**ChipsInput**:芯片输入组件,该组件扩展了[TextField](https://wix.github.io/react-native-ui-lib/docs/components/form/TextField)属性。
+**ChipsInput**: 芯片输入组件,该组件扩展了[TextField](https://wix.github.io/react-native-ui-lib/docs/components/form/TextField)属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---------------- | ---------------------------------------------------- | --------------------------------------------- | -------- | ----------- | ----------------- |
@@ -532,7 +524,7 @@ ohpm install
| maxChips | The maximum chips to allow adding | number | no | iOS/Android | yes |
| onChange | Callback for chips change (adding or removing chip) | (newChips, changeReason, updatedChip) => void | no | iOS/Android | yes |
-**ColorPalette**:调色板组件。
+**ColorPalette**: 调色板组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------- | ------------------------------------------------------------ | --------------------------------------------- | -------- | ----------- | ----------------- |
@@ -550,7 +542,7 @@ ohpm install
| usePagination | Whether to use pagination when number of colors exceeds the number of rows | boolean | no | iOS/Android | yes |
| value | The value of the selected swatch | string | no | iOS/Android | yes |
-**ColorPicker**:选色器组件。
+**ColorPicker**: 选色器组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- | ----------- | ----------------- |
@@ -562,7 +554,7 @@ ohpm install
| testID | The test id for e2e tests | string | no | iOS/Android | yes |
| value | The value of the selected swatch | string | no | iOS/Android | yes |
-**ColorSwatch**:颜色样板组件。
+**ColorSwatch**: 颜色样板组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ----------- | ------------------------------------------------------------ | --------------------------------------------- | -------- | ----------- | ----------------- |
@@ -577,7 +569,7 @@ ohpm install
| unavailable | Is the initial state is unavailable | boolean | no | iOS/Android | yes |
| value | Must be different than other ColorSwatches in the same group,The identifier value of the ColorSwatch in a ColorSwatch palette | string | no | iOS/Android | yes |
-**DateTimePicker**:时间选择组件,该组件扩展了[TextField](https://wix.github.io/react-native-ui-lib/docs/components/form/TextField)属性,依赖[@react-native-community/datetimepicker](/zh-cn/react-native-community-datetimepicker)库。
+**DateTimePicker**: 时间选择组件,该组件扩展了[TextField](https://wix.github.io/react-native-ui-lib/docs/components/form/TextField)属性,依赖[@react-native-community/datetimepicker](/zh-cn/react-native-community-datetimepicker)库。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ----------------------- | ------------------------------------------------------------ | ------------------------------------------------- | -------- | ----------- | ----------------- |
@@ -598,14 +590,14 @@ ohpm install
| timeZoneOffsetInMinutes | iOS only, Allows changing of the timeZone of the date picker. By default it uses the device's time zone | number | no | iOS | yes |
| value | Defaults to device's date and time, The initial value to set the picker to | Date | no | iOS/Android | yes |
-**MaskedInput**:掩码输入组件,该组件扩展了[TextInput](https://reactnative.dev/docs/textinput)属性。
+**MaskedInput**: 掩码输入组件,该组件扩展了[TextInput](https://reactnative.dev/docs/textinput)属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---------------- | ------------------------------------------------------------ | ------------------ | -------- | ----------- | ----------------- |
| containerStyle | container style for the masked input container | ViewStyle | no | iOS/Android | yes |
| renderMaskedText | callback for rendering the custom input out of the value returns from the actual input | React.ReactElement | no | iOS/Android | yes |
-**NumberInput**:数字输入框组件。
+**NumberInput**: 数字输入框组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ----------------- | ------------------------------------------------------------ | ------------------------------- | -------- | ----------- | ----------------- |
@@ -620,7 +612,7 @@ ohpm install
| trailingText | A trailing text | string | no | iOS/Android | yes |
| trailingTextStyle | The style of the trailing text | ViewStyle | no | iOS/Android | yes |
-**Picker**:弹窗选择组件。
+**Picker**: 弹窗选择组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- | ----------- | ----------------- |
@@ -649,7 +641,7 @@ ohpm install
| useWheelPicker | Use wheel picker instead of a list picker | boolean | no | iOS/Android | yes |
| value | Picker current value | string \| number | no | iOS/Android | yes |
-**Picker.Item**:弹窗选择Item组件,配合Picker组件使用。
+**Picker.Item**: 弹窗选择Item组件,配合Picker组件使用。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ----------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- | ----------- | ----------------- |
@@ -664,7 +656,7 @@ ohpm install
| selectedIconColor | Pass to change the selected icon color | ImageSource | no | iOS/Android | yes |
| value | Item's value | string \| number | no | iOS/Android | yes |
-**SectionsWheelPicker**:滚动选择组件。
+**SectionsWheelPicker**: 滚动选择组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------------- | --------------------------------------------------- | ---------------- | -------- | ----------- | ----------------- |
@@ -677,7 +669,7 @@ ohpm install
| testID | The component test id | string | no | iOS/Android | yes |
| textStyle | Row text style | TextStyle | no | iOS/Android | yes |
-**SegmentedControl**:切换值组件。
+**SegmentedControl**: 切换值组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------------- | ----------------------------------------------- | ------------------------- | -------- | ----------- | ----------------- |
@@ -698,7 +690,7 @@ ohpm install
| testID | Component test id | string | no | iOS/Android | yes |
| throttleTime | Trailing throttle time of changing index in ms. | number | no | iOS/Android | yes |
-**Stepper**:步进器组件。
+**Stepper**: 步进器组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------------ | --------------------------------------------------- | ---------------------------------------- | -------- | ----------- | ----------------- |
@@ -712,7 +704,7 @@ ohpm install
| testID | Test id for component | string | no | iOS/Android | yes |
| value | Stepper value | number | no | iOS/Android | yes |
-**TextField**:文本域组件,扩展了[TextInput](https://reactnative.dev/docs/textinput)属性。
+**TextField**: 文本域组件,扩展了[TextInput](https://reactnative.dev/docs/textinput)属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- | ----------- | ----------------- |
@@ -754,7 +746,7 @@ ohpm install
| validationMessagePosition | The position of the validation message (top/bottom) | ValidationMessagePosition | no | iOS/Android | yes |
| validationMessageStyle | Custom style for the validation message | TextStyle | no | iOS/Android | yes |
-**WheelPicker**:轮式拾取器组件。
+**WheelPicker**: 轮式拾取器组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------------- | ------------------------------------------------------------ | ----------------------------------------------- | -------- | ----------- | ----------------- |
@@ -775,7 +767,7 @@ ohpm install
| testID | test identifier | string | no | iOS/Android | yes |
| textStyle | Row text custom style | TextStyle | no | iOS/Android | yes |
-**Incubator.Dialog**:弹出对话框组件。
+**Incubator.Dialog**: 弹出对话框组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------------- | ------------------------------------------------------------ | ----------------------------- | -------- | ----------- | ----------------- |
@@ -789,7 +781,7 @@ ohpm install
| testID | Used to locate this view in end-to-end tests.The container has the original id.Supported inner elements IDs:`${TestID}.modal` - the Modal's id.`${TestID}. overlayFadingBackground` - the fading background id. | string | no | iOS/Android | yes |
| visible | The visibility of the dialog | boolean | no | iOS/Android | yes |
-**Dialog.Header**:弹窗头部组件。
+**Dialog.Header**: 弹窗头部组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------------- | ------------------------------------------------------------ | -------------------- | -------- | ----------- | ----------------- |
@@ -808,7 +800,7 @@ ohpm install
| topAccessory | Pass to render a top element above the title | ReactElement | no | iOS/Android | yes |
| trailingAccessory | Pass to render a trailing element | ReactElement | no | iOS/Android | yes |
-**Incubator.Slider**:滑块组件。
+**Incubator.Slider**: 滑块组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---------------------- | ------------------------------------------------------------ | ------------------------------------- | -------- | ----------- | ----------------- |
@@ -843,7 +835,7 @@ ohpm install
| useRange | If true the Slider will display a second thumb for the min value | boolean | no | iOS/Android | yes |
| value | Initial value | number | no | iOS/Android | yes |
-**Incubator.Toast**:非中断式弹窗组件。
+**Incubator.Toast**: 非中断式弹窗组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| -------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- | ----------- | ----------------- |
@@ -871,7 +863,7 @@ ohpm install
| visible | Whether to show or hide the toast | boolean | no | iOS/Android | yes |
| zIndex | Custom zIndex for toast | number | no | iOS/Android | yes |
-**Dash**:阔折现组件。
+**Dash**: 阔折现组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| -------------- | ------------------------------------- | --------- | -------- | ----------- | ----------------- |
@@ -883,7 +875,7 @@ ohpm install
| thickness | The thickness of the dashes | number | no | iOS/Android | yes |
| vertical | Is the dashed line should be vertical | boolean | no | iOS/Android | yes |
-**ExpandableSection**:展开收起组件。
+**ExpandableSection**: 展开收起组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------- | -------------------------------------------------------- | --------------- | -------- | ----------- | ----------------- |
@@ -894,7 +886,7 @@ ohpm install
| testID | testing identifier | string | no | iOS/Android | yes |
| top | Should it open above the 'sectionHeader' | boolean | no | iOS/Android | yes |
-**Fader**:渐变淡入淡出组件。
+**Fader**: 渐变淡入淡出组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------- | -------------------------------------------------- | ------------------------------ | -------- | ----------- | ----------------- |
@@ -903,7 +895,7 @@ ohpm install
| tintColor | Change the tint color of the fade view | string | no | iOS/Android | yes |
| visible | Whether the fader is visible (default is true) | boolean | no | iOS/Android | yes |
-**Gradient**:渐变色组件。
+**Gradient**: 渐变色组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------- | --------------------------------- | ------------- | -------- | ----------- | ----------------- |
@@ -912,7 +904,7 @@ ohpm install
| style | Additional style to the component | ViewStyle | no | iOS/Android | yes |
| type | hue \| lightness \| saturation | GradientTypes | no | iOS/Android | yes |
-**KeyboardAccessoryView**:键盘附件视图。
+**KeyboardAccessoryView**: 键盘附件视图。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------------- | ------------------------------------------------------------ | ------------------------ | -------- | ----------- | ----------------- |
@@ -925,13 +917,13 @@ ohpm install
| onRequestShowKeyboard | Callback that will be called if KeyboardRegistry.requestShowKeyboard is called. | () => void | no | iOS/Android | no |
| renderContent | Content to be rendered above the keyboard | () => React.ReactElement | no | iOS/Android | yes |
-**KeyboardAwareInsetsView**:用于在使用键盘时添加插入,可能会隐藏部分屏幕,该组件扩展了[KeyboardTrackingView](https://wix.github.io/react-native-ui-lib/docs/components/infra/KeyboardTrackingView)属性,此组件仅适用与iOS。
+**KeyboardAwareInsetsView**: 用于在使用键盘时添加插入,可能会隐藏部分屏幕,该组件扩展了[KeyboardTrackingView](https://wix.github.io/react-native-ui-lib/docs/components/infra/KeyboardTrackingView)属性,此组件仅适用与iOS。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ----------------------- | ------------------------------------------------------------ | --------- | -------- | -------- | ----------------- |
| KeyboardAwareInsetsView | Used to add an inset when a keyboard is used and might hide part of the screen. | Component | no | iOS | no |
-**KeyboardRegistry**:用于注册键盘并在键盘上执行某些操作。
+**KeyboardRegistry**: 用于注册键盘并在键盘上执行某些操作。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------------- | ------------------------------------------------------------ | --------------- | -------- | ----------- | ----------------- |
@@ -945,7 +937,7 @@ ohpm install
| removeListeners | Remove a listener for a callback. globalID (string) - ID that includes the componentID and the event name (i.e. if componentID='kb1' globalID='kb1.onItemSelected') | static function | no | iOS/Android | yes |
| requestShowKeyboard | Request to show the keyboard componentID (string) - the ID of the keyboard. | static function | no | iOS/Android | yes |
-**KeyboardTrackingView**:为该视图及其子视图启用“键盘跟踪”的 UI 组件。通常用于该视图内有 TextField 或 TextInput 的情况,该组件仅适用于iOS。
+**KeyboardTrackingView**: 为该视图及其子视图启用“键盘跟踪”的 UI 组件。通常用于该视图内有 TextField 或 TextInput 的情况,该组件仅适用于iOS。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------------------------------ | ------------------------------------------------------------ | --------- | -------- | -------- | ----------------- |
@@ -963,7 +955,7 @@ ohpm install
| useSafeArea | Whether or not to handle SafeArea. | boolean | no | iOS | no |
| usesBottomTabs | Whether or not to include bottom tab bar inset. | boolean | no | iOS | no |
-**Overlay**:带类型覆盖视图,为Image组件属性,扩展了[image](https://reactnative.dev/docs/image)组件。
+**Overlay**: 带类型覆盖视图,为Image组件属性,扩展了[image](https://reactnative.dev/docs/image)组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------- | --------------------------------------------------------- | ----------------------------------------------------- | -------- | ----------- | ----------------- |
@@ -972,7 +964,7 @@ ohpm install
| intensity | The intensity of the gradient. | low \|medium \|high | no | iOS/Android | yes |
| type | The type of overlay to set on top of the image | vertical \| top \| bottom \| solid (OverlayTypeType) | no | iOS/Android | yes |
-**Card**:卡片组件,扩展了[TouchableOpacity](https://wix.github.io/react-native-ui-lib/docs/components/basic/TouchableOpacity)组件,依赖[@react-native-community/blur](/zh-cn/react-native-community-blur.md)。
+**Card**: 卡片组件,扩展了[TouchableOpacity](https://wix.github.io/react-native-ui-lib/docs/components/basic/TouchableOpacity)组件,依赖[@react-native-community/blur](/zh-cn/react-native-community-blur.md)。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---------------- | ------------------------------------------------------------ | -------------------- | -------- | ----------- | ----------------- |
@@ -989,7 +981,7 @@ ohpm install
| selectionOptions | Custom options for styling the selection indication | CardSelectionOptions | no | iOS/Android | yes |
| width | Card custom width | number \| string | no | iOS/Android | yes |
-**Card.Image**:Card 组件的内部组件(最好是直接子组件),扩展了[Image](https://wix.github.io/react-native-ui-lib/docs/components/media/Image)组件。
+**Card.Image**: Card 组件的内部组件(最好是直接子组件),扩展了[Image](https://wix.github.io/react-native-ui-lib/docs/components/media/Image)组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| -------- | ------------------------------------------------------------ | -------- | -------- | ----------- | ----------------- |
@@ -997,7 +989,7 @@ ohpm install
| position | The Image position which determines the appropriate flex-ness of the image and border radius (for Android) this prop derived automatically from Card parent component if it rendered as a direct child of the Card component | string[] | no | iOS/Android | yes |
| width | Width | number | no | iOS/Android | yes |
-**Card.Section**:用于在 Card 组件内轻松渲染内容的内部组件,扩展了[View](https://wix.github.io/react-native-ui-lib/docs/components/basic/View)组件。
+**Card.Section**: 用于在 Card 组件内轻松渲染内容的内部组件,扩展了[View](https://wix.github.io/react-native-ui-lib/docs/components/basic/View)组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------- | ------------------------------------------------------------ | ------------------- | -------- | ----------- | ----------------- |
@@ -1010,7 +1002,7 @@ ohpm install
| leadingIcon | Image props for a leading icon to render before the text | ImageProps | no | iOS/Android | yes |
| trailingIcon | Image props for a trailing icon to render after the text | ImageProps | no | iOS/Android | yes |
-**Carousel**:轮播组件,扩展了[ScrollView](https://reactnative.dev/docs/scrollview)组件。
+**Carousel**: 轮播组件,扩展了[ScrollView](https://reactnative.dev/docs/scrollview)组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------------------- | ------------------------------------------------------------ | --------------------------------------- | -------- | ----------- | ----------------- |
@@ -1036,7 +1028,7 @@ ohpm install
| pagingEnabled | Will block multiple pages scroll (will not work with 'pageWidth' prop) | boolean | no | iOS/Android | yes |
| showCounter | Whether to show a page counter (will not work with 'pageWidth' prop) | boolean | no | iOS/Android | yes |
-**LoaderScreen**:全屏显示组件,通常用于页面加载loading,扩展了[Activityindicator](https://reactnative.dev/docs/activityindicator)组件。
+**LoaderScreen**: 全屏显示组件,通常用于页面加载loading,扩展了[Activityindicator](https://reactnative.dev/docs/activityindicator)组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------- | ------------------------------------------------------------ | ---------------- | -------- | ----------- | ----------------- |
@@ -1048,7 +1040,7 @@ ohpm install
| messageStyle | message style | TextStyle | no | iOS/Android | yes |
| overlay | Show the screen as an absolute overlay | boolean | no | iOS/Android | yes |
-**StackAggregator**:堆栈聚合器组件。
+**StackAggregator**: 堆栈聚合器组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------------- | ------------------------------------------------------------ | ---------------------------- | -------- | ----------- | ----------------- |
@@ -1063,7 +1055,7 @@ ohpm install
| onCollapseWillChange | A callback for collapse state will change (value is future collapsed state) | (changed: boolean) => void | no | iOS/Android | yes |
| onItemPress | A callback for item press | (index: number) => void | no | iOS/Android | yes |
-**StateScreen**:显示全屏组件。
+**StateScreen**: 显示全屏组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ----------- | ------------------------------------------------------------ | -------------- | -------- | ----------- | ----------------- |
@@ -1073,7 +1065,7 @@ ohpm install
| testID | Use to identify the container in tests | string | no | iOS/Android | yes |
| title | To to show as the title | string | no | iOS/Android | yes |
-**Drawer**:抽屉组件,如果您的应用程序与 RNN 配合使用,则您的屏幕必须使用“react-native-gesture-handler”中的gestureHandlerRootHOC 进行包装。请参阅[这里](https://kmagiera.github.io/react-native-gesture-handler/docs/getting-started.html#with-wix-react-native-navigation-https-githubcom-wix-react-native-navigation)。
+**Drawer**: 抽屉组件,如果您的应用程序与 RNN 配合使用,则您的屏幕必须使用“react-native-gesture-handler”中的gestureHandlerRootHOC 进行包装。请参阅[这里](https://kmagiera.github.io/react-native-gesture-handler/docs/getting-started.html#with-wix-react-native-navigation-https-githubcom-wix-react-native-navigation)。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| -------------------- | ------------------------------------------------------------ | ----------------------------------------------------- | -------- | ----------- | ----------------- |
@@ -1102,7 +1094,7 @@ ohpm install
| testID | The test id for e2e tests | string | no | iOS/Android | yes |
| useNativeAnimations | Perform the animation in natively | boolean | no | iOS/Android | yes |
-**GridList**:网格列表组件,扩展了[FlatList](https://reactnative.dev/docs/flatlist)组件。
+**GridList**: 网格列表组件,扩展了[FlatList](https://reactnative.dev/docs/flatlist)组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------------- | ------------------------------------------------------------ | ----------------------------------- | -------- | ----------- | ----------------- |
@@ -1114,7 +1106,7 @@ ohpm install
| maxItemWidth | Allow a responsive item width to the maximum item width | number | no | iOS/Android | yes |
| numColumns | Number of items to show in a row (ignored when passing maxItemWidth) | number | no | iOS/Android | yes |
-**GridListItem**:单个网格视图/列表项组件。
+**GridListItem**: 单个网格视图/列表项组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------------------- | ----------------------------------------------------------- | ---------------------------------- | -------- | ----------- | ----------------- |
@@ -1143,7 +1135,7 @@ ohpm install
| titleLines | Title content number of lines | number | no | iOS/Android | yes |
| titleTypography | Title content typography | string | no | iOS/Android | yes |
-**GridView**:网格视图组件。
+**GridView**: 网格视图组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| -------------------- | ------------------------------------------------------------ | ----------------------------------------------- | -------- | ----------- | ----------------- |
@@ -1156,7 +1148,7 @@ ohpm install
| renderCustomItem | Pass to render a custom item | (item: GridListItemProps) => React.ReactElement | no | iOS/Android | yes |
| viewWidth | pass the desired grid view width (will improve loading time) | number | no | iOS/Android | yes |
-**ListItem**:列表中列表项组件,该组件扩展了[TouchableOpacity](https://reactnative.dev/docs/touchableopacity)属性。
+**ListItem**: 列表中列表项组件,该组件扩展了[TouchableOpacity](https://reactnative.dev/docs/touchableopacity)属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---------------- | ------------------------------------------ | ------------------------------------------------------------ | -------- | ----------- | ----------------- |
@@ -1169,7 +1161,7 @@ ohpm install
| testID | The test id for e2e tests | string | no | iOS/Android | yes |
| underlayColor | The inner element pressed backgroundColor | string | no | iOS/Android | yes |
-**ListItem.Part**:用于在 ListItem 内进行布局的子 ListItem 组件。
+**ListItem.Part**: 用于在 ListItem 内进行布局的子 ListItem 组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| -------------- | --------------------------------------------- | --------- | -------- | ----------- | ----------------- |
@@ -1180,7 +1172,7 @@ ohpm install
| right | this part content will be aligned to right | boolean | no | iOS/Android | yes |
| row | this part content direction will be row | boolean | no | iOS/Android | yes |
-**SortableGridList**:可排序网格列表组件,该组件扩展了[GridList](https://wix.github.io/react-native-ui-lib/docs/components/lists/GridList)组件属性。
+**SortableGridList**: 可排序网格列表组件,该组件扩展了[GridList](https://wix.github.io/react-native-ui-lib/docs/components/lists/GridList)组件属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------- | ------------------------------------------------------------ | -------------------------------------------- | -------- | ----------- | ----------------- |
@@ -1189,7 +1181,7 @@ ohpm install
| onOrderChange | Order change callback | (newData: T[], newOrder: ItemsOrder) => void | no | iOS/Android | yes |
| renderItem | Custom render item callback | FlatListProps ['renderItem'] | no | iOS/Android | yes |
-**SortableList**:可排序列表组件,该组件扩展了[FlatList](https://reactnative.dev/docs/flatlist)组件属性。
+**SortableList**: 可排序列表组件,该组件扩展了[FlatList](https://reactnative.dev/docs/flatlist)组件属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- | ----------- | ----------------- |
@@ -1199,7 +1191,7 @@ ohpm install
| onOrderChange | A callback to get the new order (or swapped items). | (data: ItemT[]) => void | no | iOS/Android | yes |
| scale | Scale the item once dragged. | number | no | iOS/Android | yes |
-**Timeline**:时间线组件,该组件扩展了[View](https://reactnative.dev/docs/view)组件属性。
+**Timeline**: 时间线组件,该组件扩展了[View](https://reactnative.dev/docs/view)组件属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------- | ------------------------------------------------------------ | ---------------------------------- | -------- | ----------- | ----------------- |
@@ -1211,7 +1203,7 @@ ohpm install
| testID | The test id for e2e tests | string | no | iOS/Android | yes |
| topLine | The top line props | LineProps | no | iOS/Android | yes |
-**AnimatedImage**:图像加载后以动画淡入的图像组件,该组件扩展了[Image](https://wix.github.io/react-native-ui-lib/docs/components/media/Image)组件属性。
+**AnimatedImage**: 图像加载后以动画淡入的图像组件,该组件扩展了[Image](https://wix.github.io/react-native-ui-lib/docs/components/media/Image)组件属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ----------------- | -------------------------------------------------------- | ----------- | -------- | ----------- | ----------------- |
@@ -1219,7 +1211,7 @@ ohpm install
| containerStyle | Additional spacing styles for the container | ViewStyle | no | iOS/Android | yes |
| loader | A component to render while the image is loading | JSX.element | no | iOS/Android | yes |
-**AnimatedScanner**:该组件扩展了[Animated.View](https://reactnative.dev/docs/animated)组件属性。
+**AnimatedScanner**: 该组件扩展了[Animated.View](https://reactnative.dev/docs/animated)组件属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------- | -------------------------------------------------------- | ---------------------------- | -------- | ----------- | ----------------- |
@@ -1232,7 +1224,7 @@ ohpm install
| progress | Animated value between 0 and 100 | number | no | iOS/Android | yes |
| testID | Used as a testing identifier | string | no | iOS/Android | yes |
-**Avatar**:头像组件,该组件扩展了[TouchableOpacity](https://wix.github.io/react-native-ui-lib/docs/components/basic/TouchableOpacity),[Image](https://wix.github.io/react-native-ui-lib/docs/components/media/Image)组件属性。
+**Avatar**: 头像组件,该组件扩展了[TouchableOpacity](https://wix.github.io/react-native-ui-lib/docs/components/basic/TouchableOpacity),[Image](https://wix.github.io/react-native-ui-lib/docs/components/media/Image)组件属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---------------- | ------------------------------------------------------------ | ------------------------------------------------- | -------- | ----------- | ----------------- |
@@ -1262,7 +1254,7 @@ ohpm install
| testID | Test identifier | string | no | iOS/Android | yes |
| useAutoColors | Hash the name (or label) to get a color, so each name will have a specific color. Default is false. | boolean | no | iOS/Android | yes |
-**Icon**:图标组件,该组件扩展了[Image](https://reactnative.dev/docs/image)组件属性。
+**Icon**: 图标组件,该组件扩展了[Image](https://reactnative.dev/docs/image)组件属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ----------- | -------------------------------------------------------- | ----------------- | -------- | ----------- | ----------------- |
@@ -1273,7 +1265,7 @@ ohpm install
| supportRTL | whether the image should flip horizontally on RTL locals | boolean | no | iOS/Android | yes |
| tintColor | The icon tint | string | no | iOS/Android | yes |
-**Image**:图片组件,该组件扩展了[Image](https://reactnative.dev/docs/image)组件属性。
+**Image**: 图片组件,该组件扩展了[Image](https://reactnative.dev/docs/image)组件属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---------------------- | ------------------------------------------------------------ | ----------------------------------- | -------- | ----------- | ----------------- |
@@ -1293,7 +1285,7 @@ ohpm install
| tintColor | the asset tint | string | no | iOS/Android | yes |
| useBackgroundContainer | Use a container for the Image, this can solve issues on Android when animation needs to be performed on the same view; i.e. animation related crashes on Android. | boolean | no | iOS/Android | yes |
-**Marquee**:滑动文本组件。
+**Marquee**: 滑动文本组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| -------------- | --------------------------------------- | ------------------ | -------- | ----------- | ----------------- |
@@ -1304,13 +1296,13 @@ ohpm install
| labelStyle | Marquee label style | TextProps['style'] | no | iOS/Android | yes |
| numberOfReps | Marquee animation number of repetitions | number | no | iOS/Android | yes |
-**ProgressiveImage**:带动画的图像组件,该组件扩展了[AnimatedImage](https://wix.github.io/react-native-ui-lib/docs/components/media/AnimatedImage)组件属性。
+**ProgressiveImage**: 带动画的图像组件,该组件扩展了[AnimatedImage](https://wix.github.io/react-native-ui-lib/docs/components/media/AnimatedImage)组件属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------- | ------------------------------------------------------------ | ----------- | -------- | ----------- | ----------------- |
| thumbnailSource | Small thumbnail source to display while the full-size image is loading | ImageSource | no | iOS/Android | yes |
-**PageControl**:页面指示器组件。
+**PageControl**: 页面指示器组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------- | ------------------------------------------------------------ | ---------------------------------- | -------- | ----------- | ----------------- |
@@ -1326,7 +1318,7 @@ ohpm install
| spacing | The space between the siblings page indicators | number | no | iOS/Android | yes |
| testID | Used to identify the pageControl in tests | string | no | iOS/Android | yes |
-**TabController**:具有延迟加载机制的选项卡控制器组件,该组件基于react-native-gesture-handler,使用react-native-navigation时,请确保使用gestureHandlerRootHOC包裹屏幕。
+**TabController**: 具有延迟加载机制的选项卡控制器组件,该组件基于react-native-gesture-handler,使用react-native-navigation时,请确保使用gestureHandlerRootHOC包裹屏幕。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ----------------- | ------------------------------------------------------------ | -------------------------------------------------- | -------- | ----------- | ----------------- |
@@ -1336,13 +1328,13 @@ ohpm install
| items | The list of tab bar items | TabControllerItemProps [] | no | iOS/Android | yes |
| onChangeIndex | Callback for when index has change (will not be called on ignored items) | (index: number, prevIndex: number \| null) => void | no | iOS/Android | yes |
-**TabController.PageCarousel**:TabController 的 PageCarousel 组件,该组件扩展了[ScrollView](https://reactnative.dev/docs/scrollview)组件属性。
+**TabController.PageCarousel**: TabController 的 PageCarousel 组件,该组件扩展了[ScrollView](https://reactnative.dev/docs/scrollview)组件属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| -------------------------- | ------------------------------------------------------------ | --------- | -------- | ----------- | ----------------- |
| TabController.PageCarousel | TabController's PageCarousel component,You must pass asCarousel flag to TabController and render your TabPages inside a PageCarousel | Component | no | iOS/Android | yes |
-**TabController.TabBar**:TabController的TabBar组件。
+**TabController.TabBar**: TabController的TabBar组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------------- | -------------------------------------------- | --------- | -------- | ----------- | ----------------- |
@@ -1366,7 +1358,7 @@ ohpm install
| testID | The component test id | string | no | iOS/Android | yes |
| uppercase | Whether to change the text to uppercase | boolean | no | iOS/Android | yes |
-**TabController.TabBarItem**:TabController的TabBarItem组件。
+**TabController.TabBarItem**: TabController的TabBarItem组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------------- | ---------------------------------------------------- | ----------------------- | -------- | ----------- | ----------------- |
@@ -1392,7 +1384,7 @@ ohpm install
| uppercase | Whether to change the text to uppercase | boolean | no | iOS/Android | yes |
| width | A fixed width for the item | number | no | iOS/Android | yes |
-**TabController.TabPage**:TabController的TabPage 组件。
+**TabController.TabPage**: TabController的TabPage 组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------- | ------------------------------------------------------------ | ----------------- | -------- | ----------- | ----------------- |
@@ -1402,7 +1394,7 @@ ohpm install
| renderLoading | Render a custom loading page when lazy loading | () => JSX.Element | no | iOS/Android | yes |
| testID | The component test id | string | no | iOS/Android | yes |
-**Wizard**:向导组件。
+**Wizard**: 向导组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| -------------------- | ------------------------------------------------------------ | ----------------------- | -------- | ----------- | ----------------- |
@@ -1412,7 +1404,7 @@ ohpm install
| onActiveIndexChanged | Callback that is called when the active step is changed (i.e. a step was clicked on). The new activeIndex will be the input of the callback | (index: number) => void | no | iOS/Android | yes |
| testID | The component test id | string | no | iOS/Android | yes |
-**Wizard.Step**:向导组件中Step组件。
+**Wizard.Step**: 向导组件中Step组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------------- | ------------------------------------------------------------ | ---------------- | -------- | ----------- | ----------------- |
@@ -1429,7 +1421,7 @@ ohpm install
| labelStyle | Additional styles for the label | TextStyle | no | iOS/Android | yes |
| state | The state of the step (Wizard.States.X) | WizardStepStates | no | iOS/Android | yes |
-**ActionSheet**:弹窗选择组件。
+**ActionSheet**: 弹窗选择组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- | ----------- | ----------------- |
@@ -1451,7 +1443,7 @@ ohpm install
| useSafeArea | In iOS, use safe area, in case component attached to the bottom | boolean | no | iOS/Android | yes |
| visible | Whether to show the action sheet or not | boolean | no | iOS/Android | yes |
-**Dialog**:弹窗组件。
+**Dialog**: 弹窗组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---------------------- | ------------------------------------------------------------ | --------------------------- | -------- | ----------- | ----------------- |
@@ -1469,7 +1461,7 @@ ohpm install
| visible | Control visibility of the component | boolean | no | iOS/Android | yes |
| width | Width | string \| number | no | iOS/Android | yes |
-**FeatureHighlight**:功能发现组件,FeatureHighlight 组件必须是 render() 返回的根视图的直接子级,如果要突出显示的元素没有样式属性,请添加 'style={{opacity: 1}}' 以便 Android 操作系统可以检测到它,FeatureHighlight 使用native库,你需要引入它。
+**FeatureHighlight**: 功能发现组件,FeatureHighlight 组件必须是 render() 返回的根视图的直接子级,如果要突出显示的元素没有样式属性,请添加 'style={{opacity: 1}}' 以便 Android 操作系统可以检测到它,FeatureHighlight 使用native库,你需要引入它。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| -------------------- | ------------------------------------------------------------ | ----------------------------------------- | -------- | ----------- | ----------------- |
@@ -1494,7 +1486,7 @@ ohpm install
| titleStyle | Title text style | TextStyle | no | iOS/Android | yes |
| visible | Determines if to present the feature highlight component | boolean | no | iOS/Android | yes |
-**FloatingButton**:具有渐变的悬浮按钮。
+**FloatingButton**: 具有渐变的悬浮按钮。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| --------------------- | ------------------------------------------------------------ | --------------------- | -------- | ----------- | ----------------- |
@@ -1509,7 +1501,7 @@ ohpm install
| visible | Whether the component is visible | boolean | no | iOS/Android | yes |
| withoutAnimation | Whether to show/hide the button without animation | boolean | no | iOS/Android | yes |
-**Modal**:模态框组件,该组件扩展了[Modal](https://reactnative.dev/docs/modal)组件属性。
+**Modal**: 模态框组件,该组件扩展了[Modal](https://reactnative.dev/docs/modal)组件属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------------------- | ------------------------------------------------------------ | -------------------------------------- | -------- | ----------- | ----------------- |
@@ -1521,7 +1513,7 @@ ohpm install
| testID | The modal's end-to-end test identifier | string | no | iOS/Android | yes |
| useGestureHandlerRootView | Android only. Should add a GestureHandlerRootView | boolean | no | Android | no |
-**Modal.TopBar**:模态框的TopBar组件。
+**Modal.TopBar**: 模态框的TopBar组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ----------------- | ---------------------------------------------------------- | -------------------------------------- | -------- | ----------- | ----------------- |
@@ -1542,13 +1534,13 @@ ohpm install
| title | Title to display in the center of the top bar | string | no | iOS/Android | yes |
| titleStyle | Title custom style | TextStyle | no | iOS/Android | yes |
-**Toast**:非中断式弹窗组件, 请考虑转向我们新的 Toast 实现并使用 Incubator.Toast 代替。
+**Toast**: 非中断式弹窗组件, 请考虑转向我们新的 Toast 实现并使用 Incubator.Toast 代替。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ----- | ------------------------------ | --------- | -------- | ----------- | ----------------- |
| Toast | A customizable Toast component | Component | no | iOS/Android | yes |
-**Badge**:圆形彩色徽章组件。
+**Badge**: 圆形彩色徽章组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------------- | ------------------------------------------------------------ | -------------------------- | -------- | ----------- | ----------------- |
@@ -1568,7 +1560,7 @@ ohpm install
| onPress | Called when the badge is pressed | (props: any) => void | no | iOS/Android | yes |
| size | Badge's size | number | no | iOS/Android | yes |
-**ConnectionStatusBar**:顶部栏显示无网络连接状态,该组件依赖[@react-native-community/netinfo](/zh-cn/react-native-community-netinfo.md) 库。
+**ConnectionStatusBar**: 顶部栏显示无网络连接状态,该组件依赖[@react-native-community/netinfo](/zh-cn/react-native-community-netinfo.md) 库。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------------- | --------------------------------------------------- | -------------------------------------------------- | -------- | ----------- | ----------------- |
@@ -1577,7 +1569,7 @@ ohpm install
| onConnectionChange | Handler to get connection change events propagation | (isConnected: boolean, isInitial: boolean) => void | no | iOS/Android | yes |
| useAbsolutePosition | Use absolute position for the component | boolean | no | iOS/Android | yes |
-**ProgressBar**:进度条组件。
+**ProgressBar**: 进度条组件。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------- | -------------------------------------------------------- | ----------- | -------- | ----------- | ----------------- |
@@ -1587,7 +1579,7 @@ ohpm install
| progressColor | Progress color | string | no | iOS/Android | yes |
| style | Override container style | ViewStyle | no | iOS/Android | yes |
-**SkeletonView**:骨架视图组件,用于内容还未加载临时显示骨架,该组件需要安装[react-native-shimmer-placeholder](/zh-cn/react-native-shimmer-placeholder.md)和[react-native-linear-gradient](/zh-cn/react-native-linear-gradient.md)库。
+**SkeletonView**: 骨架视图组件,用于内容还未加载临时显示骨架,该组件需要安装[react-native-shimmer-placeholder](/zh-cn/react-native-shimmer-placeholder.md)和[react-native-linear-gradient](/zh-cn/react-native-linear-gradient.md)库。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------- | ------------------------------------------------------------ | -------------------------------------- | -------- | ----------- | ----------------- |
@@ -1609,9 +1601,9 @@ ohpm install
## 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.
**Color**: 可以进行全局样式预设,通过Color获取预设样式。
@@ -1641,13 +1633,13 @@ ohpm install
| ---------------- | ----------------------- | ----------------------------------- | -------- | ----------- | ----------------- |
| loadTypographies | Set space size variable | ({ [key: string]: number }) => void | no | iOS/Android | yes |
-## 遗留问题
+## Known Issues
- [ ] KeyboardTrackingView组件,将输入框子节点保持在键盘上方后点击事件位置异常: [issue#4](https://github.com/react-native-oh-library/react-native-ui-lib/issues/4)
- [ ] 原生组件KeyboardAccessoryView切换自定义键盘未实现: [issue#3](https://github.com/react-native-oh-library/react-native-ui-lib/issues/3)
-## 其他
+## Others
-## 开源协议
+## License
-本项目基于 [The MIT License (MIT)](https://github.com/wix/react-native-ui-lib/blob/master/LICENSE) ,请自由地享受和参与开源。
+This project is licensed under [The MIT License (MIT)](https://github.com/wix/react-native-ui-lib/blob/master/LICENSE).
--
Gitee
From 018e1e910f573ec8226240be07c425d2c9a08cfb Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 15:02:37 +0800
Subject: [PATCH 49/53] docs: [Issues: #IB07UG] react-native-unitsyles.md
---
en/react-native-unitsyles.md | 626 +++++++++++++++++++++++++++++++++++
1 file changed, 626 insertions(+)
create mode 100644 en/react-native-unitsyles.md
diff --git a/en/react-native-unitsyles.md b/en/react-native-unitsyles.md
new file mode 100644
index 00000000..d4b122c9
--- /dev/null
+++ b/en/react-native-unitsyles.md
@@ -0,0 +1,626 @@
+> Template version: v0.2.2
+
+
+
+> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-unistyles)
+
+## 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-unistyles Releases](https://github.com/react-native-oh-library/react-native-unistyles/releases).
+
+Go to the project directory and execute the following instruction:
+
+> [!TIP] Replace the content with the path of the .tgz package at the comment sign (#).
+
+
+
+#### **npm**
+
+```bash
+npm install @react-native-oh-tpl/react-native-unistyles@file:#
+```
+
+#### **yarn**
+
+```bash
+yarn add @react-native-oh-tpl/react-native-unistyles@file:#
+```
+
+
+
+The following code shows the basic use scenario of the repository:
+
+> [!WARNING] The name of the imported repository remains unchanged.
+
+```js
+import {
+ StatusBar,
+ StyleSheet,
+ Text,
+ View,
+ Button,
+ ScrollView,
+ PixelRatio,
+} from "react-native";
+import {
+ UnistylesRuntime,
+ createStyleSheet,
+ useStyles,
+ UnistylesRegistry,
+ mq,
+ UnistylesPlugin,
+} from "react-native-unistyles";
+import React, { useEffect } from "react";
+const basic_styles = StyleSheet.create({
+ consta: { backgroundColor: "#F5FCFF" },
+ titleStyle: { fontSize: 16, fontWeight: "500" },
+});
+
+export function UnistylesExample() {
+ let anti_shake = true;
+ const hasSomeCoolFeatures = true;
+ const { styles, theme } = useStyles(stylesheet, {
+ colors: hasSomeCoolFeatures,
+ sizes: !hasSomeCoolFeatures,
+ });
+ let status_color = true;
+ const renderCount = React.useRef(1);
+ useEffect(
+ () => () => {
+ UnistylesRuntime.removePlugin(autoGuidelinePlugin);
+ },
+ []
+ );
+ const isAutoGuidelinePluginEnabled = UnistylesRuntime.enabledPlugins.includes(
+ autoGuidelinePlugin.name
+ );
+
+ return (
+
+
+
+
+ {"Change the color of the status bar:"}
+
+ {
+ anti_shake = !anti_shake;
+ if (anti_shake) {
+ UnistylesRuntime.statusBar.setColor(
+ status_color ? sharedColors.barbie : sharedColors.aloes
+ );
+ status_color = !status_color;
+ }
+ }}
+ >
+
+
+ {"Change the theme object:"}
+
+
+
+ {" "}
+ Current topic:{UnistylesRuntime.themeName} The number of times to re
+ render:{renderCount.current++}
+
+
+ {" "}
+ Colors: {JSON.stringify(theme.colors, null, 2)}{" "}
+
+ {
+ anti_shake = !anti_shake;
+ if (anti_shake) {
+ UnistylesRuntime.setAdaptiveThemes(false);
+ UnistylesRuntime.setTheme("light");
+ UnistylesRuntime.updateTheme("light", (theme) => ({
+ ...theme,
+ colors: {
+ ...theme.colors,
+ typography:
+ theme.colors.typography === "#000000"
+ ? theme.colors.blood
+ : "#000000",
+ },
+ }));
+ }
+ }}
+ />
+
+
+ {"Change page style:"}
+
+ {" "}
+ This page is currently in use {UnistylesRuntime.themeName} .
+
+ {
+ anti_shake = !anti_shake;
+ if (anti_shake) {
+ UnistylesRuntime.setAdaptiveThemes(false);
+ UnistylesRuntime.setTheme(
+ UnistylesRuntime.themeName === "light" ? "premium" : "light"
+ );
+ }
+ }}
+ />
+
+ {"Adaptive Theme:"}
+
+ {" System Theme:" + UnistylesRuntime.colorScheme}
+
+ {
+ anti_shake = !anti_shake;
+ if (anti_shake) {
+ UnistylesRuntime.setAdaptiveThemes(true);
+ }
+ }}
+ />
+
+ {"plug-in unit:"}
+
+
+ Styles with the prefix unscaled will be skipped by the plugin, while
+ plugins that have already been enabled will be skipped
+ {UnistylesRuntime.enabledPlugins}
+
+ {
+ anti_shake = !anti_shake;
+ if (anti_shake) {
+ isAutoGuidelinePluginEnabled
+ ? UnistylesRuntime.removePlugin(autoGuidelinePlugin)
+ : UnistylesRuntime.addPlugin(autoGuidelinePlugin);
+ }
+ }}
+ />
+
+
+ {"Using runtime in StyleSheets:"}
+
+
+
+ The width of the square occupying half the size of the screen:
+ {styles.box.width} 861 height:
+ {styles.box.height}
+
+
+
+
+ {"Dynamic functional style sheet:"}
+
+
+ accent
+
+
+ barbie
+
+
+ {"Media inquiry:"}
+
+
+ What is the size of your screen:{UnistylesRuntime.screen.width}x
+ {UnistylesRuntime.screen.height};When the width is greater than 500,
+ the background is
+ {theme.colors.backgroundColor},When the width is greater than 900, the
+ background is
+ {theme.colors.aloes}
+
+
+
+
+ {"Using variables in StyleSheets:"}
+
+
+ {":"}
+
+ {"Font size preference:"}
+
+ {"The current font size preference is set to:" +
+ UnistylesRuntime.contentSizeCategory}
+
+
+
+ );
+}
+
+const stylesheet = createStyleSheet((theme, runtime) => ({
+ container: {
+ flex: 1,
+ justifyContent: "center",
+ alignItems: "center",
+ paddingHorizontal: 20,
+ backgroundColor: theme.colors.backgroundColor,
+ rowGap: 20,
+ },
+ text: {
+ textAlign: "center",
+ color: theme.colors.typography,
+ fontSize: 14,
+ },
+ bold: {
+ fontWeight: "bold",
+ },
+ container1: {
+ flex: 1,
+ justifyContent: "center",
+ alignItems: "center",
+ paddingHorizontal: 20,
+ backgroundColor: {
+ [mq.width(undefined, 500).and.height(undefined, 1000)]:
+ theme.colors.backgroundColor,
+ [mq.only.width(932)]: theme.colors.aloes,
+ },
+ rowGap: 20,
+ },
+ theme: {
+ color: theme.colors.typography,
+ },
+ box: {
+ justifyContent: "center",
+ alignItems: "center",
+ padding: 20,
+ marginTop: 50,
+ width: runtime.screen.width / 2,
+ height: runtime.screen.height / 2,
+ backgroundColor:
+ runtime.orientation === "portrait"
+ ? theme.colors.accent
+ : theme.colors.oak,
+ },
+ dynamicFunction: (index: number) => ({
+ backgroundColor:
+ index % 2 === 0 ? theme.colors.accent : theme.colors.barbie,
+ }),
+ box_variants: {
+ borderRadius: 10,
+ variants: {
+ colors: {
+ true: { backgroundColor: theme.colors.barbie },
+ false: { backgroundColor: theme.colors.blood },
+ default: { backgroundColor: theme.colors.sky },
+ other: { backgroundColor: theme.colors.typography },
+ },
+ sizes: {
+ true: { width: 200, height: 200 },
+ false: { width: 50, height: 50 },
+ default: { width: 100, height: 100 },
+ other: { width: 150, height: 150 },
+ },
+ },
+ },
+ unscaledBox: { width: 100, height: 100, backgroundColor: theme.colors.blood },
+}));
+
+const sharedColors = {
+ barbie: "#ff9ff3",
+ oak: "#1dd1a1",
+ sky: "#48dbfb",
+ fog: "#c8d6e5",
+ aloes: "#00d2d3",
+ blood: "#ff6b6b",
+};
+const lightTheme = {
+ colors: {
+ ...sharedColors,
+ backgroundColor: "#ffffff",
+ typography: "#000000",
+ accent: sharedColors.blood,
+ },
+};
+const darkTheme = {
+ colors: {
+ ...sharedColors,
+ backgroundColor: "#000000",
+ typography: "#ffffff",
+ accent: sharedColors.barbie,
+ },
+};
+const premiumTheme = {
+ colors: {
+ ...sharedColors,
+ backgroundColor: sharedColors.barbie,
+ typography: "#76278f",
+ accent: "#000000",
+ },
+};
+const breakpoints = { xs: 0, sm: 300, md: 500, lg: 800, xl: 1200 };
+UnistylesRegistry.addThemes({
+ light: lightTheme,
+ dark: darkTheme,
+ premium: premiumTheme,
+})
+ .addBreakpoints(breakpoints)
+ .addConfig({ adaptiveThemes: true, initialTheme: "light" });
+
+const REFERENCE_WIDTH = 300;
+const REFERENCE_HEIGHT = 800;
+
+const autoGuidelinePlugin: UnistylesPlugin = {
+ name: "autoGuideline",
+ onParsedStyle: (styleKey, style, runtime) => {
+ const pairs = Object.entries(style).map(([key, value]) => {
+ if (styleKey.includes("unscaled")) {
+ return [key, value];
+ }
+
+ const isNumber = typeof value === "number";
+
+ if (!isNumber || key === "flex") {
+ return [key, value];
+ }
+
+ if (key === "height") {
+ const percentage = value / REFERENCE_HEIGHT;
+ return [
+ key,
+ PixelRatio.roundToNearestPixel(runtime.screen.height * percentage),
+ ];
+ }
+ const percentage = value / REFERENCE_WIDTH;
+ return [
+ key,
+ PixelRatio.roundToNearestPixel(runtime.screen.width * percentage),
+ ];
+ });
+
+ return Object.fromEntries(pairs);
+ },
+};
+```
+
+## Link
+
+Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking.
+
+Open the `harmony` directory of the HarmonyOS project in DevEco Studio.
+
+### 1. Adding the overrides Field to oh-package.json5 File in the Root Directory of the Project
+
+```json
+{
+ ...
+ "overrides": {
+ "@rnoh/react-native-openharmony" : "./react_native_openharmony"
+ }
+}
+```
+
+### 2. Introducing Native Code
+
+Currently, two methods are available:
+
+Method 1 (recommended): Use the HAR file.
+
+> [!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library.
+
+Open `entry/oh-package.json5` file and add the following dependencies:
+
+```json
+"dependencies": {
+ "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
+ "@react-native-oh-tpl/react-native-unistyles": "file:../../node_modules/@react-native-oh-tpl/react-native-unistyles/harmony/unistyles.har"
+}
+```
+
+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] For details, see [Directly Linking Source Code](/zh-cn/link-source-code.md).
+
+### 3. Configuring CMakeLists and Introducing UnistylesPackage
+
+Open `entry/src/main/cpp/CMakeLists.txt` and add the following code:
+
+```diff
+project(rnapp)
+cmake_minimum_required(VERSION 3.4.1)
+set(CMAKE_SKIP_BUILD_RPATH TRUE)
+set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
+set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules")
++ set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
+set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp")
+set(LOG_VERBOSITY_LEVEL 1)
+set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments")
+set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie")
+set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use
+add_compile_definitions(WITH_HITRACE_SYSTRACE)
+
+add_subdirectory("${RNOH_CPP_DIR}" ./rn)
+
+# RNOH_BEGIN: manual_package_linking_1
+add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package)
++ add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/react-native-unistyles/src/main/cpp" ./unistyles)
+# RNOH_END: manual_package_linking_1
+
+file(GLOB GENERATED_CPP_FILES "./generated/*.cpp")
+
+add_library(rnoh_app SHARED
+ ${GENERATED_CPP_FILES}
+ "./PackageProvider.cpp"
+ "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp"
+)
+target_link_libraries(rnoh_app PUBLIC rnoh)
+
+# RNOH_BEGIN: manual_package_linking_2
+target_link_libraries(rnoh_app PUBLIC rnoh_sample_package)
++ target_link_libraries(rnoh_app PUBLIC rnoh_unistyles)
+# RNOH_END: manual_package_linking_2
+```
+
+Open `entry/src/main/cpp/PackageProvider.cpp` and add the following code:
+
+```diff
+#include "RNOH/PackageProvider.h"
+#include "generated/RNOHGeneratedPackage.h"
+#include "SamplePackage.h"
++ #include "UnistylesPackage.h"
+
+using namespace rnoh;
+
+std::vector> PackageProvider::getPackages(Package::Context ctx) {
+ return {
+ std::make_shared(ctx),
+ std::make_shared(ctx),
++ std::make_shared(ctx),
+ };
+}
+```
+
+### 4. Introducing RNUnistylesPackage to ArkTS
+
+Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
+
+```diff
+ ...
++ import {RNUnistylesPackage} from '@react-native-oh-tpl/react-native-unistyles/ts';
+
+export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
+ return [
+ new SamplePackage(ctx),
++ new RNUnistylesPackage(ctx)
+ ];
+}
+```
+
+### 5. Running
+
+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
+
+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-unistyles Releases](https://github.com/react-native-oh-library/react-native-unistyles/releases)
+
+## Runtime
+
+### UnistylesRuntime
+
+UnistylesRuntime 是 Unitstyles 库 的一个 Host Object。它始终保持最新状态,并允许您与 Unistyles 的原生层进行交互
+
+#### UnistylesRuntime 属性
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| -------------------- | ---------------------------------------------------------------------------- | -------------------- | -------- | -------- | ----------------- |
+| screenWidth | Screen dimensions Width | number | no | All | yes |
+| screenHeight | Screen dimensions Height | number | no | All | yes |
+| enabledPlugins | Names of currently enabled plugins | boolean | no | All | yes |
+| hasAdaptiveThemes | Indicates if you have enabled adaptive themes | boolean | no | All | yes |
+| themeName | Name of the selected theme or an empty string if you don’t use themes | string | no | All | yes |
+| breakpoint | Current breakpoint or always undefined if you don’t use breakpoints | UnistylesBreakpoints | no | All | yes |
+| colorScheme | Get your device’s color scheme. Available options dark, light or unspecified | string | no | All | yes |
+| contentSizeCategory | Your device’s content size category | string | no | All | yes |
+| insets | Device insets which are safe to put content into | inset | no | All | yes |
+| statusBar.width | Status bar dimensions width | number | no | All | yes |
+| statusBar.height | Status bar dimensions height | number | no | All | yes |
+| navigationBar.height | Navigation bar dimensions height | number | no | Android | yes |
+| navigationBar.width | Navigation bar dimensions width | number | no | Android | yes |
+| ScreenOrientation | Your device’s orientation | ScreenOrientation | no | All | yes |
+
+目前 UnistylesRuntime 支持:
+
+- `statusBar.setColor`
+ Update statusBar color at runtime
+
+- `navigationBar.setColor`
+ Update navigationBar color at runtime
+
+- `setAdaptiveThemes`
+ Toggle adaptive themes
+
+- `setTheme`
+ Change the current theme
+
+- `updateTheme`
+ Update the theme at runtime
+
+- `removePlugin`
+ Disable a plugin
+
+- `addPlugin`
+ Enable a plugin
+
+## Static Methods
+
+> [!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.
+
+#### global
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ---------------- | ---------------------------------------------------------------------------- | -------- | -------- | -------- | ----------------- |
+| useInitialTheme | using multiple themes and need to determine the initial theme during runtime | function | no | All | yes |
+| useStyles | set current styles | function | no | All | yes |
+| createStyleSheet | create unistyles StyleSheet | function | no | All | yes |
+
+#### mq
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ------ | ----------------------------- | -------- | -------- | -------- | ----------------- |
+| width | width from xx onwards | function | no | All | yes |
+| height | heigh from xx onwards | function | no | All | yes |
+| and | and | function | no | All | yes |
+| only | width or height from xx to xx | function | no | All | yes |
+
+## API
+
+> [!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.
+
+#### UnistylesRegistry
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| -------------- | -------------------- | -------- | -------- | -------- | ----------------- |
+| addThemes | register themes | function | no | All | yes |
+| addBreakpoints | register breakpoints | function | no | All | yes |
+| addConfig | register config | function | no | All | yes |
+
+## Known Issues
+
+## Others
+
+## License
+
+This project is licensed under [The MIT License (MIT)](https://github.com/jpudysz/react-native-unistyles/blob/main/LICENSE).
--
Gitee
From 0cc25e15eb10507a3866b92974b93262b6beeadb Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 15:02:45 +0800
Subject: [PATCH 50/53] docs: [Issues: #IB07UG] react-native-url-polyfill.md
---
en/react-native-url-polyfill.md | 42 ++++++++++++++++-----------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/en/react-native-url-polyfill.md b/en/react-native-url-polyfill.md
index 6fedb375..4b1b3308 100644
--- a/en/react-native-url-polyfill.md
+++ b/en/react-native-url-polyfill.md
@@ -1,6 +1,6 @@
-> 模板版本:v0.2.2
+> Template version: v0.2.2
react-native-url-polyfill
@@ -15,9 +15,9 @@
-> [!TIP] [Github 地址](https://github.com/charpeni/react-native-url-polyfill)
+> [!TIP] [GitHub address](https://github.com/charpeni/react-native-url-polyfill)
-## 安装与使用
+## Installation and Usage
@@ -35,9 +35,9 @@ yarn add react-native-url-polyfill@2.0.0
-下面的代码展示了这个库的基本使用场景:
+The following code shows the basic use scenario of the repository:
-> [!WARNING] 使用时 import 的库名不变。
+> [!WARNING] The name of the imported repository remains unchanged.
```js
import React, { useState } from "react";
@@ -82,7 +82,7 @@ const URLPolyfillDemo = () => {
- Method:append(q,CodeHub)
+ Method: append(q,CodeHub) {
- Method:set(abc,Gitee))
+ Method: set(abc,Gitee)) {
- Method:delete(abc,javascript)
+ Method: delete(abc,javascript) [!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 |
| ------------ | ------------------------------------------------------------ | --------------- | -------- | ----------- | :---------------- |
@@ -163,11 +163,11 @@ export default URLPolyfillDemo;
| username | Gets and sets the username portion of the URL. | string | no | Android/iOS | yes |
| size | The total number of parameter entries on the `URLSearchParams` object. | number | no | Android/iOS | yes |
-## 静态方法
+## Static Methods
-> [!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 |
| -------- | ------------------------------------------------------------ | ---------------------------------- | -------- | ----------- | ----------------- |
@@ -186,15 +186,15 @@ export default URLPolyfillDemo;
| toString | Returns the search parameters serialized as a string on the `URLSearchParams` object, with characters percent-encoded where necessary . | string | no | Android/iOS | yes |
| values | Returns an ES6 `Iterator` over the values of each name-value pair. | IterableIterator | no | Android/iOS | yes |
-## 遗留问题
+## Known Issues
-## 其他
+## Others
- [ ] 本库在Harmony、iOS、Android都存在的问题,URLSearchParams对象上size属性无法获取对应参数条目的总数,问题: [issue#472](https://github.com/charpeni/react-native-url-polyfill/issues/472)
- [ ] 本库在Harmony、iOS、Android都存在的问题,URLSearchParams对象上sort方法按名称对现有的key-value进行排序,排序无效果, 问题: [issue#471](https://github.com/charpeni/react-native-url-polyfill/issues/471)
-## 开源协议
+## License
-本项目基于[The MIT License](https://github.com/charpeni/react-native-url-polyfill/blob/main/LICENSE) ,请自由地享受和参与开源。
+This project is licensed under[The MIT License](https://github.com/charpeni/react-native-url-polyfill/blob/main/LICENSE).
\ No newline at end of file
--
Gitee
From 0b228f9c036b479a735863716dd2f3d9b21327cd Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 15:02:53 +0800
Subject: [PATCH 51/53] docs: [Issues: #IB07UG] react-native-vconsole.md
---
en/react-native-vconsole.md | 50 ++++++++++++++++++-------------------
1 file changed, 24 insertions(+), 26 deletions(-)
diff --git a/en/react-native-vconsole.md b/en/react-native-vconsole.md
index f64fc763..5a335d87 100644
--- a/en/react-native-vconsole.md
+++ b/en/react-native-vconsole.md
@@ -1,4 +1,4 @@
-> 模板版本:v0.2.2
+> Template version: v0.2.2
react-native-vconsole
@@ -12,13 +12,11 @@
+> [!TIP] [GitHub address](https://github.com/kafudev/react-native-vconsole)
+## Installation and Usage
-> [!TIP] [Github 地址](https://github.com/kafudev/react-native-vconsole)
-
-## 安装与使用
-
-进入到工程目录并输入以下命令:
+Go to the project directory and execute the following instruction:
@@ -36,9 +34,9 @@ yarn add @kafudev/react-native-vconsole@0.1.11
-下面的代码展示了这个库的基本使用场景:
+The following code shows the basic use scenario of the repository:
-> [!WARNING] 使用时 import 的库名不变。
+> [!WARNING] The name of the imported repository remains unchanged.
```js
@@ -56,11 +54,11 @@ export const ConsoleDemo = () => {
function PropsType() {
const appInfo = {
- 原生构建类型: "1",
- 原生版本号: "ConfigReader.VERSION_NAME",
- 原生构建时间: "ConfigReader.BUILD_TIME",
- 热更新版本号: "codePushStore.info.label",
- 热更新详情: "codePushStore.info.desc"
+ Native build type: "1",
+ Native version number: "ConfigReader.VERSION_NAME",
+ Native build time: "ConfigReader.BUILD_TIME",
+ Hot update version number: "codePushStore.info.label",
+ Hot update details: "codePushStore.info.desc"
}
return (
@@ -72,8 +70,8 @@ function PropsType() {
const styles = StyleSheet.create({
container: {
- position: 'absolute', // 绝对定位
- bottom: 180, // 底部边界与父容器底部对齐
+ position: 'absolute',
+ bottom: 180,
width: '100%',
height: 200,
borderWidth: 1,
@@ -93,20 +91,20 @@ const styles = StyleSheet.create({
});
```
-## 约束与限制
+## Constraints
-### 兼容性
+### Compatibility
-本文档内容基于以下版本验证通过:
+This document is verified based on the following versions:
-1. RNOH: 0.72.29; SDK:HarmonyOS-Next-DB6 5.0.0.61; IDE:DevEco Studio 5.0.3.706; ROM:3.0.0.65;
+1. RNOH: 0.72.29; SDK: HarmonyOS-Next-DB6 5.0.0.61; IDE: DevEco Studio 5.0.3.706; ROM: 3.0.0.65;
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 |
| ------- | ---------------------------------------- | ------- | -------- | -------- | ----------------- |
@@ -115,13 +113,13 @@ const styles = StyleSheet.create({
| showBtn | Whether to show buttons | boolean | no | All | yes |
| panels | Custom panels | json | no | All | yes |
-## 遗留问题
+## Known Issues
- [ ] 本库在HarmonyOS存在Clipboard无法使用的问题,其已从新版rn框架中移除,依赖Clipboard的相关功能,监控面板network标签页Copy cURL to clipboard、Copy request query to clipboard、Copy response to clipboard均无法正常复制以及粘贴,问题: [issue#2](https://github.com/kafudev/react-native-vconsole/issues/2)
- [ ] 本库在HarmonyOS存在DevMenu菜单无法启用的问题,新版本rn框架中已经将其从NativeModules移除,DevMenu菜单里的ReLoad、Fps等调试相关功能均无法正常使用, 问题: [issue#3](https://github.com/kafudev/react-native-vconsole/issues/3)
-## 其他
+## Others
-## 开源协议
+## License
-本项目基于 [The MIT License (MIT)](https://github.com/kafudev/react-native-vconsole/blob/main/LICENSE) ,请自由地享受和参与开源
+This project is licensed under [The MIT License (MIT)](https://github.com/kafudev/react-native-vconsole/blob/main/LICENSE) ,请自由地享受和参与开源
--
Gitee
From 8b6bcda6c51b048831d373d04beb7c26d3aec2b1 Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 15:03:01 +0800
Subject: [PATCH 52/53] docs: [Issues: #IB07UG] react-native-view-pdf.md
---
en/react-native-view-pdf.md | 93 ++++++++++++++++++-------------------
1 file changed, 45 insertions(+), 48 deletions(-)
diff --git a/en/react-native-view-pdf.md b/en/react-native-view-pdf.md
index fb55afcc..ebc09b03 100644
--- a/en/react-native-view-pdf.md
+++ b/en/react-native-view-pdf.md
@@ -1,4 +1,4 @@
-> 模板版本:v0.2.2
+> Template version: v0.2.2
react-native-view-pdf
@@ -12,15 +12,15 @@
-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-PDFView)
+> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-PDFView)
-## 安装与使用
+## Installation and Usage
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-view-pdf Releases](https://github.com/react-native-oh-library/react-native-PDFView/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-view-pdf Releases](https://github.com/react-native-oh-library/react-native-PDFView/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-view-pdf@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 React from "react";
@@ -60,17 +60,17 @@ export function PdfViewExample() {
}
```
-## 使用 Codegen
+## Use Codegen
-本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。
+If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/zh-cn/codegen.md).
## Link
-目前鸿蒙暂不支持 AutoLink,所以 Link 步骤需要手动配置。
+Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking.
-首先需要使用 DevEco Studio 打开项目里的鸿蒙工程 `harmony`
+Open the `harmony` directory of the HarmonyOS project in DevEco Studio.
-### 1.在工程根目录的 `oh-package.json` 添加 overrides 字段
+### 1. Adding the overrides Field to oh-package.json5 File in the Root Directory of the Project
```json
{
@@ -81,18 +81,15 @@ export function PdfViewExample() {
}
```
-### 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": {
@@ -101,22 +98,22 @@ export function PdfViewExample() {
}
```
-点击右上角的 `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](/zh-cn/link-source-code.md).
-### 3.在 ArkTs 侧引入 RNPDFView 组件
+### 3. Introducing RNPDFView Component to ArkTS
-找到 `function buildCustomRNComponent()`,一般位于 `entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets`,添加:
+Find `function buildCustomRNComponent()`, which is usually located in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets`, and add the following code:
```diff
...
@@ -136,9 +133,9 @@ export function buildCustomRNComponent(ctx: ComponentBuilderContext) {
...
```
-> [!TIP] 本库使用了混合方案,需要添加组件名。(如使用混合方案)
+> [!TIP] If the repository uses a mixed solution, the component name needs to be added.
-在`entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets` 找到常量 `arkTsComponentNames` 在其数组里添加组件名
+Find the constant `arkTsComponentNames` in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets` and add the component name to the array.
```diff
const arkTsComponentNames: Array = [
@@ -149,9 +146,9 @@ const arkTsComponentNames: Array = [
];
```
-### 4.在 ArkTs 侧引入 PDFViewPackage
+### 4. Introducing PDFViewPackage to ArkTS
-打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
+Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
```diff
...
@@ -165,30 +162,30 @@ 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
```
-## 约束与限制
+## 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-view-pdf Releases](https://github.com/react-native-oh-library/react-native-PDFView/releases)
+Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-view-pdf Releases](https://github.com/react-native-oh-library/react-native-PDFView/releases)
-## 属性
+## 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 |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | -------- | ----------------- |
@@ -204,23 +201,23 @@ ohpm install
| onPageChanged | Callback that is invoked when page is changed. Provides active page and total pages information | function | no | Android | no |
| onScrolled | Callback that is invoked when PDF is scrolled. Provides offset value in a range between 0 and 1. Currently only 0 and 1 are supported. | function | no | all | no |
-### 静态方法
+### Static Methods
-> [!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 |
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | -------- | ----------------- |
| reload | Allows to reload the PDF document. This can be useful in such cases as network issues, document is expired, etc. To reload the document you will need a `ref` to the component: | function | yes | all | yes |
-## 遗留问题
+## Known Issues
- [ ] urlProps 属性不支持, HarmonyOS 原生组件 webview 不支持 urlProps。[issue: #5](https://github.com/react-native-oh-library/react-native-PDFView/issues/5)
- [ ] onScrolled 属性不支持, HarmonyOS 原生组件 webview 加载 pdf 文件时 onScrolled 回调函数不执行。 [issue: #6](https://github.com/react-native-oh-library/react-native-PDFView/issues/6)
-## 其他
+## Others
-## 开源协议
+## License
-本项目基于 [The MIT License (MIT)](https://github.com/rumax/react-native-PDFView/blob/master/LICENSE) ,请自由地享受和参与开源。
+This project is licensed under [The MIT License (MIT)](https://github.com/rumax/react-native-PDFView/blob/master/LICENSE).
--
Gitee
From b434c2dd962c9e3c4ce843eba2e1bd8ff6214b2a Mon Sep 17 00:00:00 2001
From: ljje
Date: Mon, 28 Oct 2024 15:03:08 +0800
Subject: [PATCH 53/53] docs: [Issues: #IB07UG] react-native-waterfall-flow.md
---
en/react-native-waterfall-flow.md | 196 ++++++++++++++++++++----------
1 file changed, 130 insertions(+), 66 deletions(-)
diff --git a/en/react-native-waterfall-flow.md b/en/react-native-waterfall-flow.md
index 804ca8d4..dd8c128d 100644
--- a/en/react-native-waterfall-flow.md
+++ b/en/react-native-waterfall-flow.md
@@ -1,4 +1,4 @@
-> 模板版本:v0.2.2
+> Template version: v0.2.2
react-native-waterfall-flow
@@ -12,11 +12,11 @@
->[!TIP] [Github 地址](https://github.com/axerjs/react-native-waterfall-flow)
+> [!TIP] [GitHub address](https://github.com/axerjs/react-native-waterfall-flow)
-## 安装与使用
+## Installation and Usage
-进入到工程目录并输入以下命令:
+Go to the project directory and execute the following instruction:
@@ -34,41 +34,91 @@ yarn add react-native-waterfall-flow@1.1.5 --save
-下面的代码展示了这个库的基本使用场景:
+The following code shows the basic use scenario of the repository:
```js
-import React, { useState, useRef } from 'react';
-import { View, Text, StyleSheet, Button, RefreshControl, Alert } from 'react-native';
-import WaterfallFlow from 'react-native-waterfall-flow';
+import React, { useState, useRef } from "react";
+import {
+ View,
+ Text,
+ StyleSheet,
+ Button,
+ RefreshControl,
+ Alert,
+} from "react-native";
+import WaterfallFlow from "react-native-waterfall-flow";
const App = () => {
- const item = ['Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item', 'Item'].map((l, i) => ({ id: l, text: i + ` ${l}` }))
+ const item = [
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ "Item",
+ ].map((l, i) => ({ id: l, text: i + ` ${l}` }));
const [data, setData] = useState(item);
const [refreshing, setRefreshing] = useState(false);
const waterfallRef = useRef(null);
const renderItem = ({ item }) => {
-
return (
{item.text}
);
- }
+ };
const onRefresh = () => {
setRefreshing(true);
setTimeout(() => {
- // 模拟刷新数据
setData([...item]);
setRefreshing(false);
}, 2000);
};
const onEndReached = () => {
- // 模拟加载更多数据
- setData([...data, { id: `${data.length + 1}`, text: `${data.length + 1} Item` }, { id: `${data.length + 2}`, text: `${data.length + 2} Item` }]);
- // Alert.alert('滚动到底部')
+ setData([
+ ...data,
+ { id: `${data.length + 1}`, text: `${data.length + 1} Item` },
+ { id: `${data.length + 2}`, text: `${data.length + 2} Item` },
+ ]);
};
return (
@@ -79,15 +129,23 @@ const App = () => {
renderItem={renderItem}
data={data}
numColumns={2}
- ListHeaderComponent={Header Component}
- ListFooterComponent={Footer Component}
- ListEmptyComponent={No Data Available}
+ ListHeaderComponent={
+ Header Component
+ }
+ ListFooterComponent={
+ Footer Component
+ }
+ ListEmptyComponent={
+ No Data Available
+ }
onEndReached={onEndReached}
onRefresh={onRefresh}
refreshing={refreshing}
style={styles.waterfall}
contentContainerStyle={styles.contentContainer}
- refreshControl={}
+ refreshControl={
+
+ }
/>
@@ -97,7 +155,15 @@ const App = () => {
/>
{ data.length >= 20 ? waterfallRef.current.scrollToIndex({ animated: true, index: 20, viewPosition: 0 }) : false }}
+ onPress={() => {
+ data.length >= 20
+ ? waterfallRef.current.scrollToIndex({
+ animated: true,
+ index: 20,
+ viewPosition: 0,
+ })
+ : false;
+ }}
/>
{
{ setData([]) }}
+ onPress={() => {
+ setData([]);
+ }}
/>
@@ -125,7 +193,7 @@ const styles = StyleSheet.create({
padding: 10,
},
item: {
- backgroundColor: '#ccc',
+ backgroundColor: "#ccc",
margin: 5,
padding: 10,
borderRadius: 5,
@@ -133,82 +201,78 @@ const styles = StyleSheet.create({
header: {
padding: 10,
fontSize: 18,
- textAlign: 'center',
+ textAlign: "center",
},
footer: {
padding: 10,
fontSize: 16,
- textAlign: 'center',
+ textAlign: "center",
},
empty: {
padding: 10,
fontSize: 16,
- textAlign: 'center',
+ textAlign: "center",
},
buttonsContainer: {
- flexDirection: 'row',
- justifyContent: 'space-around',
+ flexDirection: "row",
+ justifyContent: "space-around",
padding: 10,
},
buttonDelete: {
- marginBottom: 20
- }
+ marginBottom: 20,
+ },
});
export default App;
```
-## 约束与限制
+## Constraints
-### 兼容性
+### Compatibility
-本文档内容基于以下版本验证通过:
+This document is verified based on the following versions:
-1. RNOH: 0.72.29; SDK:HarmonyOS NEXT Developer Beta6; IDE:DevEco Studio 5.0.3.706; ROM:NEXT.0.0.65;
+1. RNOH: 0.72.29; SDK: HarmonyOS NEXT Developer Beta6; IDE: DevEco Studio 5.0.3.706; ROM: NEXT.0.0.65;
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] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
-## 属性
-
->[!TIP] "Platform"列表示该属性在原三方库上支持的平台。
-
->[!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| --------------------- | ------------------------------------------------------------------------------------------------------ | -------- | -------- | ----------------- | ----------------- |
-| `renderItem` | 用于将当前`item`渲染到列表中 | function | Yes | All | yes |
-| `data` | 瀑布流数据源,可以是任意内容的数组 | array | Yes | All | yes |
-| `numColumns` | 瀑布流的列数,默认为2,即两列 | number | No | All | yes |
-| `ListHeaderComponent` | 头部组件。可以是 React Component 或 render 函数。 | component`, `function | No | All | yes |
-| `ListFooterComponent` | 尾部组件。可以是 React Component 或 render 函数。 | component`, `function | No | All | yes |
-| `ListEmptyComponent` | 列表为空时渲染该组件。可以是 React Component 或 render 函数 | component`, `function | No | All | yes |
-| `onEndReached` | 当列表滚动到底部是调用 | function | No | All | yes |
-| `onRefresh` | 如果设置了此选项,则会在列表头部添加一个标准的[`RefreshControl`](https://www.react-native.cn/docs/refreshcontrol) 控件,以便实现“下拉刷新”的功能。同时你需要正确设置`refreshing`属性。 | function | No | All | yes |
-| `refreshing` | 在等待加载新数据时将此属性设为 true,列表就会显示出一个正在加载的符号。 | boolean | No | All | yes |
-| `style` | 用于设置瀑布流外层样式,默认会有`{ flex: 1 }`的样式,即高度充满父容器 | object | No | All | yes |
-| `contentContainerStyle` | 瀑布流内容容器样式 | object | No | 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 |
+| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | -------- | -------- | ----------------- |
+| `renderItem` | 用于将当前`item`渲染到列表中 | function | Yes | All | yes |
+| `data` | 瀑布流数据源,可以是任意内容的数组 | array | Yes | All | yes |
+| `numColumns` | 瀑布流的列数,默认为 2,即两列 | number | No | All | yes |
+| `ListHeaderComponent` | 头部组件。可以是 React Component 或 render 函数。 | component`, `function | No | All | yes |
+| `ListFooterComponent` | 尾部组件。可以是 React Component 或 render 函数。 | component`, `function | No | All | yes |
+| `ListEmptyComponent` | 列表为空时渲染该组件。可以是 React Component 或 render 函数 | component`, `function | No | All | yes |
+| `onEndReached` | 当列表滚动到底部是调用 | function | No | All | yes |
+| `onRefresh` | 如果设置了此选项,则会在列表头部添加一个标准的[`RefreshControl`](https://www.react-native.cn/docs/refreshcontrol) 控件,以便实现“下拉刷新”的功能。同时你需要正确设置`refreshing`属性。 | function | No | All | yes |
+| `refreshing` | 在等待加载新数据时将此属性设为 true,列表就会显示出一个正在加载的符号。 | boolean | No | All | yes |
+| `style` | 用于设置瀑布流外层样式,默认会有`{ flex: 1 }`的样式,即高度充满父容器 | object | No | All | yes |
+| `contentContainerStyle` | 瀑布流内容容器样式 | object | No | All | yes |
-> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
+## Static Methods
-> [!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 |
-| -------------------------- | ------------------------------------------------------------ | ------ | -------- | -------- | ----------------- |
-| `scrollToEnd([params])` | 滚动到瀑布流列表的底部 | object | No | All | yes |
-| `scrollToIndex([params])` | 将位于指定位置的元素滚动到可视区的指定位置,当viewPosition 为 0 时将它滚动到屏幕顶部,为 1 时将它滚动到屏幕底部,为 0.5 时将它滚动到屏幕中央。 | object | Yes | All | yes |
-| `scrollToOffset([params])` | 滚动列表到指定的偏移(以像素为单位),等同于ScrollView的scrollTo方法。 | object | 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 |
+| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- | -------- | ----------------- |
+| `scrollToEnd([params])` | 滚动到瀑布流列表的底部 | object | No | All | yes |
+| `scrollToIndex([params])` | 将位于指定位置的元素滚动到可视区的指定位置,当 viewPosition 为 0 时将它滚动到屏幕顶部,为 1 时将它滚动到屏幕底部,为 0.5 时将它滚动到屏幕中央。 | object | Yes | All | yes |
+| `scrollToOffset([params])` | 滚动列表到指定的偏移(以像素为单位),等同于 ScrollView 的 scrollTo 方法。 | object | Yes | All | yes |
- 无
+## Known Issues
-## 其他
+## Others
-## 开源协议
+## License
-本项目基于 [The MIT License (MIT)](https://github.com/axerjs/react-native-waterfall-flow/blob/HEAD/LICENSE) ,请自由地享受和参与开源。
+This project is licensed under [The MIT License (MIT)](https://github.com/axerjs/react-native-waterfall-flow/blob/HEAD/LICENSE).
-
\ No newline at end of file
+
--
Gitee