@@ -43,15 +43,15 @@ Licensed to the Apache Software Foundation (ASF) under one
43
43
/**
44
44
* This class provides access to notifications on the device.
45
45
*
46
- * Be aware that this implementation gets called on
46
+ * Be aware that this implementation gets called on
47
47
* navigator.notification.{alert|confirm|prompt}, and that there is a separate
48
48
* implementation in org.apache.cordova.CordovaChromeClient that gets
49
49
* called on a simple window.{alert|confirm|prompt}.
50
50
*/
51
51
public class Notification extends CordovaPlugin {
52
52
53
53
private static final String LOG_TAG = "Notification" ;
54
-
54
+
55
55
public int confirmResult = -1 ;
56
56
public ProgressDialog spinnerDialog = null ;
57
57
public ProgressDialog progressDialog = null ;
@@ -78,7 +78,7 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo
78
78
* be returned in the event of an invalid action.
79
79
*/
80
80
if (this .cordova .getActivity ().isFinishing ()) return true ;
81
-
81
+
82
82
if (action .equals ("beep" )) {
83
83
this .beep (args .getLong (0 ));
84
84
}
@@ -282,13 +282,13 @@ public void onCancel(DialogInterface dialog)
282
282
*/
283
283
public synchronized void prompt (final String message , final String title , final JSONArray buttonLabels , final String defaultText , final CallbackContext callbackContext ) {
284
284
final CordovaInterface cordova = this .cordova ;
285
-
285
+
286
286
Runnable runnable = new Runnable () {
287
287
public void run () {
288
288
final EditText promptInput = new EditText (cordova .getActivity ());
289
-
290
- /* CB-11677 - By default, prompt input text color is set according current theme.
291
- But for some android versions is not visible (for example 5.1.1).
289
+
290
+ /* CB-11677 - By default, prompt input text color is set according current theme.
291
+ But for some android versions is not visible (for example 5.1.1).
292
292
android.R.color.primary_text_light will make text visible on all versions. */
293
293
Resources resources = cordova .getActivity ().getResources ();
294
294
int promptInputTextColor = resources .getColor (android .R .color .primary_text_light );
@@ -298,11 +298,11 @@ But for some android versions is not visible (for example 5.1.1).
298
298
dlg .setMessage (message );
299
299
dlg .setTitle (title );
300
300
dlg .setCancelable (true );
301
-
301
+
302
302
dlg .setView (promptInput );
303
-
303
+
304
304
final JSONObject result = new JSONObject ();
305
-
305
+
306
306
// First button
307
307
if (buttonLabels .length () > 0 ) {
308
308
try {
@@ -312,7 +312,7 @@ public void onClick(DialogInterface dialog, int which) {
312
312
dialog .dismiss ();
313
313
try {
314
314
result .put ("buttonIndex" ,1 );
315
- result .put ("input1" , promptInput .getText ().toString ().trim ().length ()==0 ? defaultText : promptInput .getText ());
315
+ result .put ("input1" , promptInput .getText ().toString ().trim ().length ()==0 ? defaultText : promptInput .getText ());
316
316
} catch (JSONException e ) {
317
317
LOG .d (LOG_TAG ,"JSONException on first button." , e );
318
318
}
@@ -355,7 +355,7 @@ public void onClick(DialogInterface dialog, int which) {
355
355
try {
356
356
result .put ("buttonIndex" ,3 );
357
357
result .put ("input1" , promptInput .getText ().toString ().trim ().length ()==0 ? defaultText : promptInput .getText ());
358
- } catch (JSONException e ) {
358
+ } catch (JSONException e ) {
359
359
LOG .d (LOG_TAG ,"JSONException on third button." , e );
360
360
}
361
361
callbackContext .sendPluginResult (new PluginResult (PluginResult .Status .OK , result ));
@@ -478,7 +478,7 @@ public synchronized void progressStop() {
478
478
this .progressDialog = null ;
479
479
}
480
480
}
481
-
481
+
482
482
@ SuppressLint ("NewApi" )
483
483
private AlertDialog .Builder createDialog (CordovaInterface cordova ) {
484
484
int currentapiVersion = android .os .Build .VERSION .SDK_INT ;
@@ -498,7 +498,7 @@ private ProgressDialog createProgressDialog(CordovaInterface cordova) {
498
498
return new ProgressDialog (cordova .getActivity ());
499
499
}
500
500
}
501
-
501
+
502
502
@ SuppressLint ("NewApi" )
503
503
private void changeTextDirection (Builder dlg ){
504
504
int currentapiVersion = android .os .Build .VERSION .SDK_INT ;
0 commit comments