incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bra...@apache.org
Subject [3/18] android commit: Port SplashScreen to CordovaPlugin. Untested, no tests for it.
Date Fri, 12 Oct 2012 21:06:18 GMT
Port SplashScreen to CordovaPlugin. Untested, no tests for it.


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

Branch: refs/heads/master
Commit: 29a0b010daaab5a4451cc4e087dc5159f87e321f
Parents: 621e116
Author: Braden Shepherdson <braden@chromium.org>
Authored: Fri Oct 12 17:00:14 2012 -0400
Committer: Braden Shepherdson <braden@chromium.org>
Committed: Fri Oct 12 17:00:14 2012 -0400

----------------------------------------------------------------------
 framework/src/org/apache/cordova/SplashScreen.java |   17 +++++++--------
 1 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/29a0b010/framework/src/org/apache/cordova/SplashScreen.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/SplashScreen.java b/framework/src/org/apache/cordova/SplashScreen.java
index 93ab628..66b5bae 100644
--- a/framework/src/org/apache/cordova/SplashScreen.java
+++ b/framework/src/org/apache/cordova/SplashScreen.java
@@ -19,26 +19,25 @@
 
 package org.apache.cordova;
 
-import org.apache.cordova.api.Plugin;
-import org.apache.cordova.api.PluginResult;
+import org.apache.cordova.api.CallbackContext;
+import org.apache.cordova.api.CordovaPlugin;
 import org.json.JSONArray;
 
-public class SplashScreen extends Plugin {
+public class SplashScreen extends CordovaPlugin {
 
     @Override
-    public PluginResult execute(String action, JSONArray args, String callbackId) {
-        PluginResult.Status status = PluginResult.Status.OK;
-        String result = "";
-
+    public boolean execute(String action, JSONArray args, CallbackContext callbackContext)
{
         if (action.equals("hide")) {
             this.webView.postMessage("splashscreen", "hide");
         } else if (action.equals("show")){
             this.webView.postMessage("splashscreen", "show");
         }
         else {
-            status = PluginResult.Status.INVALID_ACTION;
+            return false;
         }
-        return new PluginResult(status, result);
+
+        callbackContext.success();
+        return true;
     }
 
 }


Mime
View raw message