Created
July 5, 2019 13:04
-
-
Save FreddyPoly/915b6fe6c50f31397f8cf6f78366b091 to your computer and use it in GitHub Desktop.
[REACT NATIVE] Splash Main Activity
This file contains hidden or 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
package com.boilerplatetest; | |
import com.facebook.react.ReactActivity; | |
import android.os.Bundle; | |
import com.facebook.react.ReactActivityDelegate; | |
import com.facebook.react.ReactRootView; | |
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView; | |
import org.devio.rn.splashscreen.SplashScreen; | |
public class MainActivity extends ReactActivity { | |
@Override | |
protected ReactActivityDelegate createReactActivityDelegate() { | |
return new ReactActivityDelegate(this, getMainComponentName()) { | |
@Override | |
protected ReactRootView createRootView() { | |
return new RNGestureHandlerEnabledRootView(MainActivity.this); | |
} | |
}; | |
} | |
/** | |
* Returns the name of the main component registered from JavaScript. | |
* This is used to schedule rendering of the component. | |
*/ | |
@Override | |
protected String getMainComponentName() { | |
return "BoilerplateTest"; | |
} | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
SplashScreen.show(this); // here | |
super.onCreate(savedInstanceState); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment