CB-2154: navigator.splashscreen.show() broken in Phonegap 2.2 and 2.3.0rc2

Fixed the splashscreen so it will show for a minimum of 3 seconds if the user has not called loadUrl with a timeout in their main activity.
This commit is contained in:
Simon MacDonald 2013-01-10 22:06:35 -05:00
parent dc94fc39ec
commit dbb127447f

View File

@ -40,6 +40,7 @@ import android.graphics.Color;
import android.media.AudioManager; import android.media.AudioManager;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.util.Log;
import android.view.Display; import android.view.Display;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.Menu; import android.view.Menu;
@ -170,7 +171,7 @@ public class DroidGap extends Activity implements CordovaInterface {
// Draw a splash screen using an image located in the drawable resource directory. // Draw a splash screen using an image located in the drawable resource directory.
// This is not the same as calling super.loadSplashscreen(url) // This is not the same as calling super.loadSplashscreen(url)
protected int splashscreen = 0; protected int splashscreen = 0;
protected int splashscreenTime = 0; protected int splashscreenTime = 3000;
// LoadUrl timeout value in msec (default of 20 sec) // LoadUrl timeout value in msec (default of 20 sec)
protected int loadUrlTimeoutValue = 20000; protected int loadUrlTimeoutValue = 20000;
@ -1053,7 +1054,7 @@ public class DroidGap extends Activity implements CordovaInterface {
} }
else { else {
// If the splash dialog is showing don't try to show it again // If the splash dialog is showing don't try to show it again
if (this.splashDialog != null && !this.splashDialog.isShowing()) { if (this.splashDialog == null || !this.splashDialog.isShowing()) {
this.splashscreen = this.getIntegerProperty("splashscreen", 0); this.splashscreen = this.getIntegerProperty("splashscreen", 0);
this.showSplashScreen(this.splashscreenTime); this.showSplashScreen(this.splashscreenTime);
} }