Skip to content

Commit e037b71

Browse files
authored
Merge pull request #249 from thecodingmachine/splash_screen_fix
fix android splash screen flash
2 parents 08a7e97 + cc7b6c5 commit e037b71

File tree

5 files changed

+48
-7
lines changed

5 files changed

+48
-7
lines changed

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

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.boilerplate">
3-
1+
<manifest
2+
xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.boilerplate"
4+
>
45
<uses-permission android:name="android.permission.INTERNET" />
56

67
<application
@@ -9,16 +10,27 @@
910
android:icon="@mipmap/ic_launcher"
1011
android:roundIcon="@mipmap/ic_launcher_round"
1112
android:allowBackup="false"
12-
android:theme="@style/SplashTheme">
13+
android:theme="@style/AppTheme"
14+
>
15+
<activity
16+
android:name=".SplashActivity"
17+
android:theme="@style/SplashTheme"
18+
android:label="@string/app_name"
19+
>
20+
<intent-filter>
21+
<action android:name="android.intent.action.MAIN" />
22+
<category android:name="android.intent.category.LAUNCHER" />
23+
</intent-filter>
24+
</activity>
25+
1326
<activity
1427
android:name=".MainActivity"
1528
android:label="@string/app_name"
1629
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
1730
android:launchMode="singleTask"
1831
android:windowSoftInputMode="adjustResize">
1932
<intent-filter>
20-
<action android:name="android.intent.action.MAIN" />
21-
<category android:name="android.intent.category.LAUNCHER" />
33+
<action android:name="android.intent.action.MAIN" />
2234
</intent-filter>
2335
</activity>
2436
</application>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.boilerplate;
2+
import android.content.Intent;
3+
import android.os.Bundle;
4+
import androidx.appcompat.app.AppCompatActivity;
5+
6+
public class SplashActivity extends AppCompatActivity {
7+
@Override
8+
protected void onCreate(Bundle savedInstanceState) {
9+
super.onCreate(savedInstanceState);
10+
11+
Intent intent = new Intent(this, MainActivity.class);
12+
startActivity(intent);
13+
finish();
14+
}
15+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
android:background="@drawable/splash_screen"
6+
android:orientation="vertical">
7+
</LinearLayout>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
<color name="splashscreen_bg">#FFFFFF</color>
3+
<color name="splashscreen_bg">#000000</color>
44
</resources>

template/yarn.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,6 +2059,13 @@ aws4@^1.8.0:
20592059
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59"
20602060
integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==
20612061

2062+
axios@^0.21.4:
2063+
version "0.21.4"
2064+
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575"
2065+
integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==
2066+
dependencies:
2067+
follow-redirects "^1.14.0"
2068+
20622069
babel-core@^7.0.0-bridge.0:
20632070
version "7.0.0-bridge.0"
20642071
resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece"

0 commit comments

Comments
 (0)