Created
July 25, 2019 16:23
-
-
Save andrepimenta/517722bfdfffe6b85bf3d39f10a35646 to your computer and use it in GitHub Desktop.
React Native android Bridge TEMPLATE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//PUT YOUR PACKAGE HERE, IT'S THE SAME AS IN MainApplication.java | |
package com.reatnativeloadingspinneroverlaynativetutorial; | |
import com.facebook.react.bridge.NativeModule; | |
import com.facebook.react.bridge.ReactApplicationContext; | |
import com.facebook.react.bridge.ReactContext; | |
import com.facebook.react.bridge.ReactContextBaseJavaModule; | |
import com.facebook.react.bridge.ReactMethod; | |
import android.app.Activity; | |
//CHANGE LoadingOverlay WITH THE NAME OF YOUR CHOICE | |
public class LoadingOverlay extends ReactContextBaseJavaModule { | |
public LoadingOverlay(ReactApplicationContext reactContext) { | |
super(reactContext); | |
} | |
@Override | |
public String getName() { | |
return "LoadingOverlay"; | |
} | |
@ReactMethod | |
public void toggle(Boolean show) { | |
final Activity activity = getCurrentActivity(); | |
//PUT YOUR NATIVE CODE HERE | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment