@@ -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 ;
@@ -283,13 +283,13 @@ public void onCancel(DialogInterface dialog)
283
283
public synchronized void prompt (final String message , final String title , final JSONArray buttonLabels , final String defaultText , final CallbackContext callbackContext ) {
284
284
285
285
final CordovaInterface cordova = this .cordova ;
286
-
286
+
287
287
Runnable runnable = new Runnable () {
288
288
public void run () {
289
289
final EditText promptInput = new EditText (cordova .getActivity ());
290
-
291
- /* CB-11677 - By default, prompt input text color is set according current theme.
292
- But for some android versions is not visible (for example 5.1.1).
290
+
291
+ /* CB-11677 - By default, prompt input text color is set according current theme.
292
+ But for some android versions is not visible (for example 5.1.1).
293
293
android.R.color.primary_text_light will make text visible on all versions. */
294
294
Resources resources = cordova .getActivity ().getResources ();
295
295
int promptInputTextColor = resources .getColor (android .R .color .primary_text_light );
@@ -299,11 +299,11 @@ But for some android versions is not visible (for example 5.1.1).
299
299
dlg .setMessage (message );
300
300
dlg .setTitle (title );
301
301
dlg .setCancelable (true );
302
-
302
+
303
303
dlg .setView (promptInput );
304
-
304
+
305
305
final JSONObject result = new JSONObject ();
306
-
306
+
307
307
// First button
308
308
if (buttonLabels .length () > 0 ) {
309
309
try {
@@ -356,7 +356,7 @@ public void onClick(DialogInterface dialog, int which) {
356
356
try {
357
357
result .put ("buttonIndex" ,3 );
358
358
result .put ("input1" , promptInput .getText ().toString ().trim ().length ()==0 ? defaultText : promptInput .getText ());
359
- } catch (JSONException e ) {
359
+ } catch (JSONException e ) {
360
360
LOG .d (LOG_TAG ,"JSONException on third button." , e );
361
361
}
362
362
callbackContext .sendPluginResult (new PluginResult (PluginResult .Status .OK , result ));
@@ -479,7 +479,7 @@ public synchronized void progressStop() {
479
479
this .progressDialog = null ;
480
480
}
481
481
}
482
-
482
+
483
483
@ SuppressLint ("NewApi" )
484
484
private AlertDialog .Builder createDialog (CordovaInterface cordova ) {
485
485
int currentapiVersion = android .os .Build .VERSION .SDK_INT ;
@@ -499,7 +499,7 @@ private ProgressDialog createProgressDialog(CordovaInterface cordova) {
499
499
return new ProgressDialog (cordova .getActivity ());
500
500
}
501
501
}
502
-
502
+
503
503
@ SuppressLint ("NewApi" )
504
504
private void changeTextDirection (Builder dlg ){
505
505
int currentapiVersion = android .os .Build .VERSION .SDK_INT ;
0 commit comments