Skip to content

feat:提交react-native-vector-drawable代码 #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions .github/workflows/deployment.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/workflows/repolint.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .gitignore

This file was deleted.

9 changes: 0 additions & 9 deletions .npmignore

This file was deleted.

5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

78 changes: 0 additions & 78 deletions CHANGELOG.md

This file was deleted.

82 changes: 10 additions & 72 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,19 @@
# react-native-vector-drawable
# @react-native-oh-tpl/react-native-vector-drawable

> Android vector drawables in React Native.
本项目基于 [react-native-vector-drawable (react-native-vector-drawable)](https://github.com/klarna-incubator/react-native-vector-drawable)

[![Build Status][ci-image]][ci-url]
[![License][license-image]][license-url]
[![Developed at Klarna][klarna-image]][klarna-url]
## 文档地址 / Documentation URL

An alternative to `react-native-svg` with 5x faster renders, lighter bundle and built in dark mode support.
[中文 / Chinese](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-vector-drawable.md)

## Installation
[英文 / English](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-en/react-native-vector-drawable.md)

```sh
yarn add @klarna/react-native-vector-drawable
```
## Codegen

<!-- Taken from https://github.com/software-mansion/react-native-screens/blob/main/README-Fabric.md -->
该库已接入 codegen,具体请查阅文档。

### Fabric installation
The library has been integrated with codegen. Please refer to the documentation for details.

This library supports React Native New Architecture (aka Fabric). To use this library with your Fabric application, you have to:
## 请悉知 / Acknowledgements

1. Add latest `@klarna/react-native-vector-drawable`
2. on iOS:
- Install pods using `RCT_NEW_ARCH_ENABLED=1 pod install` – this is the same command you run to prepare a Fabric build but you also need to run it after a new native library gets added.
3. on Android:
- There are no additional steps required so long you app is configured to build with Fabric – this is typically configured by setting `newArchEnabled=true` in `gradle.properties` file in your project.

## Usage

```js
import VectorDrawable from '@klarna/react-native-vector-drawable';

const Component = () => (
<VectorDrawable
resourceName="ic_drawable_name"
style={{ width: 50, height: 50, tintColor: 'blue' }}
/>
);
```

### Props

| Prop | Description | Default |
| ------------------ | -------------------------------------------------------- | ------- |
| **`resourceName`** | Name of the Android vector drawable resource. | _None_ |
| **`style`** | See _Style props_. Note: border props are not supported. | _None_ |

#### Style props

| Prop | Description | Default |
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| **`resizeMode`** | Determines how to resize the image when the frame doesn't match the raw image dimensions. Possible values are `cover`, `contain`, `stretch` and `center` | `cover` |
| **`tintColor`** | Changes the color of all the non-transparent pixels to the tintColor. | _None_ |

## How to contribute

See our guide on [contributing](.github/CONTRIBUTING.md).

## Release History

See our [changelog](CHANGELOG.md).

## Deployment

Update version in `package.json` and merge to master. This will publish the package to NPM, create a draft release on GitHub and a version tag. Edit the release with additional information and publish it.

## License

Copyright © 2022 Klarna Bank AB

For license details, see the [LICENSE](LICENSE) file in the root of this project.

<!-- Markdown link & img dfn's -->

[ci-image]: https://img.shields.io/badge/build-passing-brightgreen?style=flat-square
[ci-url]: https://github.com/klarna-incubator/react-native-vector-drawable/actions/
[license-image]: https://img.shields.io/badge/license-Apache%202-blue?style=flat-square
[license-url]: http://www.apache.org/licenses/LICENSE-2.0
[klarna-image]: https://img.shields.io/badge/%20-Developed%20at%20Klarna-black?labelColor=ffb3c7&style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAYAAAAmL5yKAAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABA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BDRyBfygf6RW2/gD3NmEv+K/DZgAAAABJRU5ErkJggg==
[klarna-url]: https://klarna.github.io
本项目基于 MIT License ([react-native-vector-drawable](https://github.com/klarna-incubator/react-native-vector-drawable/blob/master/LICENSE)) ,请自由地享受和参与开源。
10 changes: 0 additions & 10 deletions android/.npmignore

This file was deleted.

56 changes: 0 additions & 56 deletions android/build.gradle

This file was deleted.

5 changes: 0 additions & 5 deletions android/src/main/AndroidManifest.xml

This file was deleted.

Loading