react-native-modal-android

0.0.1 • Public • Published

react-native-modal-android

The component has the same API as on iOS - http://facebook.github.io/react-native/docs/modal.html#content The animated prop is not implemented yet. I just wrap that PR code which will ship with react-native The origin author is satya164 @ https://github.com/satya164

npm version npm downloads npm licence

Installation

npm install react-native-modal-android --save

Add it to your android project

  • In android/setting.gradle
...
include ':react-native-modal-android', ':app'
project(':react-native-modal-android').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-modal-android')
  • In android/app/build.gradle
...
dependencies {
  ...
  compile project(':react-native-modal-android')
}
  • Register Module (in MainActivity.java)
import cn.tuofeng.modalhost.ReactModalHostPackage;  // <--- import 
 
public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
  ......
 
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);
 
    mReactInstanceManager = ReactInstanceManager.builder()
      .setApplication(getApplication())
      .setBundleAssetName("index.android.bundle")
      .setJSMainModuleName("index.android")
      .addPackage(new MainReactPackage())
      .addPackage(new ReactModalHostPackage()) // <------ add this line to yout MainActivity class 
      .setUseDeveloperSupport(BuildConfig.DEBUG)
      .setInitialLifecycleState(LifecycleState.RESUMED)
      .build();
 
    mReactRootView.startReactApplication(mReactInstanceManager, "AndroidRNSample", null);
 
    setContentView(mReactRootView);
  }
 
  ......
 
}

More info here: https://github.com/facebook/react-native/pull/5320

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    1

Package Sidebar

Install

npm i react-native-modal-android

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • iwater