RAW Video: https://streamable.com/jina7
The video explains the bug very well. On Android, when launching the app, I show my splash screen with setContentView
in the Activity. Then when Navigation.setRoot
is executed, the launch screen is replaced with an white screen and gray NavBar (defaults?).
Few moments later, the expected screen options were applied and the app rendered.
I tried different configurations:
sidemenu
or pure root.component
.bottomTabs
.Repro on current master: https://github.com/birkir/kvikmyndr-app
Navigation.setRoot({
component: {
name: WEEK,
},
});
The issue is caused by addDefaultSplashLayout
on NavigationActivity
setting by default a white view.
"Resolved" by overriding onCreate
like this:
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
View view = new View(this);
view.setBackgroundColor(Color.TRANSPARENT);
setContentView(view);
}
The addDefaultSplashLayout
should be overridable.
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); View view = new View(this); view.setBackgroundColor(Color.TRANSPARENT); setContentView(view); }
OR:
import com.reactnativenavigation.NavigationActivity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
public class MainActivity extends NavigationActivity
{
@Override
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
View view = new View(this);
view.setBackgroundResource(R.drawable.splash_screen);
setContentView(view);
}
}
@edvinasbartkus <3 <3 <3
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.
I think this can be closed. You can now override the default splash by doing
@Override
protected void addDefaultSplashLayout() {
View view = new View(this);
view.setBackgroundResource(R.drawable.launch_screen);
setContentView(view);
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.
The issue has been closed for inactivity.
Most helpful comment
I think this can be closed. You can now override the default splash by doing