Skip to content

Commit

Permalink
Splash screen with react-native-splash-screen (#3743) (#3762)
Browse files Browse the repository at this point in the history
Splash screen with react-native-splash-screen (#3743)
  • Loading branch information
southerneer committed May 28, 2019
2 parents c356f3d + 00cd256 commit 67070f2
Show file tree
Hide file tree
Showing 29 changed files with 6,105 additions and 5,731 deletions.
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ android {
}

dependencies {
implementation project(':react-native-splash-screen')
implementation project(':react-native-pure-jwt')
implementation project(':react-native-action-sheet')
implementation project(':react-native-image-crop-picker')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,19 @@
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 implements TouchThroughTouchHandlerInterface {
private ReactRootView mReactRootView;
private ReactInstanceManager mReactInstanceManager;
private TouchThroughTouchHandler touchThroughTouchHandler = new TouchThroughTouchHandler();

// @Override
// protected void onCreate(Bundle savedInstanceState) {
// mReactInstanceManager = ReactInstanceManager.builder()
// // ...
// // Add CodePush package
// .addPackage(new CodePush("aKbSrov0EFd-mvtC31iYca_W0EtFS1jJ7ITUE",
// getApplicationContext(), BuildConfig.DEBUG))
// // Get the JS Bundle File via Code Push
// .setJSBundleFile(CodePush.getJSBundleFile())
// // ...

// .build();
// mReactRootView.startReactApplication(mReactInstanceManager,
// "MyReactNativeApp", null);
@Override
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.show(this);
super.onCreate(savedInstanceState);
}

// setContentView(mReactRootView);
// }
/**
* Returns the name of the main component registered from JavaScript. This is
* used to schedule rendering of the component.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.app.Application;

import com.facebook.react.ReactApplication;
import org.devio.rn.splashscreen.SplashScreenReactPackage;
import com.zaguiini.RNPureJwt.RNPureJwtPackage;
//import com.zaguini.rnjwt.RNJwtPackage;
import com.actionsheet.ActionSheetPackage;
Expand Down Expand Up @@ -52,7 +53,8 @@ public boolean getUseDeveloperSupport() {

@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(new MainReactPackage(), new RNPureJwtPackage(), new ActionSheetPackage(),
return Arrays.<ReactPackage>asList(new MainReactPackage(),
new SplashScreenReactPackage(), new RNPureJwtPackage(), new ActionSheetPackage(),
new PickerPackage(), new AndroidOpenSettingsPackage(), new ExtraDimensionsPackage(), new RNLocalizePackage(),
new RNBackgroundGeolocation(), BugsnagReactNative.getPackage(), new ReactNativePushNotificationPackage(),
new LinearGradientPackage(), new RNFSPackage(), new TouchThroughViewPackage(), new RNMixpanel(),
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions android/app/src/main/res/layout/launch_screen.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/launch_screen" android:scaleType="centerCrop" />
</RelativeLayout>
1 change: 1 addition & 0 deletions android/app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<resources>
<color name="white">#FFF</color>
<color name="primary_dark">#000000</color>
</resources>
2 changes: 2 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
rootProject.name = 'tinyrobot'
include ':react-native-splash-screen'
project(':react-native-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-splash-screen/android')
include ':react-native-pure-jwt'
project(':react-native-pure-jwt').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-pure-jwt/android')
include ':react-native-json-web-token'
Expand Down
2 changes: 2 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def testing_pods
pod 'RNImageCropPicker', :path => '../node_modules/react-native-image-crop-picker'

# Add new pods below this line
pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'

pod 'RNPureJwt', :path => '../node_modules/react-native-pure-jwt'

pod 'RNLocalize', :path => '../node_modules/react-native-localize'
Expand Down
8 changes: 7 additions & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ PODS:
- react-native-mixpanel (0.0.6):
- Mixpanel
- React
- react-native-splash-screen (3.2.0):
- React
- React/Core (0.59.2):
- yoga (= 0.59.2.React)
- React/CxxBridge (0.59.2):
Expand Down Expand Up @@ -230,6 +232,7 @@ DEPENDENCIES:
- react-native-google-maps (from `../node_modules/react-native-maps`)
- react-native-maps (from `../node_modules/react-native-maps`)
- react-native-mixpanel (from `../node_modules/react-native-mixpanel`)
- react-native-splash-screen (from `../node_modules/react-native-splash-screen`)
- React/Core (from `../node_modules/react-native`)
- React/CxxBridge (from `../node_modules/react-native`)
- React/DevSupport (from `../node_modules/react-native`)
Expand Down Expand Up @@ -305,6 +308,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-maps"
react-native-mixpanel:
:path: "../node_modules/react-native-mixpanel"
react-native-splash-screen:
:path: "../node_modules/react-native-splash-screen"
ReactNativePermissions:
:path: "../node_modules/react-native-permissions"
RNBackgroundFetch:
Expand Down Expand Up @@ -360,6 +365,7 @@ SPEC CHECKSUMS:
react-native-google-maps: 568cb03d0eae7fef93626f65d05be55642404ed4
react-native-maps: 0316ed017dbb64b33b227751fa810e2454fcfa39
react-native-mixpanel: bdb451e8455940a12fdd157c2146a68c5f80310d
react-native-splash-screen: 200d11d188e2e78cea3ad319964f6142b6384865
ReactNativePermissions: b64e084dff6a5cad51587d38c306f09246246384
RNBackgroundFetch: f123aec9c3fdb946785452a56faae50d28e63aee
RNBackgroundGeolocation: 3a5bf961801125a88b00dbb4d620b815fb4d39dc
Expand All @@ -374,6 +380,6 @@ SPEC CHECKSUMS:
SSZipArchive: 41455d4b8d2b6ab93990820b50dc697c2554a322
yoga: 3768a3026ade0fb46a68f3a31a917cf86bc34fc4

PODFILE CHECKSUM: fc0e418a613a2b05a1b3c96c254acdd5fa12de81
PODFILE CHECKSUM: d8e8272276cb2af7de298d172425f2d9c14d8bda

COCOAPODS: 1.6.1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions ios/Pods/Local Podspecs/react-native-splash-screen.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion ios/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 67070f2

Please sign in to comment.