From 1d9b1b8c3aa2e447c6280460f8d728bd5eac1e0d Mon Sep 17 00:00:00 2001 From: xiong Date: Mon, 29 Jan 2024 15:05:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[Issues:=20#I8ZMRU]=20=E6=B7=BB=E5=8A=A0rea?= =?UTF-8?q?ct-native-transitiongroup=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1224/react-native-transtiongroup.md | 184 ++++++++++++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 1224/react-native-transtiongroup.md diff --git a/1224/react-native-transtiongroup.md b/1224/react-native-transtiongroup.md new file mode 100644 index 00000000..a53f2b67 --- /dev/null +++ b/1224/react-native-transtiongroup.md @@ -0,0 +1,184 @@ +> 模板版本:v0.1.2 + +

+

react-native-transtiongroup

+

+

+ + Supported platforms + +

+ + +> [!tip] [Github 地址](https://github.com/imchintan/react-native-transtiongroup) + +## 安装与使用 + +进入到工程目录并输入以下命令: + + + +#### **yarn** + +```bash +yarn add @react-native-oh-tpl/react-native-transtiongroup +``` + +#### **npm** + +```bash +npm install @react-native-oh-tpl/react-native-transtiongroup +``` + + + +下面的代码展示了这个库的基本使用场景: + +```js +import React, { useState } from 'react'; +import { + StyleSheet, + Text, + View, + TouchableOpacity, + Easing +} from 'react-native'; +import TransitionGroup, { FadeInOutTransition } from 'react-native-transitiongroup'; + + +export function TransitiongroupExample() { + const [showText, setShowText] = useState(false); + + const handleToggle = () => { + setShowText(!showText); + }; + + return ( + + + + {showText ? 'Hide' : 'Show'} + + + + {showText && ( + + Hello, Transition Group!! + + )} + + + + {showText && ( + + I'm Later + + )} + + + + {showText && ( + + I'm Pink + + )} + + + + ); +} + +const styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + }, + relativeContainer: { + position: 'relative', + }, + button: { + backgroundColor: '#3f51b5', + padding: 10, + borderRadius: 5, + marginBottom: 20, + }, + buttonText: { + color: '#fff', + fontWeight: 'bold', + fontSize: 16, + }, + absoluteContainer: { + position: 'absolute', + bottom: -50, + left: -100, + }, + absoluteContainerTwo: { + position: 'absolute', + bottom: -150, + left: -100, + }, + absoluteContainerThree: { + position: 'absolute', + bottom: -250, + left: -100, + }, + text: { + fontSize: 24, + fontWeight: 'bold', + }, +}); + +``` + +## 约束与限制 + +## 兼容性 + +在下述版本验证通过: + +IDE: Deveco Studio 4.1.3.500; + +SDK: HarmonyOS NEXT Developer Preview1; + +测试设备: Mate60 (BRA-AL00); + +ROM: 204.1.0.59(SP2DEVC00E60R4P1) ; + +RNOH: 0.72.12; + +## API + +> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 + +> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> +> 详情见 [react-native-transtiongroup 源库地址](https://github.com/imchintan/react-native-transtiongroup/blob/master/README.md) + +| 名称 | 描述 | 参数类型 | 是否必填 | Platform | HarmonyOS Support | +| ------------- | ---------------------------------- | -------- | -------- | -------- | ----------------- | +| easing | 缓动函数 | func | yes | All | yes | +| inDelay | 组件加载时开始动画前的延迟时间(毫秒) | number | yes | All | yes | +| inDuration | 组件加载时动画的持续时间(毫秒) | number | yes | All | yes | +| outDelay | 组件销毁时开始动画前的延迟时间(毫秒) | number | yes | All | yes | +| outDuration | 组件销毁时动画的持续时间(毫秒) | number | yes | All | yes | +| pointerEvents | 控制View是否可以成为触摸事件的目标 | string | yes | All | yes | +| style | 组件样式 | style | yes | All | yes | + +## 遗留问题 + +原库使用refs方法,现在改为使用react.createRef方法代替。 +原库中使用的ViewPropTypes,现在改为使用PropTypes方法代替。 + +## 其他 + +## 开源协议 + +本项目基于 [The MIT License (MIT)](https://github.com/imchintan/react-native-transtiongroup/blob/master/package.json) ,请自由地享受和参与开源。 \ No newline at end of file -- Gitee From 33816f054cb7dc16147856d0f5a42c97209384b2 Mon Sep 17 00:00:00 2001 From: wangyizhou Date: Tue, 30 Jan 2024 09:32:41 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[Issues:=20#I8ZMRU]=20=E6=B7=BB=E5=8A=A0rea?= =?UTF-8?q?ct-native-transitiongroup=E6=8C=87=E5=AF=BC=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1224/react-native-transtiongroup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1224/react-native-transtiongroup.md b/1224/react-native-transtiongroup.md index a53f2b67..c0676872 100644 --- a/1224/react-native-transtiongroup.md +++ b/1224/react-native-transtiongroup.md @@ -10,7 +10,7 @@

-> [!tip] [Github 地址](https://github.com/imchintan/react-native-transtiongroup) +> [!tip] [Github 地址](https://github.com/react-native-oh-library/react-native-transitiongroup) ## 安装与使用 -- Gitee