diff --git a/android/app/src/main/java/com/bitkit/MainActivity.kt b/android/app/src/main/java/com/bitkit/MainActivity.kt index eab810f1e..1beadf993 100644 --- a/android/app/src/main/java/com/bitkit/MainActivity.kt +++ b/android/app/src/main/java/com/bitkit/MainActivity.kt @@ -1,11 +1,11 @@ package com.bitkit -import android.os.Bundle; +import android.os.Bundle +import com.bitkit.modules.SplashScreen.SplashScreenModule import com.facebook.react.ReactActivity import com.facebook.react.ReactActivityDelegate import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled import com.facebook.react.defaults.DefaultReactActivityDelegate -import com.bitkit.modules.SplashScreen.SplashScreenModule class MainActivity : ReactActivity() { diff --git a/android/app/src/main/java/com/bitkit/modules/SplashScreen/SplashScreenModule.java b/android/app/src/main/java/com/bitkit/modules/SplashScreen/SplashScreenModule.java index 959279cdf..170c57093 100644 --- a/android/app/src/main/java/com/bitkit/modules/SplashScreen/SplashScreenModule.java +++ b/android/app/src/main/java/com/bitkit/modules/SplashScreen/SplashScreenModule.java @@ -5,6 +5,7 @@ import android.os.Build; import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; import com.bitkit.R; import com.facebook.react.bridge.ReactApplicationContext; @@ -17,7 +18,6 @@ public class SplashScreenModule extends ReactContextBaseJavaModule { private static WeakReference mainActivityRef; private static Dialog splashDialog; - /* Boilerplate */ SplashScreenModule(@NonNull ReactApplicationContext reactContext) { super(reactContext); } @@ -28,7 +28,6 @@ public String getName() { return "SplashScreenModule"; } - /* React Native method */ @ReactMethod public void hide() { Activity currentActivity = getCurrentActivity(); @@ -63,13 +62,18 @@ public void hide() { }); } - /* Native util */ public static void show(@NonNull final Activity activity) { mainActivityRef = new WeakReference<>(activity); + // Set app background color back to black + activity.getWindow().setBackgroundDrawableResource(R.color.black); + activity.runOnUiThread(() -> { // Leave out the second argument if you're not using animations splashDialog = new Dialog(activity, R.style.AppTheme_SplashDialog); + // Set splash screen status & navigation bar color + splashDialog.getWindow().setStatusBarColor(ContextCompat.getColor(activity, R.color.brand)); + splashDialog.getWindow().setNavigationBarColor(ContextCompat.getColor(activity, R.color.brand)); splashDialog.setContentView(R.layout.splash_screen); splashDialog.setCancelable(false); @@ -78,4 +82,4 @@ public static void show(@NonNull final Activity activity) { } }); } -} \ No newline at end of file +} diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml index d02fb7716..1386abaae 100644 --- a/android/app/src/main/res/values/styles.xml +++ b/android/app/src/main/res/values/styles.xml @@ -1,15 +1,12 @@ - + - + +