From 598ec47dc8738cb728b97ed994370662face04a9 Mon Sep 17 00:00:00 2001 From: Mrliwang Date: Wed, 18 Dec 2024 14:35:12 +0800 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20=E4=BA=94=E9=A1=B9=E6=A0=B8?= =?UTF-8?q?=E6=9F=A5=E6=95=B4=E6=94=B9=EF=BC=8C=E4=BF=AE=E6=94=B9readme?= =?UTF-8?q?=E6=96=87=E4=BB=B6=20(#3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 79 +++++-------------------------------------------------- 1 file changed, 7 insertions(+), 72 deletions(-) diff --git a/README.md b/README.md index efec1a4..0303a77 100644 --- a/README.md +++ b/README.md @@ -1,78 +1,13 @@ -# react-native-view-overflow +# @react-native-oh-tpl/react-native-view-overflow -## React Native Version Notice +This project is based on [react-native-view-overflow](https://github.com/entria/react-native-view-overflow) -This library will be useful for React Native versions below v0.57. For v0.57 and beyond, React Native supports Android overflow natively from [this commit](https://github.com/facebook/react-native/commit/b81c8b51fc6fe3c2dece72e3fe500e175613c5d4). +## Documentation -## Motivation +- [中文](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-view-overflow.md) -The problem is that a parent View in Android will clip the content of children Views (react-native) +- [English](https://gitee.com/react-native-oh-library/usage-docs/blob/master/en/react-native-view-overflow.md) -This solves the problem of Overflow on Android (check this https://github.com/facebook/react-native/issues/16951) +## License -This could make code simpler, so you don't need to move some Components outside parents to make layout work - -You can read more about the motivation and this package here https://medium.com/@sibelius/solving-view-overflow-in-android-reactnative-f961752a75cd - -## Getting started -### Steps to (mostly) automatically install react-native-view-overflow -#### If you are using react-native >=0.60.0 - -`$ npm install react-native-view-overflow --save` - -#### Otherwise, if you are using react-native <0.60.0 - -`$ npm install react-native-view-overflow --save` - -`$ react-native link react-native-view-overflow` - -## Usage -```javascript -import ViewOverflow from 'react-native-view-overflow'; - - - - - -``` - -## Usage with Flatlist -To make this work with FlatList and related components you need to replace `CellRendererComponent` with `ViewOverflow`, for example: - -```jsx - item.id} - CellRendererComponent={ViewOverflow} - renderItem={({ item, index }) => ( - - // item.... - - )} -/> -``` - -## Usage with Animated Views -To make this work in place of an `Animated.View`, you need to use `Animated.createAnimatedComponent` to create an animatable version of `ViewOverflow`. For example: - -``` -import ViewOverflow from 'react-native-view-overflow'; -const AnimatedViewOverflow = Animated.createAnimatedComponent(ViewOverflow); -``` - -You can then use `AnimatedViewOverflow` in place of `Animated.View`. - -### Manual installation - -1. Open up `android/app/src/main/java/[...]/MainApplication.java` - - Add `import com.entria.views.RNViewOverflowPackage;` to the imports at the top of the file - - Add `new RNViewOverflowPackage()` to the list returned by the `getPackages()` method -2. Append the following lines to `android/settings.gradle`: - ``` - include ':react-native-view-overflow' - project(':react-native-view-overflow').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-view-overflow/android') - ``` -3. Insert the following lines inside the dependencies block in `android/app/build.gradle`: - ``` - compile project(':react-native-view-overflow') - ``` +This library is licensed under [The MIT License (MIT)](https://github.com/entria/react-native-view-overflow/blob/master/LICENSE) From 43ec0a6e0b5827d4c14679d81bb6cd2546a9f53a Mon Sep 17 00:00:00 2001 From: Mrliwang Date: Wed, 18 Dec 2024 14:39:56 +0800 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20=E4=BA=94=E9=A1=B9=E6=A0=B8?= =?UTF-8?q?=E6=9F=A5=E6=95=B4=E6=94=B9=20(#4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- COMMITTERS.md | 11 ++++++++ OAT.xml | 53 +++++++++++++++++++++++++++++++++++++ README.OpenSource | 11 ++++++++ src/ViewOverflow.harmony.js | 6 +++++ 4 files changed, 81 insertions(+) create mode 100644 COMMITTERS.md create mode 100644 OAT.xml create mode 100644 README.OpenSource diff --git a/COMMITTERS.md b/COMMITTERS.md new file mode 100644 index 0000000..aef6509 --- /dev/null +++ b/COMMITTERS.md @@ -0,0 +1,11 @@ +## Committers列表 + +### 以下是此项目的committer人员 + +不区分先后顺序 + +- [MaDiXin](https://gitee.com/MaDiXin) +- [xiafeng_xf_admin](https://gitee.com/xiafeng_xf_admin) +- [ChenLixi](https://gitee.com/Louis-C7) +- [LinJiacheng](https://gitee.com/LLLLLLin) +- [ZhengJinshou](https://gitee.com/longziz) \ No newline at end of file diff --git a/OAT.xml b/OAT.xml new file mode 100644 index 0000000..697b10b --- /dev/null +++ b/OAT.xml @@ -0,0 +1,53 @@ + + + + LICENSE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/README.OpenSource b/README.OpenSource new file mode 100644 index 0000000..5d7f669 --- /dev/null +++ b/README.OpenSource @@ -0,0 +1,11 @@ +[ + { + "Name": "react-native-view-overflow", + "License": "MIT License", + "License File": "https://github.com/entria/react-native-view-overflow/blob/master/LICENSE", + "Version Number": "0.0.5", + "Owner" : "xiafeng@huawei.com", + "Upstream URL": "https://github.com/entria/react-native-view-overflow", + "Description": "Fix Overflow in react-native for Android" + } +] \ No newline at end of file diff --git a/src/ViewOverflow.harmony.js b/src/ViewOverflow.harmony.js index 23eb80d..efdf382 100644 --- a/src/ViewOverflow.harmony.js +++ b/src/ViewOverflow.harmony.js @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved + * Use of this source code is governed by a MIT license that can be + * found in the LICENSE file. + */ + // @flow import * as React from 'react'; import {View} from 'react-native';