0.2.0 • Published 10 years ago

frame-animation-react-native v0.2.0

Weekly downloads
2
License
ISC
Repository
github
Last release
10 years ago

#frame-animation-react-native

Installation

npm i --save frame-animation-react-native

on Android:

####1. android/settings.gradle:: Add the following snippet

include ':RNFA'
project(':RNFA').projectDir = file('../node_modules/frame-animation-react-native/android/frame-animation-react-native')

####2. android/app/build.gradle: Add in dependencies block.

compile project(':RNFA')

####3. in your MainActivity (or equivalent) the FrameAnimReactPackage needs to be added. Add the import at the top:

import com.leolang.frame_animation_react_native.FrameAnimReactPackage;

####4. In order for React Native to use the package, add it the packages inside of the class extending ReactActivity.

@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
	new MainReactPackage(),
	...
	new FrameAnimReactPackage()
  );
}

Usage

###js

var FrameAnim = require('./node_modules/frame-animation-react-native/frameanim');
/* 
 * action = 'start' or 'stop'
 * frameAnimFile is the android animation xml file
 */
<FrameAnim style={{width:640,height:480}} action = 'start' frameAnimFile = 'hotel_tts_frame' oneshot = {false}></FrameAnim>

###android

npm.io

npm.io

在MainActivity中修改为你的server ip和端口

npm.io

frame animation source preload

npm.io

##sample

###android/app & index.android.js

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago