Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit b1f4781

Browse files
committed
fix: android splash screen
1 parent f6c7f50 commit b1f4781

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

android/app/src/main/java/com/rntypescriptboilerplate/MainActivity.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
package com.rntypescriptboilerplate;
2-
2+
import android.os.Bundle;
33
import com.facebook.react.ReactActivity;
44
import com.facebook.react.ReactActivityDelegate;
55
import com.facebook.react.ReactRootView;
6+
import org.devio.rn.splashscreen.SplashScreen;
67

78
public class MainActivity extends ReactActivity {
8-
9+
@Override
10+
protected void onCreate(Bundle savedInstanceState) {
11+
SplashScreen.show(this);
12+
super.onCreate(savedInstanceState);
13+
}
914
/**
1015
* Returns the name of the main component registered from JavaScript. This is used to schedule
1116
* rendering of the component.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:orientation="vertical" android:layout_width="match_parent"
4+
android:layout_height="match_parent">
5+
<ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/launch_screen" android:scaleType="centerCrop" />
6+
</RelativeLayout>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="primary_dark">#000000</color>
4+
</resources>

0 commit comments

Comments
 (0)