- This topic has 8 replies, 2 voices, and was last updated 11 years, 4 months ago by
herb200mph.
-
AuthorPosts
-
herb200mphParticipantClient 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?
February 25, 2014 at 10:35 am #347515
BrandonMemberThe 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 itFebruary 25, 2014 at 10:52 am #347518
herb200mphParticipantCan 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.
February 25, 2014 at 10:55 am #347520
BrandonMemberYou 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.
February 25, 2014 at 11:00 am #347521
herb200mphParticipantRight. Thanks for that.
February 25, 2014 at 11:02 am #347522
BrandonMemberNo problem. If you run into any trouble let me know.
February 25, 2014 at 11:06 am #347523
herb200mphParticipantOh, its already trouble in that we are not coders and looking for a simple solution.
February 25, 2014 at 11:11 am #347524
BrandonMemberTry 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); }
February 25, 2014 at 11:31 am #347527
herb200mphParticipantThanks a ton Brandon.
We will give this code a test in the next day or so and report back the results.
Cheers.
-
AuthorPosts