mirror of
https://github.com/apache/cordova-android.git
synced 2025-03-04 00:13:20 +08:00
CB-878: Splash screen in Android fullscreen mode showing not correct
This commit is contained in:
parent
d87f404d6e
commit
6c1a2e1230
@ -160,7 +160,7 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
protected IPlugin activityResultCallback = null;
|
protected IPlugin activityResultCallback = null;
|
||||||
protected boolean activityResultKeepRunning;
|
protected boolean activityResultKeepRunning;
|
||||||
|
|
||||||
// Default background color for activity
|
// Default background color for activity
|
||||||
// (this is not the color for the webview, which is set in HTML)
|
// (this is not the color for the webview, which is set in HTML)
|
||||||
private int backgroundColor = Color.BLACK;
|
private int backgroundColor = Color.BLACK;
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the authentication token.
|
* Sets the authentication token.
|
||||||
*
|
*
|
||||||
* @param authenticationToken
|
* @param authenticationToken
|
||||||
* @param host
|
* @param host
|
||||||
* @param realm
|
* @param realm
|
||||||
@ -199,7 +199,7 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
*
|
*
|
||||||
* @param host
|
* @param host
|
||||||
* @param realm
|
* @param realm
|
||||||
*
|
*
|
||||||
* @return the authentication token or null if did not exist
|
* @return the authentication token or null if did not exist
|
||||||
*/
|
*/
|
||||||
public AuthenticationToken removeAuthenticationToken(String host, String realm) {
|
public AuthenticationToken removeAuthenticationToken(String host, String realm) {
|
||||||
@ -220,7 +220,7 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
*
|
*
|
||||||
* @param host
|
* @param host
|
||||||
* @param realm
|
* @param realm
|
||||||
*
|
*
|
||||||
* @return the authentication token
|
* @return the authentication token
|
||||||
*/
|
*/
|
||||||
public AuthenticationToken getAuthenticationToken(String host, String realm) {
|
public AuthenticationToken getAuthenticationToken(String host, String realm) {
|
||||||
@ -239,9 +239,9 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the activity is first created.
|
* Called when the activity is first created.
|
||||||
*
|
*
|
||||||
* @param savedInstanceState
|
* @param savedInstanceState
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@ -273,7 +273,7 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the Android activity.
|
* Get the Android activity.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Activity getActivity() {
|
public Activity getActivity() {
|
||||||
@ -323,7 +323,7 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the url into the webview.
|
* Load the url into the webview.
|
||||||
*
|
*
|
||||||
* @param url
|
* @param url
|
||||||
*/
|
*/
|
||||||
public void loadUrl(String url) {
|
public void loadUrl(String url) {
|
||||||
@ -771,7 +771,7 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a key is released. (Key UP)
|
* Called when a key is released. (Key UP)
|
||||||
*
|
*
|
||||||
* @param keyCode
|
* @param keyCode
|
||||||
* @param event
|
* @param event
|
||||||
*/
|
*/
|
||||||
@ -817,7 +817,7 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch an activity for which you would like a result when it finished. When this activity exits,
|
* Launch an activity for which you would like a result when it finished. When this activity exits,
|
||||||
* your onActivityResult() method will be called.
|
* your onActivityResult() method will be called.
|
||||||
*
|
*
|
||||||
* @param command The command object
|
* @param command The command object
|
||||||
@ -860,12 +860,12 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Report an error to the host application. These errors are unrecoverable (i.e. the main resource is unavailable).
|
* Report an error to the host application. These errors are unrecoverable (i.e. the main resource is unavailable).
|
||||||
* The errorCode parameter corresponds to one of the ERROR_* constants.
|
* The errorCode parameter corresponds to one of the ERROR_* constants.
|
||||||
*
|
*
|
||||||
* @param errorCode The error code corresponding to an ERROR_* value.
|
* @param errorCode The error code corresponding to an ERROR_* value.
|
||||||
* @param description A String describing the error.
|
* @param description A String describing the error.
|
||||||
* @param failingUrl The url that failed to load.
|
* @param failingUrl The url that failed to load.
|
||||||
*/
|
*/
|
||||||
public void onReceivedError(final int errorCode, final String description, final String failingUrl) {
|
public void onReceivedError(final int errorCode, final String description, final String failingUrl) {
|
||||||
final DroidGap me = this;
|
final DroidGap me = this;
|
||||||
@ -901,7 +901,7 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Display an error dialog and optionally exit application.
|
* Display an error dialog and optionally exit application.
|
||||||
*
|
*
|
||||||
* @param title
|
* @param title
|
||||||
* @param message
|
* @param message
|
||||||
* @param button
|
* @param button
|
||||||
@ -948,7 +948,7 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Hook in DroidGap for menu plugins
|
* Hook in DroidGap for menu plugins
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ -972,7 +972,7 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Activity context.
|
* Get Activity context.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Context getContext() {
|
public Context getContext() {
|
||||||
@ -981,7 +981,7 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Override the backbutton.
|
* Override the backbutton.
|
||||||
*
|
*
|
||||||
* @param override
|
* @param override
|
||||||
*/
|
*/
|
||||||
public void bindBackButton(boolean override) {
|
public void bindBackButton(boolean override) {
|
||||||
@ -990,7 +990,7 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine of backbutton is overridden.
|
* Determine of backbutton is overridden.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean isBackButtonBound() {
|
public boolean isBackButtonBound() {
|
||||||
@ -999,7 +999,7 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the specified URL in the Cordova webview or a new browser instance.
|
* Load the specified URL in the Cordova webview or a new browser instance.
|
||||||
*
|
*
|
||||||
* NOTE: If openExternal is false, only URLs listed in whitelist can be loaded.
|
* NOTE: If openExternal is false, only URLs listed in whitelist can be loaded.
|
||||||
*
|
*
|
||||||
* @param url The url to load.
|
* @param url The url to load.
|
||||||
@ -1046,8 +1046,12 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
|
|
||||||
// Create and show the dialog
|
// Create and show the dialog
|
||||||
splashDialog = new Dialog(this, android.R.style.Theme_Translucent_NoTitleBar);
|
splashDialog = new Dialog(this, android.R.style.Theme_Translucent_NoTitleBar);
|
||||||
splashDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
|
// check to see if the splash screen should be full screen
|
||||||
WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
if ((getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN)
|
||||||
|
== WindowManager.LayoutParams.FLAG_FULLSCREEN) {
|
||||||
|
splashDialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
|
||||||
|
WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||||
|
}
|
||||||
splashDialog.setContentView(root);
|
splashDialog.setContentView(root);
|
||||||
splashDialog.setCancelable(false);
|
splashDialog.setCancelable(false);
|
||||||
splashDialog.show();
|
splashDialog.show();
|
||||||
@ -1062,8 +1066,8 @@ public class DroidGap extends Activity implements CordovaInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a message is sent to plugin.
|
* Called when a message is sent to plugin.
|
||||||
*
|
*
|
||||||
* @param id The message id
|
* @param id The message id
|
||||||
* @param data The message data
|
* @param data The message data
|
||||||
* @return Object or null
|
* @return Object or null
|
||||||
|
Loading…
Reference in New Issue
Block a user