offical react-native-splash-screen
$ yarn add react-native-splash-screen
$ npx react-native link react-native-splash-screen
import android.os.Bundle;
import org.devio.rn.splashscreen.SplashScreen;
//...
@Override
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.show(this);
super.onCreate(savedInstanceState);
}
<?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"
android:background="@drawable/gradient">
<ImageView
android:layout_marginTop="-40dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:src="@drawable/brand_logo" />
<ImageView
android:layout_width="90dp"
android:layout_height="20dp"
android:layout_marginBottom="10dp"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:src="@drawable/company_logo" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:type="sweep"
android:startColor="#780206"
android:endColor="#061161" />
</shape>
android\app\src\main\res\drawable\company_logo.png <---add splash img
android\app\src\main\res\drawable\brand_logo.png <---add splash img
import SplashScreen from "react-native-splash-screen";
SplashScreen.hide();