0.0.5 • Published 8 years ago

frameanim v0.0.5

Weekly downloads
2
License
ISC
Repository
github
Last release
8 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.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.1

8 years ago