Skip to content

Commit

Permalink
Cleanup: remove trailing whitespace (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Brody committed Jan 27, 2019
1 parent 0057715 commit ed0e465
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/android/Notification.java
Expand Up @@ -43,15 +43,15 @@ Licensed to the Apache Software Foundation (ASF) under one
/**
* This class provides access to notifications on the device.
*
* Be aware that this implementation gets called on
* Be aware that this implementation gets called on
* navigator.notification.{alert|confirm|prompt}, and that there is a separate
* implementation in org.apache.cordova.CordovaChromeClient that gets
* called on a simple window.{alert|confirm|prompt}.
*/
public class Notification extends CordovaPlugin {

private static final String LOG_TAG = "Notification";

public int confirmResult = -1;
public ProgressDialog spinnerDialog = null;
public ProgressDialog progressDialog = null;
Expand All @@ -78,7 +78,7 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo
* be returned in the event of an invalid action.
*/
if(this.cordova.getActivity().isFinishing()) return true;

if (action.equals("beep")) {
this.beep(args.getLong(0));
}
Expand Down Expand Up @@ -281,15 +281,15 @@ public void onCancel(DialogInterface dialog)
* @param callbackContext The callback context.
*/
public synchronized void prompt(final String message, final String title, final JSONArray buttonLabels, final String defaultText, final CallbackContext callbackContext) {

final CordovaInterface cordova = this.cordova;

Runnable runnable = new Runnable() {
public void run() {
final EditText promptInput = new EditText(cordova.getActivity());
/* CB-11677 - By default, prompt input text color is set according current theme.
But for some android versions is not visible (for example 5.1.1).

/* CB-11677 - By default, prompt input text color is set according current theme.
But for some android versions is not visible (for example 5.1.1).
android.R.color.primary_text_light will make text visible on all versions. */
Resources resources = cordova.getActivity().getResources();
int promptInputTextColor = resources.getColor(android.R.color.primary_text_light);
Expand All @@ -299,11 +299,11 @@ But for some android versions is not visible (for example 5.1.1).
dlg.setMessage(message);
dlg.setTitle(title);
dlg.setCancelable(true);

dlg.setView(promptInput);

final JSONObject result = new JSONObject();

// First button
if (buttonLabels.length() > 0) {
try {
Expand All @@ -313,7 +313,7 @@ public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
try {
result.put("buttonIndex",1);
result.put("input1", promptInput.getText().toString().trim().length()==0 ? defaultText : promptInput.getText());
result.put("input1", promptInput.getText().toString().trim().length()==0 ? defaultText : promptInput.getText());
} catch (JSONException e) {
LOG.d(LOG_TAG,"JSONException on first button.", e);
}
Expand Down Expand Up @@ -356,7 +356,7 @@ public void onClick(DialogInterface dialog, int which) {
try {
result.put("buttonIndex",3);
result.put("input1", promptInput.getText().toString().trim().length()==0 ? defaultText : promptInput.getText());
} catch (JSONException e) {
} catch (JSONException e) {
LOG.d(LOG_TAG,"JSONException on third button.", e);
}
callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, result));
Expand Down Expand Up @@ -479,7 +479,7 @@ public synchronized void progressStop() {
this.progressDialog = null;
}
}

@SuppressLint("NewApi")
private AlertDialog.Builder createDialog(CordovaInterface cordova) {
int currentapiVersion = android.os.Build.VERSION.SDK_INT;
Expand All @@ -499,7 +499,7 @@ private ProgressDialog createProgressDialog(CordovaInterface cordova) {
return new ProgressDialog(cordova.getActivity());
}
}

@SuppressLint("NewApi")
private void changeTextDirection(Builder dlg){
int currentapiVersion = android.os.Build.VERSION.SDK_INT;
Expand Down

0 comments on commit ed0e465

Please sign in to comment.