From 95e5055ef28486dcbe34559c906234b0bfbfb227 Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Wed, 9 Aug 2017 12:41:19 -0700 Subject: [PATCH] Try using COLOR.Transparent instead of a definitive color to fix #46 --- .../mehcode/reactnative/splashscreen/SplashScreen.java | 8 ++------ android/src/main/res/values/attr.xml | 5 ----- 2 files changed, 2 insertions(+), 11 deletions(-) delete mode 100644 android/src/main/res/values/attr.xml diff --git a/android/src/main/java/com/mehcode/reactnative/splashscreen/SplashScreen.java b/android/src/main/java/com/mehcode/reactnative/splashscreen/SplashScreen.java index 900dd7e..1193a63 100644 --- a/android/src/main/java/com/mehcode/reactnative/splashscreen/SplashScreen.java +++ b/android/src/main/java/com/mehcode/reactnative/splashscreen/SplashScreen.java @@ -36,10 +36,6 @@ public void run() { mSplashDialog.show(); } - // Use color of "splashBackgroundColor" attribute in user theme, fallback to white if not set - TypedArray styledAttributes = activity.getTheme().obtainStyledAttributes(R.styleable.RNSplashScreen_Styleable); - final int backgroundColor = styledAttributes.getColor(R.styleable.RNSplashScreen_Styleable_splashBackgroundColor, Color.WHITE); - // If given an instance manager; ensure that we transition to the stage-2 // splash screen // TODO: If you think of a better way to do this; PR please @@ -48,14 +44,14 @@ public void run() { // background state and we will not get the context created event ReactContext ctx = instanceManager.getCurrentReactContext(); if (ctx != null) { - activity.getWindow().getDecorView().setBackgroundColor(backgroundColor); + activity.getWindow().getDecorView().setBackgroundColor(Color.TRANSPARENT); } else { // Else; wait until react is initialized before we release the native splash instanceManager.addReactInstanceEventListener(new ReactInstanceManager.ReactInstanceEventListener() { @Override public void onReactContextInitialized(ReactContext context) { // Hide the native splash screen - activity.getWindow().getDecorView().setBackgroundColor(backgroundColor); + activity.getWindow().getDecorView().setBackgroundColor(Color.TRANSPARENT); } }); } diff --git a/android/src/main/res/values/attr.xml b/android/src/main/res/values/attr.xml deleted file mode 100644 index 63b09f2..0000000 --- a/android/src/main/res/values/attr.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - -