diff --git a/README.md b/README.md index c72492f62ffcb21802ab1c0f23c7d8305b0e8efc..fc97bd46a10ff32ea521bce629181727e1c6c02d 100644 --- a/README.md +++ b/README.md @@ -1,74 +1,14 @@ -# react-native-image-sequence-2 -Based on [react-native-image-sequence](https://github.com/madsleejensen/react-native-image-sequence) with various bugs fixed. +# @react-native-ohos/react-native-image-sequence -native modules for handling image sequence animations. (created because i had performance issues with a javascript only solution like: https://github.com/remobile/react-native-image-animation) +This project is based on [react-native-image-sequence](https://github.com/madsleejensen/react-native-image-sequence) -its a simple wrapper around **iOS** `UIImageView.animationImages` and **Android** `AnimationDrawable` +## Documentation -## Installation +[中文](https://gitee.com/react-native-oh-library/usage-docs/tree/master/zh-cn/react-native-image-sequence-2.md) -1. `npm i --save react-native-image-sequence-2` -2. `cd ios && pod install` +[English](https://gitee.com/react-native-oh-library/usage-docs/tree/master/en/react-native-image-sequence-2.md) -## Examples +## License -```javascript -import ImageSequence from 'react-native-image-sequence-2'; - -const images = [ - require('1.jpg'), - require('2.jpg'), - require('3.jpg'), - require('4.jpg'), - require('5.jpg'), -]; - -const centerIndex = Math.round(images.length / 2); - - -``` - -### Change animation speed -You can change the speed of the animation by setting the `framesPerSecond` property. - -```javascript - -``` - -### Looping -You can change if animation loops indefinitely by setting the `loop` property. - -```javascript - -``` - -### Downsampling -Loading and using an image with a higher resolution than the size of the image display area does not provide any visible benefit, but still takes up precious memory and incurs additional performance overhead due to additional on the fly scaling. So choosing to downsample an image before rendering saves memory and CPU time during the rendering process, but costs more CPU time during the image loading process. - -You can set the images to be downsampled by setting both the `downsampleWidth` and `downsampleHeight` properties. Both properties must be set to positive numbers to enable downsampling. - -```javascript - -``` - -IMPORTANT: The final image width and height will not necessarily match `downsampleWidth` and `downsampleHeight` but will just be a target for the per-platform logic on how to downsample. - -On Android, the logic for how to downsample is taken from [here](https://developer.android.com/topic/performance/graphics/load-bitmap). The image's aspect ratio will stay consistent after downsampling. - -On iOS, the max value of `downsampleWidth` and `downsampleHeight` will be used as the max pixel count for both dimensions in the final image. The image's aspect ratio will stay consistent after downsampling. +This library is licensed under [The MIT License (MIT)](https://gitee.com/openharmony-sig/rntpc_react-native-image-sequence/blob/master/LICENSE). diff --git a/harmony/image_sequence.har b/harmony/image_sequence.har new file mode 100644 index 0000000000000000000000000000000000000000..1843eb16586cd88f74d077295730c969c2ffbb46 Binary files /dev/null and b/harmony/image_sequence.har differ diff --git a/harmony/image_sequence/oh-package.json5 b/harmony/image_sequence/oh-package.json5 index b8152713407b61e19159331bfbde3c8c8e817763..57221333274d879c07cd31a0b89f73921bf64659 100644 --- a/harmony/image_sequence/oh-package.json5 +++ b/harmony/image_sequence/oh-package.json5 @@ -1,6 +1,6 @@ { "name": "@react-native-ohos/react-native-image-sequence-2", - "version": "0.9.2-rc1", + "version": "0.9.2-rc.1", "description": "Please describe the basic information.", "main": "Index.ets", "author": "", diff --git a/package.json b/package.json index 59bf83b8be3304b18695880f1595921abe44f773..cbdfbaea86645de0849eff4ed3b4265cc2b2897b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@react-native-ohos/react-native-image-sequence-2", - "version": "0.9.2-rc1", + "version": "0.9.2-rc.1", "description": "Showcase a Fabric component with a image sequence", "react-native": "index", "source": "index", @@ -45,6 +45,10 @@ "alias": "react-native-image-sequence-2" }, + "publishConfig": { + "registry": "https://registry.npmjs.org/", + "access": "public" + }, "react-native-builder-bob": { "source": "src", "output": "lib",