Skip to content

DataWallet/react-native-image-sequence

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

its a simple wrapper around iOS UIImageView.animationImages and Android AnimationDrawable

Installation

  1. npm i rnpm --global
  2. npm i --save react-native-image-sequence
  3. rnpm link react-native-image-sequence

Examples

import ImageSequence from 'react-native-image-sequence';

const images = [
  require('1.jpg'),
  require('2.jpg'),
  require('3.jpg'),
  require('4.jpg'),
  require('5.jpg'),
];

const centerIndex = Math.round(images.length / 2);

<ImageSequence
  images={images}
  startFrameIndex={centerIndex}
  style={{width: 50, height: 50}} />

Change animation speed

You can change the speed of the animation by setting the framesPerSecond property.

<ImageSequence
  images={images}
  framesPerSecond={24}
  />

Make the animation loop

You can make the animation loop by setting the repeat property. Default false.

<ImageSequence
  images={images}
  repeat
  />

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 58.0%
  • Objective-C 30.4%
  • JavaScript 11.6%