Skip to content

Commit

Permalink
Try using COLOR.Transparent instead of a definitive color to fix #46
Browse files Browse the repository at this point in the history
  • Loading branch information
mehcode committed Aug 9, 2017
1 parent 74bd9fa commit 95e5055
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
});
}
Expand Down
5 changes: 0 additions & 5 deletions android/src/main/res/values/attr.xml

This file was deleted.

0 comments on commit 95e5055

Please # to comment.