Skip to content

Commit 380a342

Browse files
authored
fix(android): rework the splashscreen implementation (#377)
Co-authored-by: jeremydolle <[email protected]>
1 parent 6590b8a commit 380a342

File tree

4 files changed

+14
-32
lines changed

4 files changed

+14
-32
lines changed

template/android/app/src/main/AndroidManifest.xml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,17 @@
1111
android:theme="@style/AppTheme"
1212
>
1313
<activity
14-
android:name=".SplashActivity"
15-
android:theme="@style/SplashTheme"
16-
android:label="@string/app_name"
17-
android:exported="true"
18-
>
14+
android:name=".MainActivity"
15+
android:label="@string/app_name"
16+
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
17+
android:launchMode="singleTask"
18+
android:theme="@style/SplashTheme"
19+
android:windowSoftInputMode="adjustResize"
20+
android:exported="true">
1921
<intent-filter>
2022
<action android:name="android.intent.action.MAIN" />
2123
<category android:name="android.intent.category.LAUNCHER" />
2224
</intent-filter>
2325
</activity>
24-
25-
<activity
26-
android:name=".MainActivity"
27-
android:label="@string/app_name"
28-
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
29-
android:launchMode="singleTask"
30-
android:windowSoftInputMode="adjustResize"
31-
android:exported="true">
32-
<intent-filter>
33-
<action android:name="android.intent.action.MAIN" />
34-
</intent-filter>
35-
</activity>
3626
</application>
3727
</manifest>

template/android/app/src/main/java/com/boilerplate/MainActivity.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.facebook.react.ReactActivityDelegate;
55
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
66
import com.facebook.react.defaults.DefaultReactActivityDelegate;
7+
import android.os.Bundle;
78

89
public class MainActivity extends ReactActivity {
910

@@ -29,4 +30,10 @@ protected ReactActivityDelegate createReactActivityDelegate() {
2930
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
3031
DefaultNewArchitectureEntryPoint.getFabricEnabled());
3132
}
33+
34+
@Override
35+
protected void onCreate(Bundle savedInstance) {
36+
super.onCreate(savedInstance);
37+
setTheme(R.style.AppTheme);
38+
}
3239
}

template/android/app/src/main/java/com/boilerplate/SplashActivity.java

Lines changed: 0 additions & 15 deletions
This file was deleted.
112 KB
Loading

0 commit comments

Comments
 (0)