Skip to content

Commit

Permalink
fix(android): move splash screen trigger before the webview render to…
Browse files Browse the repository at this point in the history
… prevent flicker (2.x) (#3608)
  • Loading branch information
carlpoole authored Sep 23, 2020
1 parent 661b63c commit cbab54c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 5 additions & 0 deletions android/capacitor/src/main/java/com/getcapacitor/Bridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ public Bridge(Activity context, WebView webView, List<Class<? extends Plugin>> i
this.config = new CapConfig(getActivity().getAssets(), config);
Logger.init(this.config);

// Display splash screen if configured
if (context instanceof BridgeActivity) {
Splash.showOnLaunch((BridgeActivity) context, this.config);
}

// Initialize web view and message handler for it
this.initWebView();
this.msgHandler = new MessageHandler(this, webView, pluginManager);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ protected void load(Bundle savedInstanceState) {
cordovaInterface.onCordovaInit(pluginManager);
bridge = new Bridge(this, webView, initialPlugins, cordovaInterface, pluginManager, preferences, this.config);

Splash.showOnLaunch(this, bridge.getConfig());

if (savedInstanceState != null) {
bridge.restoreInstanceState(savedInstanceState);
}
Expand Down

0 comments on commit cbab54c

Please sign in to comment.