0.7.0 • Published 8 years ago

rokid-framework-rn v0.7.0

Weekly downloads
5
License
ISC
Repository
github
Last release
8 years ago

#rokid-framework-rn

Installation

npm i --save rokid-framework-rn

on Android:

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

include ":rokid-framework-rn"
project(':rokid-framework-rn').projectDir = new File(rootProject.projectDir,'../node_modules/rokid-framework-rn/android/rokid-framework-react-native')

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

compile project(':rokid-framework-rn')

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

import com.leolang.rokidframework.react.RKReactActivity;
import com.leolang.rokidframework.react.RKReactPackage;

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

public class MainActivity extends RKReactActivity
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
	new MainReactPackage(),
	...
	new RKReactPackage()
  );
}

Usage

###js

import RKReactNative from 'rokid-framework-rn';

##sample

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