mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-20 23:56:20 +08:00
CB-5489: clean up docs for deprecated methods
- fixed grammer in log message in Config.java - updated the class javadoc in CordovaActivity to catch up to reality: use config.xml instead of set*Property() methods. - added deprecation message for SetFullscreen
This commit is contained in:
parent
adba84ae6a
commit
1482c07ae4
@ -99,7 +99,7 @@ public class Config {
|
||||
}
|
||||
else if (strNode.equals("log")) {
|
||||
String level = xml.getAttributeValue(null, "level");
|
||||
Log.d(TAG, "The <log> tags is deprecated. Use <preference name=\"loglevel\" value=\"" + level + "\"/> instead.");
|
||||
Log.d(TAG, "The <log> tag is deprecated. Use <preference name=\"loglevel\" value=\"" + level + "\"/> instead.");
|
||||
if (level != null) {
|
||||
LOG.setLogLevel(level);
|
||||
}
|
||||
|
@ -66,6 +66,7 @@ import android.widget.LinearLayout;
|
||||
*
|
||||
* <pre>
|
||||
* package org.apache.cordova.examples;
|
||||
*
|
||||
* import android.os.Bundle;
|
||||
* import org.apache.cordova.*;
|
||||
*
|
||||
@ -73,63 +74,19 @@ import android.widget.LinearLayout;
|
||||
* @Override
|
||||
* public void onCreate(Bundle savedInstanceState) {
|
||||
* super.onCreate(savedInstanceState);
|
||||
*
|
||||
* // Set properties for activity
|
||||
* super.setStringProperty("loadingDialog", "Title,Message"); // show loading dialog
|
||||
* super.setStringProperty("errorUrl", "file:///android_asset/www/error.html"); // if error loading file in super.loadUrl().
|
||||
*
|
||||
* // Clear cache if you want
|
||||
* super.appView.clearCache(true);
|
||||
*
|
||||
* super.init();
|
||||
* // Load your application
|
||||
* super.setIntegerProperty("splashscreen", R.drawable.splash); // load splash.jpg image from the resource drawable directory
|
||||
* super.loadUrl("file:///android_asset/www/index.html", 3000); // show splash screen 3 sec before loading app
|
||||
* super.loadUrl(Config.getStartUrl());
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* Properties: The application can be configured using the following properties:
|
||||
*
|
||||
* <pre>
|
||||
* // Display a native loading dialog when loading app. Format for value = "Title,Message".
|
||||
* // (String - default=null)
|
||||
* super.setStringProperty("loadingDialog", "Wait,Loading Demo...");
|
||||
* Cordova xml configuration: Cordova uses a configuration file at
|
||||
* res/xml/config.xml to specify its settings. See "The config.xml File"
|
||||
* guide in cordova-docs at http://cordova.apache.org/docs for the documentation
|
||||
* for the configuration. The use of the set*Property() methods is
|
||||
* deprecated in favor of the config.xml file.
|
||||
*
|
||||
* // Display a native loading dialog when loading sub-pages. Format for value = "Title,Message".
|
||||
* // (String - default=null)
|
||||
* super.setStringProperty("loadingPageDialog", "Loading page...");
|
||||
*
|
||||
* // Load a splash screen image from the resource drawable directory.
|
||||
* // (Integer - default=0)
|
||||
* super.setIntegerProperty("splashscreen", R.drawable.splash);
|
||||
*
|
||||
* // Set the background color.
|
||||
* // (Integer - default=0 or BLACK)
|
||||
* super.setIntegerProperty("backgroundColor", Color.WHITE);
|
||||
*
|
||||
* // Time in msec to wait before triggering a timeout error when loading
|
||||
* // with super.loadUrl(). (Integer - default=20000)
|
||||
* super.setIntegerProperty("loadUrlTimeoutValue", 60000);
|
||||
*
|
||||
* // URL to load if there's an error loading specified URL with loadUrl().
|
||||
* // Should be a local URL starting with file://. (String - default=null)
|
||||
* super.setStringProperty("errorUrl", "file:///android_asset/www/error.html");
|
||||
*
|
||||
* // Enable app to keep running in background. (Boolean - default=true)
|
||||
* super.setBooleanProperty("keepRunning", false);
|
||||
* </pre>
|
||||
*
|
||||
* Cordova.xml configuration:
|
||||
*
|
||||
* <pre>
|
||||
* Cordova uses a configuration file at res/xml/cordova.xml to specify the following settings.
|
||||
*
|
||||
* Approved list of URLs that can be loaded into Cordova
|
||||
* <access origin="http://server regexp" subdomains="true" />
|
||||
* Log level: ERROR, WARN, INFO, DEBUG, VERBOSE (default=ERROR)
|
||||
* <log level="DEBUG" />
|
||||
* </pre>
|
||||
*
|
||||
*/
|
||||
public class CordovaActivity extends Activity implements CordovaInterface {
|
||||
public static String TAG = "CordovaActivity";
|
||||
@ -272,6 +229,7 @@ public class CordovaActivity extends Activity implements CordovaInterface {
|
||||
|
||||
if(this.getBooleanProperty("SetFullscreen", false))
|
||||
{
|
||||
Log.d(TAG, "The SetFullscreen configuration is deprecated in favor of Fullscreen, and will be removed in a future version.");
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user