From 942d17981ee40463605b1f9c233806e7be3f0518 Mon Sep 17 00:00:00 2001 From: Andrew Grieve Date: Thu, 27 Feb 2014 12:29:15 -0500 Subject: [PATCH 1/7] CB-6114 Incremented plugin version on dev branch. --- plugin.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.xml b/plugin.xml index 77adc5c..aeb8dbd 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="0.3.3-dev"> InAppBrowser Cordova InAppBrowser Plugin From a5201cc1e3adc11d47f5feba873231f677431b9b Mon Sep 17 00:00:00 2001 From: Andrew Grieve Date: Thu, 27 Feb 2014 15:36:31 -0500 Subject: [PATCH 2/7] Add NOTICE file --- NOTICE | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NOTICE b/NOTICE index 4d37500..8ec56a5 100644 --- a/NOTICE +++ b/NOTICE @@ -1 +1,5 @@ -Icons used in ths plugin are reproduced from work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. +Apache Cordova +Copyright 2012 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). From 6f373f7ed9993b81f5b735e3ee347e516585a916 Mon Sep 17 00:00:00 2001 From: Oliver Moran Date: Fri, 28 Feb 2014 19:58:14 +0000 Subject: [PATCH 3/7] fix for CB-5534 Signed-off-by: Joe Bowser --- src/android/InAppBrowser.java | 29 ++++++++++------ src/android/InAppBrowserDialog.java | 54 +++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 11 deletions(-) create mode 100644 src/android/InAppBrowserDialog.java diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java index 16ecd70..796036f 100644 --- a/src/android/InAppBrowser.java +++ b/src/android/InAppBrowser.java @@ -19,9 +19,8 @@ package org.apache.cordova.inappbrowser; import android.annotation.SuppressLint; -import android.app.Dialog; +import org.apache.cordova.inappbrowser.InAppBrowserDialog; import android.content.Context; -import android.content.DialogInterface; import android.content.Intent; import android.content.res.Resources; import android.graphics.Bitmap; @@ -80,7 +79,7 @@ public class InAppBrowser extends CordovaPlugin { private static final String CLEAR_ALL_CACHE = "clearcache"; private static final String CLEAR_SESSION_CACHE = "clearsessioncache"; - private Dialog dialog; + private InAppBrowserDialog dialog; private WebView inAppWebView; private EditText edittext; private CallbackContext callbackContext; @@ -337,12 +336,21 @@ public class InAppBrowser extends CordovaPlugin { this.cordova.getActivity().runOnUiThread(new Runnable() { @Override public void run() { - childView.loadUrl("about:blank"); + childView.setWebViewClient(new WebViewClient() { + // NB: wait for about:blank before dismissing + public void onPageFinished(WebView view, String url) { if (dialog != null) { dialog.dismiss(); } } }); + // NB: From SDK 19: "If you call methods on WebView from any thread + // other than your app's UI thread, it can cause unexpected results." + // http://developer.android.com/guide/webapps/migrating.html#Threads + childView.loadUrl("about:blank"); + } + }); + try { JSONObject obj = new JSONObject(); obj.put("type", EXIT_EVENT); @@ -350,7 +358,6 @@ public class InAppBrowser extends CordovaPlugin { } catch (JSONException ex) { Log.d(LOG_TAG, "Should never happen"); } - } /** @@ -398,6 +405,10 @@ public class InAppBrowser extends CordovaPlugin { return this.showLocationBar; } + private InAppBrowser getInAppBrowser(){ + return this; + } + /** * Display a new browser with the specified URL. * @@ -448,15 +459,11 @@ public class InAppBrowser extends CordovaPlugin { public void run() { // Let's create the main dialog - dialog = new Dialog(cordova.getActivity(), android.R.style.Theme_NoTitleBar); + dialog = new InAppBrowserDialog(cordova.getActivity(), android.R.style.Theme_NoTitleBar); dialog.getWindow().getAttributes().windowAnimations = android.R.style.Animation_Dialog; dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setCancelable(true); - dialog.setOnDismissListener(new DialogInterface.OnDismissListener() { - public void onDismiss(DialogInterface dialog) { - closeDialog(); - } - }); + dialog.setInAppBroswer(getInAppBrowser()); // Main container layout LinearLayout main = new LinearLayout(cordova.getActivity()); diff --git a/src/android/InAppBrowserDialog.java b/src/android/InAppBrowserDialog.java new file mode 100644 index 0000000..124e211 --- /dev/null +++ b/src/android/InAppBrowserDialog.java @@ -0,0 +1,54 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +*/ +package org.apache.cordova.inappbrowser; + +import android.app.AlertDialog; +import android.app.Dialog; +import android.content.Context; +import android.util.Log; + +import org.json.JSONException; +import org.json.JSONObject; + +/** + * Created by Oliver on 22/11/2013. + */ +public class InAppBrowserDialog extends Dialog { + Context context; + InAppBrowser inAppBrowser = null; + + public InAppBrowserDialog(Context context, int theme) { + super(context, theme); + this.context = context; + } + + public void setInAppBroswer(InAppBrowser browser) { + this.inAppBrowser = browser; + } + + public void onBackPressed () { + if (this.inAppBrowser == null) { + this.dismiss(); + } else { + // better to go through the in inAppBrowser + // because it does a clean up + this.inAppBrowser.closeDialog(); + } + } +} From 497a23efc77cf0262497071cdc5c30fb94e01d99 Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Fri, 28 Feb 2014 14:03:57 -0800 Subject: [PATCH 4/7] CB-5534: Updating the plugin.xml with the new Dialog class --- plugin.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin.xml b/plugin.xml index aeb8dbd..e4b31aa 100644 --- a/plugin.xml +++ b/plugin.xml @@ -27,6 +27,7 @@ + From d0dd10103c9e2ff7833e008188c26a6505ea6b96 Mon Sep 17 00:00:00 2001 From: Andrew Grieve Date: Wed, 5 Mar 2014 12:33:31 -0500 Subject: [PATCH 5/7] CB-6172 Fix inappbrowser install failure on case-sensitive filesystems. --- www/{InAppBrowser.js => inappbrowser.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename www/{InAppBrowser.js => inappbrowser.js} (100%) diff --git a/www/InAppBrowser.js b/www/inappbrowser.js similarity index 100% rename from www/InAppBrowser.js rename to www/inappbrowser.js From a5dedae6310f8c211596455cbd5f4214b0c8c508 Mon Sep 17 00:00:00 2001 From: Andrew Grieve Date: Wed, 5 Mar 2014 14:37:10 -0500 Subject: [PATCH 6/7] Updated version and RELEASENOTES.md for release 0.3.3 --- RELEASENOTES.md | 4 ++++ plugin.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 293e125..2d40026 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -78,3 +78,7 @@ * Validate that callbackId is correctly formed * CB-6035 Move js-module so it is not loaded on unsupported platforms * Removed some iOS6 Deprecations + +### 0.3.3 (Mar 5, 2014) +* CB-6172 Fix broken install on case-sensitive file-systems + diff --git a/plugin.xml b/plugin.xml index e4b31aa..932ff83 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="0.3.3"> InAppBrowser Cordova InAppBrowser Plugin From e282cc9e387e405a9103b2afa2b1a7a2b6232833 Mon Sep 17 00:00:00 2001 From: Bryan Higgins Date: Tue, 11 Mar 2014 12:22:17 -0400 Subject: [PATCH 7/7] CB-6218 Update docs for BB10 --- doc/index.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/doc/index.md b/doc/index.md index 61f702c..e82b29b 100644 --- a/doc/index.md +++ b/doc/index.md @@ -133,7 +133,6 @@ The object returned from a call to `window.open`. - Amazon Fire OS - Android -- BlackBerry 10 - iOS - Windows Phone 7 and 8 @@ -164,7 +163,6 @@ The function is passed an `InAppBrowserEvent` object. - Amazon Fire OS - Android -- BlackBerry 10 - iOS - Windows Phone 7 and 8 @@ -187,7 +185,6 @@ The function is passed an `InAppBrowserEvent` object. - Amazon Fire OS - Android -- BlackBerry 10 - iOS - Windows Phone 7 and 8 @@ -208,7 +205,6 @@ The function is passed an `InAppBrowserEvent` object. - Amazon Fire OS - Android -- BlackBerry 10 - iOS ### Quick Example @@ -240,7 +236,6 @@ The function is passed an `InAppBrowserEvent` object. - Amazon Fire OS - Android -- BlackBerry 10 - iOS ### Quick Example @@ -268,7 +263,6 @@ The function is passed an `InAppBrowserEvent` object. - Amazon Fire OS - Android -- BlackBerry 10 - iOS ### Quick Example