facebook

Splash screen every time

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #347514 Reply

    herb200mph
    Participant

    Client has taken a strong liking to the splash screen that displays before the native app opening screen.

    The splash screen displays only during the “first loading” of the app.

    The splash screen does not display again once the app is installed and opened the first time.

    How can we configure the app to display the splash screen every time the app is opened after installing?

    #347515 Reply

    Brandon
    Member

    The splash screen is displayed each time the app is ‘opened’. If it has already been opened, and is in the background it may not show it again until it is completely closed. You can manually add something using the Phonegap API. The event Resume is called when the app is pulled from the background. So it would be easy to add a hidden panel with the same splash screen and only show this when the app is Resumed (not on opening). Here is the link to the API:

    http://docs.phonegap.com/en/3.3.0/cordova_events_events.md.html#resume

    to hide/show a panel or item:
    //code untested, from the top of my head

    $(‘#m1-formname-panel1’).css(‘visibility’,’hidden’); //hides it
    $(‘#m1-formname-panel1’).css(‘visibility’,’visible’); //shows it

    #347518 Reply

    herb200mph
    Participant

    Can we just put a screen before Screen#1 that will fade out after 5-seconds, every time the app opens.

    Can javascript be added to the Splash/Opening screen that will do that before Screen#1 is displayed.

    #347520 Reply

    Brandon
    Member

    You can, but that wont get called if the app is in the background, then reopened as it is still on screen1 and not technically reopening it.

    #347521 Reply

    herb200mph
    Participant

    Right. Thanks for that.

    #347522 Reply

    Brandon
    Member

    No problem. If you run into any trouble let me know.

    #347523 Reply

    herb200mph
    Participant

    Oh, its already trouble in that we are not coders and looking for a simple solution.

    #347524 Reply

    Brandon
    Member

    Try this, in your custom.js file, make sure you change the form name and if needed the panel: (untested)

    
    
        document.addEventListener("deviceready", onDeviceReady, false);
    
        // device APIs are available
        //
        function onDeviceReady() {
            document.addEventListener("resume", onResume, false);
        }
    
        // Handle the resume event
        function onResume() {
        //show splash screen, an image in panel widget called panel1
         $('#m1-formname-panel1').css('visibility','visible'); //shows it
          setTimeout(function(){$('#m1-formname-panel1').css('visibility','hidden');},5000);
        }
    
    #347527 Reply

    herb200mph
    Participant

    Thanks a ton Brandon.

    We will give this code a test in the next day or so and report back the results.

    Cheers.

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: Splash screen every time

You must be logged in to post in the forum log in