Skip to content

Commit 5b77d66

Browse files
feat: implement new splash screen static version
1 parent 0345871 commit 5b77d66

File tree

19 files changed

+79
-10
lines changed

19 files changed

+79
-10
lines changed

android/app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ dependencies {
310310
implementation "com.facebook.react:react-native:+" // From node_modules
311311

312312
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
313+
implementation "androidx.core:core-splashscreen:1.0.0"
313314

314315
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
315316
exclude group:'com.facebook.fbjni'

android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
android:allowBackup="false"
3030
android:label="@string/app_name"
3131
android:icon="@mipmap/ic_launcher"
32-
android:theme="@style/AppTheme"
32+
android:theme="@style/Theme.AppSplash"
3333
android:name=".MainApplication"
3434
android:largeHeap="true"
3535
android:usesCleartextTraffic="true">
@@ -38,6 +38,7 @@
3838
android:name=".MainActivity"
3939
android:exported="true"
4040
android:label="@string/app_name"
41+
android:theme="@style/Theme.AppSplash"
4142
android:screenOrientation="portrait"
4243
android:windowSoftInputMode="adjustResize"
4344
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"

android/app/src/main/java/im/status/ethereum/MainActivity.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import com.facebook.react.ReactFragmentActivity;
3232
import com.reactnativenavigation.NavigationActivity;
3333
import com.facebook.react.modules.core.PermissionListener;
34-
import org.devio.rn.splashscreen.SplashScreen;
34+
import androidx.core.splashscreen.SplashScreen;
3535

3636
import java.util.Properties;
3737
import im.status.ethereum.module.StatusThreadPoolExecutor;
@@ -121,21 +121,18 @@ public void onNewIntent(final Intent intent) {
121121

122122
@Override
123123
protected void onCreate(Bundle savedInstanceState) {
124+
SplashScreen splashScreen = SplashScreen.installSplashScreen(this);
124125

125126
switch (getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) {
126127
case Configuration.UI_MODE_NIGHT_YES:
127128
setTheme(R.style.DarkTheme);
128-
SplashScreen.show(this, R.style.DarkTheme, R.id.lottie);
129129
break;
130130
case Configuration.UI_MODE_NIGHT_NO:
131131
setTheme(R.style.LightTheme);
132-
SplashScreen.show(this, R.style.LightTheme, R.id.lottie);
133132
break;
134133
default:
135134
setTheme(R.style.LightTheme);
136-
SplashScreen.show(this, R.style.LightTheme, R.id.lottie);
137135
}
138-
SplashScreen.setAnimationFinished(true);
139136
// Make sure we get an Alert for every uncaught exceptions
140137
registerUncaughtExceptionHandler(MainActivity.this);
141138

Loading
Loading
Loading
Loading
Loading

android/app/src/main/res/values/colors.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
<resources>
33
<color name="alert_background">#ffffff</color>
44
<color name="alert_text">#000000</color>
5+
<color name="splash_background">#09101C</color>
6+
<color name="splash_status_bar_color">#ffffff</color>
57
</resources>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<resources xmlns:tools="http://schemas.android.com/tools">
2+
<style name="Theme.AppSplash" parent="Theme.SplashScreen">
3+
<item name="windowSplashScreenBackground">@color/splash_background</item>
4+
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_logo</item>
5+
<item name="windowSplashScreenAnimationDuration">1000</item>
6+
7+
<!-- Status bar and Nav bar configs -->
8+
<item name="android:statusBarColor" tools:targetApi="l">@color/splash_status_bar_color</item>
9+
<item name="android:windowLightStatusBar">false</item>
10+
11+
<item name="postSplashScreenTheme">@style/DarkTheme</item>
12+
</style>
13+
</resources>

0 commit comments

Comments
 (0)