From 625cf1dd57de0a8cea11a8012d90362ba8a33546 Mon Sep 17 00:00:00 2001 From: lizhien52O Date: Wed, 6 Nov 2024 16:08:46 +0800 Subject: [PATCH 1/5] docs: [Issues: #IB117J] react-native-size-matters.md --- en/react-native-size-matters.md | 96 +++++++++++++++++---------------- 1 file changed, 51 insertions(+), 45 deletions(-) diff --git a/en/react-native-size-matters.md b/en/react-native-size-matters.md index a06f9360..9573d8bb 100644 --- a/en/react-native-size-matters.md +++ b/en/react-native-size-matters.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-size-matters

@@ -12,11 +12,11 @@

-> [!TIP] [Github 地址](https://github.com/nirsky/react-native-size-matters) +> [!TIP] [GitHub address](https://github.com/nirsky/react-native-size-matters) -## 安装与使用 +## Installation and Usage -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -25,24 +25,25 @@ ```bash npm install react-native-size-matters@0.4.2 ``` + #### **yarn** ```bash yarn add react-native-size-matters@0.4.2 ``` + -下面的代码展示了这个库的基本使用场景: -> [!WARNING] 使用时 import 的库名不变。 +The following code shows the basic use scenario of the repository: + +> [!WARNING] The name of the imported repository remains unchanged. **这里是该插件提供的基础用法** ```js - import { Text, View } from 'react-native'; import { scale, verticalScale, moderateScale, moderateVerticalScale } from 'react-native-size-matters'; - import { s, vs, ms, mvs } from 'react-native-size-matters'; let scale = () =>{ @@ -55,7 +56,7 @@ let scale = () =>{ borderColor: 'red', backgroundColor: 'blue' }} > - {scale(100} + {scale(100)} ) } @@ -70,7 +71,7 @@ let verticalScale = () =>{ borderColor: 'red', backgroundColor: 'blue' }} > - {verticalScale(100} + {verticalScale(100)} ) } @@ -101,7 +102,7 @@ let moderateVerticalScale = ()=>{ borderColor: 'red', backgroundColor: 'blue' }} > - {moderateVerticalScale(100} + {moderateVerticalScale(100)} ) } @@ -116,7 +117,7 @@ let s = () =>{ borderColor: 'red', backgroundColor: 'blue' }} > - {s(100} + {s(100)} ) } @@ -131,7 +132,7 @@ let vs = () =>{ borderColor: 'red', backgroundColor: 'blue' }} > - {vs(100} + {vs(100)} ) } @@ -162,7 +163,7 @@ let mvs = ()=>{ borderColor: 'red', backgroundColor: 'blue' }} > - {mvs(100} + {mvs(100)} ) } @@ -185,60 +186,65 @@ export default class sizeMattersDemo { } ``` + **这里提供注解用法** + ```javascript -import { Text, View } from 'react-native'; -import { ScaledSheet } from 'react-native-size-matters'; +import { Text, View } from "react-native"; +import { ScaledSheet } from "react-native-size-matters"; const styles = ScaledSheet.create({ - container: { - width: '100@s', // = scale(100) - height: '200@vs', // = verticalScale(200) - padding: '2@msr', // = Math.round(moderateScale(2)) - margin: 5 - } + container: { + width: "100@s", // = scale(100) + height: "200@vs", // = verticalScale(200) + padding: "2@msr", // = Math.round(moderateScale(2)) + margin: 5, + }, }); export default class sizeMattersDemo { render() { return ( - - 调用create方法 - + + create + ); } } ``` - [!TIP] 这里展示[自定义默认尺寸](https://github.com/nirsky/react-native-size-matters/blob/master/examples/change-guideline-sizes.md) -## 约束与限制 -### 兼容性 -本文档内容基于以下版本验证通过: +[!TIP] Here is displayed[Custom Default Size](https://github.com/nirsky/react-native-size-matters/blob/master/examples/change-guideline-sizes.md) + +## Constraints + +### Compatibility + +This document is verified based on the following versions: 1. RNOH:0.72.27; SDK:HarmonyOS-Next-DB1 5.0.0.29(SP1); IDE:DevEco Studio 5.0.3.400; ROM:3.0.0.25; 2. RNOH:0.72.33; SDK:OpenHarmony 5.0.0.71(API Version 12 Release); IDE:DevEco Studio 5.0.3.900; ROM:NEXT.0.0.71; ## API -> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。 +> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. -| Name | Description | Type | Required | Platform | HarmonyOS Support | -| ---------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------- | -------- | ----------- | -------- | -| scale | 将根据您设备的屏幕宽度返回所提供尺寸的线性缩放结果。 | Function | No | Android、iOS | Yes | -| verticalScale | 将根据您设备的屏幕高度返回所提供尺寸的线性缩放结果。 | Function | No | Android、iOS | Yes | -| moderateScale | 有时您不想以线性方式缩放所有内容,这时可以使用 moderateScale。它的妙处在于您可以控制调整大小的因子(默认值为 0.5)。如果正常缩放会将您的尺寸增加 +2X,则 moderateScale 只会将其增加 +X | Function | No | Android、iOS | Yes | -| moderateVerticalScale | 与 moderateScale 相同,但使用 verticalScale 而不是 scale。 | Function | No | Android、iOS | Yes | -| s | scale方法的别名 | Function | No | Android、iOS | Yes | -| vs | verticalScale方法的别名 | Function | No | Android、iOS | Yes | -| ms | moderateScale别名方法 | Function | No | Android、iOS | Yes | -| mvs | moderateVerticalScale的别名方法 | Function | No | Android、iOS | Yes | +| Name | Description | Type | Required | Platform | HarmonyOS Support | +| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | ------------ | ----------------- | +| scale | 将根据您设备的屏幕宽度返回所提供尺寸的线性缩放结果。 | Function | No | Android、iOS | Yes | +| verticalScale | 将根据您设备的屏幕高度返回所提供尺寸的线性缩放结果。 | Function | No | Android、iOS | Yes | +| moderateScale | 有时您不想以线性方式缩放所有内容,这时可以使用 moderateScale。它的妙处在于您可以控制调整大小的因子(默认值为 0.5)。如果正常缩放会将您的尺寸增加 +2X,则 moderateScale 只会将其增加 +X | Function | No | Android、iOS | Yes | +| moderateVerticalScale | 与 moderateScale 相同,但使用 verticalScale 而不是 scale。 | Function | No | Android、iOS | Yes | +| s | scale 方法的别名 | Function | No | Android、iOS | Yes | +| vs | verticalScale 方法的别名 | Function | No | Android、iOS | Yes | +| ms | moderateScale 别名方法 | Function | No | Android、iOS | Yes | +| mvs | moderateVerticalScale 的别名方法 | Function | No | Android、iOS | Yes | -## 遗留问题 +## Known Issues -## 其他 +## Others -## 开源协议 +## License -本项目基于 [The MIT License(MIT)](https://github.com/nirsky/react-native-size-matters/blob/master/LICENSE) ,请自由地享受和参与开源。 +This project is licensed under [The MIT License(MIT)](https://github.com/nirsky/react-native-size-matters/blob/master/LICENSE). -- Gitee From 7a23710c2a773a0e6accdd712397b8a8ae7fab30 Mon Sep 17 00:00:00 2001 From: lizhien52O Date: Wed, 6 Nov 2024 16:09:01 +0800 Subject: [PATCH 2/5] docs: [Issues: #IB117J] react-native-root-toast.md --- en/react-native-root-toast.md | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/en/react-native-root-toast.md b/en/react-native-root-toast.md index f9f57bc5..2885b23f 100644 --- a/en/react-native-root-toast.md +++ b/en/react-native-root-toast.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-root-toast

@@ -13,11 +13,11 @@

-> [!TIP] [Github 地址](https://github.com/magicismight/react-native-root-toast) +> [!TIP] [GitHub address](https://github.com/magicismight/react-native-root-toast) -## 安装与使用 +## Installation and Usage -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -35,7 +35,7 @@ yarn add react-native-root-toast@3.5.1 -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: ```js import React, { useState } from "react"; @@ -55,7 +55,7 @@ import Toast from "react-native-root-toast"; export function ReactNativeRootToastExample() { let PToast: any = null; function startPToast() { - PToast = Toast.show("超长待机弹窗实例", { + PToast = Toast.show("Ultra Long standby pop-up instance", { duration: 99999999, position: 20, shadow: true, @@ -74,27 +74,27 @@ export function ReactNativeRootToastExample() { } return ( -