You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Mark Ludlow (JIRA)" <ji...@apache.org> on 2015/08/19 18:16:46 UTC

[jira] [Created] (CB-9516) Android SplashScreen - Spinner Does Not Display

Mark Ludlow created CB-9516:
-------------------------------

             Summary: Android SplashScreen - Spinner Does Not Display
                 Key: CB-9516
                 URL: https://issues.apache.org/jira/browse/CB-9516
             Project: Apache Cordova
          Issue Type: Bug
          Components: Plugin SplashScreen
    Affects Versions: 5.0.1
         Environment: Cordova 5 and Android Lollipop 5.0 and 5.1
            Reporter: Mark Ludlow
            Priority: Minor


The spinner dialog is not displaying on Android. I believe one cause of this is the message "spinner > stop" which being used to display the webview, is also stopping the spinner prematurely.

See this comment in CoreAndroid.js:

// This gets called from JavaScript onCordovaReady to show the webview.
// I recommend we change the name of the Message as spinner/stop is not
// indicative of what this actually does (shows the webview).
                cordova.getActivity().runOnUiThread(new Runnable() {
                    public void run() {
                        webView.getPluginManager().postMessage("spinner", "stop");
                    }
                });

The "spinner > stop" message is fired almost immediately after SplashScreen.spinnerStart() is called, thus hiding the spinner before it actually displays. I was able to partially fix this by commenting out the call to spinnerStop() in the "spinner > stop" message handler:

if ("spinner".equals(id)) {
            if ("stop".equals(data.toString())) {
                //this.spinnerStop();
                getView().setVisibility(View.VISIBLE);
            }
        }

The second issue, at least for Cordova 5 and Lollipop, is that in the pluginInitialize() method, loadSpinner() is being called before showSplashScreen(true).
I reversed these lines and made the change above and now the splashscreen displays correctly. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org