You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/07/07 19:10:13 UTC

[5/7] android commit: Deprecate some convenience methods on CordovaActivity

Deprecate some convenience methods on CordovaActivity

They don't add much convenience and the file is too big already.


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/b636874b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/b636874b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/b636874b

Branch: refs/heads/master
Commit: b636874bd934d90492e82d144d7de27eef44470b
Parents: 965e4e9
Author: Andrew Grieve <ag...@chromium.org>
Authored: Fri Jul 4 16:31:19 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Fri Jul 4 16:31:19 2014 -0400

----------------------------------------------------------------------
 .../src/org/apache/cordova/CordovaActivity.java      | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/b636874b/framework/src/org/apache/cordova/CordovaActivity.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaActivity.java b/framework/src/org/apache/cordova/CordovaActivity.java
index 97697fc..b1110e1 100755
--- a/framework/src/org/apache/cordova/CordovaActivity.java
+++ b/framework/src/org/apache/cordova/CordovaActivity.java
@@ -57,7 +57,7 @@ import android.widget.LinearLayout;
 
 /**
  * This class is the main Android activity that represents the Cordova
- * application.  It should be extended by the user to load the specific
+ * application. It should be extended by the user to load the specific
  * html file that contains the application.
  *
  * As an example:
@@ -91,9 +91,13 @@ public class CordovaActivity extends Activity implements CordovaInterface {
 
     // The webview for our app
     protected CordovaWebView appView;
+
+    @Deprecated // unused.
     protected CordovaWebViewClient webViewClient;
 
+    @Deprecated // Will be removed. Use findViewById() to retrieve views.
     protected LinearLayout root;
+
     protected ProgressDialog spinnerDialog = null;
     private final ExecutorService threadPool = Executors.newCachedThreadPool();
 
@@ -238,10 +242,8 @@ public class CordovaActivity extends Activity implements CordovaInterface {
 
     /**
      * Get the Android activity.
-     *
-     * @return the Activity
      */
-    public Activity getActivity() {
+    @Override public Activity getActivity() {
         return this;
     }
 
@@ -426,6 +428,7 @@ public class CordovaActivity extends Activity implements CordovaInterface {
     /**
      * Clear the resource cache.
      */
+    @Deprecated // Call method on appView directly.
     public void clearCache() {
         if (this.appView == null) {
             this.init();
@@ -436,6 +439,7 @@ public class CordovaActivity extends Activity implements CordovaInterface {
     /**
      * Clear web history in this web view.
      */
+    @Deprecated // Call method on appView directly.
     public void clearHistory() {
         this.appView.clearHistory();
     }
@@ -445,6 +449,7 @@ public class CordovaActivity extends Activity implements CordovaInterface {
      *
      * @return true if we went back, false if we are already at top
      */
+    @Deprecated // Call method on appView directly.
     public boolean backHistory() {
         if (this.appView != null) {
             return appView.backHistory();
@@ -727,6 +732,7 @@ public class CordovaActivity extends Activity implements CordovaInterface {
      *
      * @param statement
      */
+    @Deprecated // Call method on appView directly.
     public void sendJavascript(String statement) {
         if (this.appView != null) {
             this.appView.jsMessageQueue.addJavaScript(statement);
@@ -949,6 +955,7 @@ public class CordovaActivity extends Activity implements CordovaInterface {
      * @param clearHistory  Clear the history stack, so new page becomes top of history
      * @param params        Parameters for new app
      */
+    @Deprecated // Call method on appView directly.
     public void showWebPage(String url, boolean openExternal, boolean clearHistory, HashMap<String, Object> params) {
         if (this.appView != null) {
             appView.showWebPage(url, openExternal, clearHistory, params);