Skip to content

Commit

Permalink
android: remove trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher J. Brody committed Oct 3, 2018
1 parent 234611f commit 53c6a34
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/android/Notification.java
Original file line number Diff line number Diff line change
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 @@ -282,13 +282,13 @@ public void onCancel(DialogInterface dialog)
*/
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 @@ -298,11 +298,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 @@ -312,7 +312,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 @@ -355,7 +355,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 @@ -478,7 +478,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 @@ -498,7 +498,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 53c6a34

Please sign in to comment.