From c7e00e84a40e7e838e5f924b42652d951826787b Mon Sep 17 00:00:00 2001
From: 17382561546 <2106377850@qq.com>
Date: Mon, 27 May 2024 17:10:55 +0800
Subject: [PATCH 1/3] =?UTF-8?q?docs:=20[Issues:=20#I9OQ2G]=20=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0react-native-toast.md=E6=8C=87=E5=AF=BC=E6=96=87?=
=?UTF-8?q?=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
zh-cn/react-native-toast.md | 222 ++++++++++++++++++++++++++++++++++++
1 file changed, 222 insertions(+)
create mode 100644 zh-cn/react-native-toast.md
diff --git a/zh-cn/react-native-toast.md b/zh-cn/react-native-toast.md
new file mode 100644
index 00000000..e22dfa7a
--- /dev/null
+++ b/zh-cn/react-native-toast.md
@@ -0,0 +1,222 @@
+模板版本:v0.2.1
+
+
+
react-native-toast
+
+
+
+
+
+
+
+
+
+
+
+> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-toast)
+
+
+## 安装与使用
+
+请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-toast Releases](https://github.com/react-native-oh-library/react-native-toast/releases),并下载适用版本的 tgz 包。
+
+进入到工程目录并输入以下命令:
+
+> [!TIP] # 处替换为 tgz 包的路径
+
+
+
+#### **npm**
+
+```bash
+npm install @react-native-oh-tpl/react-native-toast@file:#
+```
+
+#### **yarn**
+
+```bash
+yarn add @react-native-oh-tpl/react-native-toast@file:#
+```
+
+
+
+下面的代码展示了这个库的基本使用场景:
+
+> [!WARNING] 使用时 import 的库名不变。
+
+```js
+import React, { Component } from 'react';
+import { Text, View, Button } from 'react-native';
+import Toast from 'react-native-toast';
+
+function ToastMasterDemo(){
+ return (
+
+ Tosat !
+
+ );
+}
+
+export default ToastMasterDemo;
+
+```
+
+## Link
+
+目前鸿蒙暂不支持 AutoLink,所以 Link 步骤需要手动配置。
+
+首先需要使用 DevEco Studio 打开项目里的鸿蒙工程 `harmony`
+
+### 在工程根目录的 `oh-package.json` 添加 overrides字段
+
+```json
+{
+ ...
+ "overrides": {
+ "@rnoh/react-native-openharmony" : "./react_native_openharmony"
+ }
+}
+
+```
+
+### 引入原生端代码
+
+目前有两种方法:
+
+1. 通过 har 包引入(在 IDE 完善相关功能后该方法会被遗弃,目前首选此方法);
+2. 直接链接源码。
+
+方法一:通过 har 包引入(推荐)
+
+> [!TIP] har 包位于三方库安装路径的 `harmony` 文件夹下。
+
+打开 `entry/oh-package.json5`,添加以下依赖
+
+```json
+"dependencies": {
+ "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
+ "@react-native-oh-tpl/react-native-toast": "file:../../node_modules/@react-native-oh-tpl/react-native-toast/harmony/rn_toast.har"
+ }
+
+```
+
+点击右上角的 `sync` 按钮
+
+或者在终端执行:
+
+```bash
+cd entry
+ohpm install
+
+```
+
+方法二:直接链接源码
+
+> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
+
+### 在 ArkTs 侧引入 xxx Package
+
+打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
+
+```diff
+...
++ import {SafeAreaViewPackage} from '@react-native-oh-tpl/react-native-toast/ts';
+
+export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
+ return [
+ new SamplePackage(ctx),
++ new ToastPackage(ctx)
+ ];
+}
+```
+
+### 运行
+
+点击右上角的 `sync` 按钮
+
+或者在终端执行:
+
+```bash
+cd entry
+ohpm install
+
+```
+
+然后编译、运行即可。
+
+## 约束与限制
+
+### 兼容性
+
+要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。
+
+请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-toast Releases](https://github.com/react-native-oh-library/react-native-toast/releases)
+
+## API(TurboModules)
+
+> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
+
+> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ---- | ----------- | ---- | -------- | -------- | ------------------ |
+| show() | Displays the location of the toast, its duration, the content of the message | function | (yes) | ios | (yes) |
+| hide() | Hide the toast that is being displayed | function | (yes) | android | (no) |
+
+## 遗留问题
+
+- atkui侧的toast的hide()方法暂时没有[issue#4](https://github.com/react-native-oh-library/react-native-toast/issues/4)
+
+## 其他
+
+## 开源协议
+
+本项目基于 [The MIT License MIT](https://github.com/react-native-oh-library/react-native-toast/blob/dev-sig/LICENSE),请自由地享受和参与开源。
--
Gitee
From 51653aba377e4596a37e521ee4bc4e0cad7e6a73 Mon Sep 17 00:00:00 2001
From: 17382561546 <2106377850@qq.com>
Date: Mon, 27 May 2024 17:48:41 +0800
Subject: [PATCH 2/3] =?UTF-8?q?docs:=20[Issues:=20#I9OQ2G]=20=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0react-native-toast.md=E6=8C=87=E5=AF=BC=E6=96=87?=
=?UTF-8?q?=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.idea/.name | 1 +
zh-cn/react-native-toast.md | 14 +++++++++-----
2 files changed, 10 insertions(+), 5 deletions(-)
create mode 100644 .idea/.name
diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 00000000..0908640e
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+react-native-toast.md
\ No newline at end of file
diff --git a/zh-cn/react-native-toast.md b/zh-cn/react-native-toast.md
index e22dfa7a..1f222bb1 100644
--- a/zh-cn/react-native-toast.md
+++ b/zh-cn/react-native-toast.md
@@ -162,13 +162,13 @@ ohpm install
> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
-### 在 ArkTs 侧引入 xxx Package
+### 在 ArkTs 侧引入 ToastPackage
打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
```diff
...
-+ import {SafeAreaViewPackage} from '@react-native-oh-tpl/react-native-toast/ts';
++ import {ToastPackage} from '@react-native-oh-tpl/react-native-toast/ts';
export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
return [
@@ -200,6 +200,10 @@ ohpm install
请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-toast Releases](https://github.com/react-native-oh-library/react-native-toast/releases)
+本文档内容基于以下版本验证通过:
+
+1.RNOH:0.72.23; SDK:HarmonyOS NEXT Developer Beta1; IDE:DevEco Studio 5.0.3.228; ROM:3.0.0.19
+
## API(TurboModules)
> [!tip] "Platform"列表示该属性在原三方库上支持的平台。
@@ -208,8 +212,8 @@ ohpm install
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
-| show() | Displays the location of the toast, its duration, the content of the message | function | (yes) | ios | (yes) |
-| hide() | Hide the toast that is being displayed | function | (yes) | android | (no) |
+| show() | Displays the location of the toast, its duration, the content of the message | function | yes | ios | yes |
+| hide() | Hide the toast that is being displayed | function | yes | android | no |
## 遗留问题
@@ -219,4 +223,4 @@ ohpm install
## 开源协议
-本项目基于 [The MIT License MIT](https://github.com/react-native-oh-library/react-native-toast/blob/dev-sig/LICENSE),请自由地享受和参与开源。
+本项目基于 [The MIT License](https://github.com/remobile/react-native-toast/blob/master/LICENSE),请自由地享受和参与开源。
--
Gitee
From 0a8d58aad52cb90bc1d53d6783e22d704e4f854a Mon Sep 17 00:00:00 2001
From: liangzhenhua <2106377850@qq.com>
Date: Mon, 3 Jun 2024 07:52:03 +0000
Subject: [PATCH 3/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20.ide?=
=?UTF-8?q?a/.name?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.idea/.name | 1 -
1 file changed, 1 deletion(-)
delete mode 100644 .idea/.name
diff --git a/.idea/.name b/.idea/.name
deleted file mode 100644
index 0908640e..00000000
--- a/.idea/.name
+++ /dev/null
@@ -1 +0,0 @@
-react-native-toast.md
\ No newline at end of file
--
Gitee