1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04:00

Fixed whitespace (tabs vs. spaces)

This commit is contained in:
cketti 2012-03-18 21:46:32 +01:00
parent 58c01c05b7
commit 6bdaac4353

View File

@ -46,7 +46,7 @@ public class ChooseFolder extends K9ListActivity {
boolean hideCurrentFolder = true; boolean hideCurrentFolder = true;
boolean showOptionNone = false; boolean showOptionNone = false;
boolean showDisplayableOnly = false; boolean showDisplayableOnly = false;
private List<String> folderList; private List<String> folderList;
/** /**
@ -216,7 +216,7 @@ public class ChooseFolder extends K9ListActivity {
return true; return true;
} }
case R.id.filter_folders: { case R.id.filter_folders: {
onEnterFilter(); onEnterFilter();
} }
return true; return true;
default: default:
@ -236,43 +236,43 @@ public class ChooseFolder extends K9ListActivity {
* Filter {@link #mAdapter} with the user-input. * Filter {@link #mAdapter} with the user-input.
*/ */
private void onEnterFilter() { private void onEnterFilter() {
final AlertDialog.Builder filterAlert = new AlertDialog.Builder(this); final AlertDialog.Builder filterAlert = new AlertDialog.Builder(this);
final EditText input = new EditText(this); final EditText input = new EditText(this);
input.addTextChangedListener(new TextWatcher() { input.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
mAdapter.getFilter().filter(input.getText().toString());
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
}
@Override
public void afterTextChanged(Editable s) {
}
});
input.setHint(R.string.folder_list_filter_hint);
filterAlert.setView(input);
filterAlert.setPositiveButton("Ok", new DialogInterface.OnClickListener() { @Override
public void onClick(DialogInterface dialog, int whichButton) { public void onTextChanged(CharSequence s, int start, int before, int count) {
String value = input.getText().toString().trim(); mAdapter.getFilter().filter(input.getText().toString());
mAdapter.getFilter().filter(value); }
}
});
filterAlert.setNegativeButton("Cancel", @Override
new DialogInterface.OnClickListener() { public void beforeTextChanged(CharSequence s, int start, int count,
public void onClick(DialogInterface dialog, int whichButton) { int after) {
mAdapter.getFilter().filter(""); }
}
});
filterAlert.show(); @Override
public void afterTextChanged(Editable s) {
}
});
input.setHint(R.string.folder_list_filter_hint);
filterAlert.setView(input);
filterAlert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
String value = input.getText().toString().trim();
mAdapter.getFilter().filter(value);
}
});
filterAlert.setNegativeButton("Cancel",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
mAdapter.getFilter().filter("");
}
});
filterAlert.show();
} }
@ -370,18 +370,18 @@ public class ChooseFolder extends K9ListActivity {
} }
}); });
int selectedFolder = -1; int selectedFolder = -1;
// We're not allowed to change the adapter from a background thread, so we use // We're not allowed to change the adapter from a background thread, so we use
// a java.util.List to build a list of the folder names. // a java.util.List to build a list of the folder names.
// We'll add the folder names to the adapter from the UI-thread (see the 'finally' block). // We'll add the folder names to the adapter from the UI-thread (see the 'finally' block).
folderList = new ArrayList<String>(); folderList = new ArrayList<String>();
try { try {
int position = 0; int position = 0;
for (String name : localFolders) { for (String name : localFolders) {
if (mAccount.getInboxFolderName().equalsIgnoreCase(name)) { if (mAccount.getInboxFolderName().equalsIgnoreCase(name)) {
folderList.add(getString(R.string.special_mailbox_name_inbox)); folderList.add(getString(R.string.special_mailbox_name_inbox));
heldInbox = name; heldInbox = name;
} else if (!K9.ERROR_FOLDER_NAME.equals(name) && !account.getOutboxFolderName().equals(name)) { } else if (!K9.ERROR_FOLDER_NAME.equals(name) && !account.getOutboxFolderName().equals(name)) {
folderList.add(name); folderList.add(name);
} }
if (mSelectFolder != null) { if (mSelectFolder != null) {
@ -402,11 +402,11 @@ public class ChooseFolder extends K9ListActivity {
} finally { } finally {
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
public void run() { public void run() {
// Now we're in the UI-thread, we can safely change the contents of the adapter. // Now we're in the UI-thread, we can safely change the contents of the adapter.
mAdapter.clear(); mAdapter.clear();
for (String folderName: folderList) { for (String folderName: folderList) {
mAdapter.add(folderName); mAdapter.add(folderName);
} }
} }
}); });
} }