cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject git commit: [CB-6628][amazon-fireos]dialogs plugin's confirm and prompt methods dont work confirm() method was missing amazon-fireos platform check. added that. prompt() method had bug. It is executed in a worker thread that does not have a message queue
Date Tue, 06 May 2014 22:26:00 GMT
Repository: cordova-plugin-dialogs
Updated Branches:
  refs/heads/master 8ca164890 -> a8f5e5ff5


[CB-6628][amazon-fireos]dialogs plugin's confirm and prompt methods dont work
confirm() method was missing amazon-fireos platform check. added that.
prompt() method had bug. It is executed in a worker thread that does not have a message queue(or
Looper object) associated with it and hence "can't create a handler" exception is thrown.
To fix this issue, we need to create the EditText widget from within the UI thread. This was
fixed sometime ago when we added fireos platform but commit got lost somewhere. So fixing
it again now.


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

Branch: refs/heads/master
Commit: a8f5e5ff524a4e23fcc8dcfcd5af86c0daec83fd
Parents: 8ca1648
Author: Archana Naik <naika@lab126.com>
Authored: Fri May 2 18:21:51 2014 -0700
Committer: Archana Naik <naika@lab126.com>
Committed: Fri May 2 18:21:51 2014 -0700

----------------------------------------------------------------------
 src/android/Notification.java | 4 ++--
 www/notification.js           | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/blob/a8f5e5ff/src/android/Notification.java
----------------------------------------------------------------------
diff --git a/src/android/Notification.java b/src/android/Notification.java
index 3738545..1808dfe 100755
--- a/src/android/Notification.java
+++ b/src/android/Notification.java
@@ -260,11 +260,11 @@ public class Notification extends CordovaPlugin {
     public synchronized void prompt(final String message, final String title, final JSONArray
buttonLabels, final String defaultText, final CallbackContext callbackContext) {
   	
         final CordovaInterface cordova = this.cordova;
-        final EditText promptInput =  new EditText(cordova.getActivity());
-        promptInput.setHint(defaultText);
        
         Runnable runnable = new Runnable() {
             public void run() {
+                final EditText promptInput =  new EditText(cordova.getActivity());
+                promptInput.setHint(defaultText);
                 AlertDialog.Builder dlg = new AlertDialog.Builder(cordova.getActivity());
                 dlg.setMessage(message);
                 dlg.setTitle(title);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/blob/a8f5e5ff/www/notification.js
----------------------------------------------------------------------
diff --git a/www/notification.js b/www/notification.js
index c357fdc..c13806f 100644
--- a/www/notification.js
+++ b/www/notification.js
@@ -63,7 +63,7 @@ module.exports = {
         // Some platforms take an array of button label names.
         // Other platforms take a comma separated list.
         // For compatibility, we convert to the desired type based on the platform.
-        if (platform.id == "android" || platform.id == "ios" || platform.id == "windowsphone"
|| platform.id == "firefoxos" || platform.id == "ubuntu") {
+        if (platform.id == "amazon-fireos" || platform.id == "android" || platform.id ==
"ios" || platform.id == "windowsphone" || platform.id == "firefoxos" || platform.id == "ubuntu")
{
 
             if (typeof _buttonLabels === 'string') {
                 var buttonLabelString = _buttonLabels;


Mime
View raw message