diff --git a/.gitignore b/.gitignore index 6f19b35a..f2c38286 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ Desktop.ini # IntelliJ IDEA files *.iml .idea +npm-debug.log diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 43bb3265..fb0a709c 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -20,6 +20,17 @@ --> ## Release Notes for Cordova (Android) ## +### 3.6.4 (Sept 30, 2014) ### + +* Set VERSION to 3.6.4 (via coho) +* Update JS snapshot to version 3.6.4 (via coho) +* CB-7634 Detect JAVA_HOME properly on Ubuntu +* CB-7579 Fix run script's ability to use non-arch-specific APKs +* CB-6511 Fixes build for android when app name contains unicode characters. +* CB-7463: Adding licences. I don't know what the gradle syntax is for comments, that still needs to be done. +* CB-7463: Looked at the Apache BigTop git, gradle uses C-style comments +* CB-7460: Fixing bug with KitKat where the background colour would override the CSS colours on the application + ### 3.6.0 (Sept 2014) ### * Set VERSION to 3.6.0 (via coho) diff --git a/framework/assets/www/cordova.js b/framework/assets/www/cordova.js index c9e69350..a7773569 100644 --- a/framework/assets/www/cordova.js +++ b/framework/assets/www/cordova.js @@ -1,5 +1,5 @@ // Platform: android -// 3.7.0-dev-1258511 +// 8ca0f3b2b87e0759c5236b91c80f18438544409c /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file @@ -19,7 +19,7 @@ under the License. */ ;(function() { -var CORDOVA_JS_BUILD_LABEL = '3.7.0-dev-1258511'; +var PLATFORM_VERSION_BUILD_LABEL = '3.7.0-dev'; // file: src/scripts/require.js /*jshint -W079 */ @@ -175,7 +175,8 @@ function createEvent(type, data) { var cordova = { define:define, require:require, - version:CORDOVA_JS_BUILD_LABEL, + version:PLATFORM_VERSION_BUILD_LABEL, + platformVersion:PLATFORM_VERSION_BUILD_LABEL, platformId:platform.id, /** * Methods to add/remove your own addEventListener hijacking on document + window. @@ -1183,6 +1184,16 @@ function replaceNavigator(origNavigator) { for (var key in origNavigator) { if (typeof origNavigator[key] == 'function') { newNavigator[key] = origNavigator[key].bind(origNavigator); + } else { + (function(k) { + Object.defineProperty(newNavigator, k, { + get: function() { + return origNavigator[k]; + }, + configurable: true, + enumerable: true + }); + })(key); } } } @@ -1302,6 +1313,16 @@ function replaceNavigator(origNavigator) { for (var key in origNavigator) { if (typeof origNavigator[key] == 'function') { newNavigator[key] = origNavigator[key].bind(origNavigator); + } else { + (function(k) { + Object.defineProperty(newNavigator, k, { + get: function() { + return origNavigator[k]; + }, + configurable: true, + enumerable: true + }); + })(key); } } } diff --git a/framework/src/org/apache/cordova/AndroidChromeClient.java b/framework/src/org/apache/cordova/AndroidChromeClient.java index e4ebe968..ad6c4143 100755 --- a/framework/src/org/apache/cordova/AndroidChromeClient.java +++ b/framework/src/org/apache/cordova/AndroidChromeClient.java @@ -65,6 +65,9 @@ public class AndroidChromeClient extends WebChromeClient { // the video progress view private View mVideoProgressView; + //Keep track of last AlertDialog showed + private AlertDialog lastHandledDialog; + // File Chooser protected ValueCallback mUploadMessage; @@ -113,7 +116,7 @@ public class AndroidChromeClient extends WebChromeClient { return true; } }); - dlg.show(); + lastHandledDialog = dlg.show(); return true; } @@ -162,7 +165,7 @@ public class AndroidChromeClient extends WebChromeClient { return true; } }); - dlg.show(); + lastHandledDialog = dlg.show(); return true; } @@ -206,7 +209,7 @@ public class AndroidChromeClient extends WebChromeClient { res.cancel(); } }); - dlg.show(); + lastHandledDialog = dlg.show(); } return true; } @@ -314,4 +317,11 @@ public class AndroidChromeClient extends WebChromeClient { this.cordova.getActivity().startActivityForResult(Intent.createChooser(i, "File Browser"), FILECHOOSER_RESULTCODE); } + + public void destroyLastDialog(){ + if(lastHandledDialog != null){ + lastHandledDialog.cancel(); + } + } + } diff --git a/framework/src/org/apache/cordova/AndroidWebView.java b/framework/src/org/apache/cordova/AndroidWebView.java index 8986d583..98174763 100755 --- a/framework/src/org/apache/cordova/AndroidWebView.java +++ b/framework/src/org/apache/cordova/AndroidWebView.java @@ -603,6 +603,9 @@ public class AndroidWebView extends WebView implements CordovaWebView { // Load blank page so that JavaScript onunload is called this.loadUrl("about:blank"); + + //Remove last AlertDialog + this.chromeClient.destroyLastDialog(); // Forward to plugins if (this.pluginManager != null) { diff --git a/framework/src/org/apache/cordova/CordovaActivity.java b/framework/src/org/apache/cordova/CordovaActivity.java index 6ec6791c..e065a9b6 100755 --- a/framework/src/org/apache/cordova/CordovaActivity.java +++ b/framework/src/org/apache/cordova/CordovaActivity.java @@ -48,6 +48,7 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; +import android.view.ViewParent; import android.view.Window; import android.view.WindowManager; import android.webkit.WebViewClient; @@ -70,6 +71,7 @@ import android.widget.LinearLayout; * @Override * public void onCreate(Bundle savedInstanceState) { * super.onCreate(savedInstanceState); + * super.init(); * // Load your application * loadUrl(launchUrl); * } @@ -133,22 +135,14 @@ public class CordovaActivity extends Activity implements CordovaInterface { public void onCreate(Bundle savedInstanceState) { LOG.i(TAG, "Apache Cordova native platform version " + CordovaWebView.CORDOVA_VERSION + " is starting"); LOG.d(TAG, "CordovaActivity.onCreate()"); - super.onCreate(savedInstanceState); - if(savedInstanceState != null) - { - initCallbackClass = savedInstanceState.getString("callbackClass"); - } - + // need to activate preferences before super.onCreate to avoid "requestFeature() must be called before adding content" exception loadConfig(); - } - - protected void init() { if(!preferences.getBoolean("ShowTitle", false)) { getWindow().requestFeature(Window.FEATURE_NO_TITLE); } - + if(preferences.getBoolean("SetFullscreen", false)) { Log.d(TAG, "The SetFullscreen configuration is deprecated in favor of Fullscreen, and will be removed in a future version."); @@ -162,6 +156,15 @@ public class CordovaActivity extends Activity implements CordovaInterface { WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); } + super.onCreate(savedInstanceState); + + if(savedInstanceState != null) + { + initCallbackClass = savedInstanceState.getString("callbackClass"); + } + } + + protected void init() { appView = makeWebView(); // TODO: Have the views set this themselves. @@ -209,6 +212,13 @@ public class CordovaActivity extends Activity implements CordovaInterface { // Add web view but make it invisible while loading URL appView.getView().setVisibility(View.INVISIBLE); + // need to remove appView from any existing parent before invoking root.addView(appView) + ViewParent parent = appView.getView().getParent(); + if ((parent != null) && (parent != root)) { + LOG.d(TAG, "removing appView from existing parent"); + ViewGroup parentGroup = (ViewGroup) parent; + parentGroup.removeView(appView.getView()); + } root.addView(appView.getView()); setContentView(root); diff --git a/test/res/xml/config.xml b/test/res/xml/config.xml index 148bad5a..4370357c 100644 --- a/test/res/xml/config.xml +++ b/test/res/xml/config.xml @@ -34,6 +34,7 @@ + diff --git a/test/src/org/apache/cordova/test/junit/IntentUriOverrideTest.java b/test/src/org/apache/cordova/test/junit/IntentUriOverrideTest.java index 559bcc78..e84a8dca 100644 --- a/test/src/org/apache/cordova/test/junit/IntentUriOverrideTest.java +++ b/test/src/org/apache/cordova/test/junit/IntentUriOverrideTest.java @@ -75,6 +75,7 @@ public class IntentUriOverrideTest extends ActivityInstrumentationTestCase2