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

ant astyle

This commit is contained in:
Jesse Vincent 2011-03-22 18:07:32 +11:00
parent 81644d0f4b
commit e19162cb86
10 changed files with 100 additions and 104 deletions

View File

@ -37,8 +37,7 @@ public class ActivityListener extends MessagingListener {
String displayName = mLoadingFolderName;
if (K9.INBOX.equalsIgnoreCase(displayName)) {
displayName = context.getString(R.string.special_mailbox_name_inbox);
}
else if ((mAccount != null) && mAccount.getOutboxFolderName().equals(displayName)) {
} else if ((mAccount != null) && mAccount.getOutboxFolderName().equals(displayName)) {
displayName = context.getString(R.string.special_mailbox_name_outbox);
}

View File

@ -313,7 +313,7 @@ public class FolderList extends K9ListActivity {
if (previousData != null) {
mAdapter.mFolders = (ArrayList<FolderInfoHolder>) previousData;
mAdapter.mFilteredFolders = Collections.unmodifiableList(mAdapter.mFolders);
mAdapter.mFilteredFolders = Collections.unmodifiableList(mAdapter.mFolders);
}
}
@ -1029,7 +1029,7 @@ public class FolderList extends K9ListActivity {
return getItemView(position, convertView, parent);
} else {
Log.e(K9.LOG_TAG, "getView with illegal positon=" + position
+ " called! count is only " + getCount());
+ " called! count is only " + getCount());
return null;
}
}
@ -1136,77 +1136,77 @@ public class FolderList extends K9ListActivity {
return true;
}
public void setFilter(final Filter filter) {
this.mFilter = filter;
}
public void setFilter(final Filter filter) {
this.mFilter = filter;
}
public Filter getFilter() {
return mFilter;
}
public Filter getFilter() {
return mFilter;
}
/**
* Filter to search for occurences of the search-expression in any place of the
* folder-name instead of doing jsut a prefix-search.
*
* @author Marcus@Wolschon.biz
*/
public class FolderListFilter extends Filter {
/**
* Filter to search for occurences of the search-expression in any place of the
* folder-name instead of doing jsut a prefix-search.
*
* @author Marcus@Wolschon.biz
*/
public class FolderListFilter extends Filter {
/**
* Do the actual search.
* {@inheritDoc}
*
* @see #publishResults(CharSequence, FilterResults)
*/
@Override
protected FilterResults performFiltering(CharSequence searchTerm) {
FilterResults results = new FilterResults();
/**
* Do the actual search.
* {@inheritDoc}
*
* @see #publishResults(CharSequence, FilterResults)
*/
@Override
protected FilterResults performFiltering(CharSequence searchTerm) {
FilterResults results = new FilterResults();
if ((searchTerm == null) || (searchTerm.length() == 0)) {
ArrayList<FolderInfoHolder> list = new ArrayList<FolderInfoHolder>(mFolders);
results.values = list;
results.count = list.size();
} else {
final String searchTermString = searchTerm.toString().toLowerCase();
final String[] words = searchTermString.split(" ");
final int wordCount = words.length;
if ((searchTerm == null) || (searchTerm.length() == 0)) {
ArrayList<FolderInfoHolder> list = new ArrayList<FolderInfoHolder>(mFolders);
results.values = list;
results.count = list.size();
} else {
final String searchTermString = searchTerm.toString().toLowerCase();
final String[] words = searchTermString.split(" ");
final int wordCount = words.length;
final ArrayList<FolderInfoHolder> newValues = new ArrayList<FolderInfoHolder>();
final ArrayList<FolderInfoHolder> newValues = new ArrayList<FolderInfoHolder>();
for (final FolderInfoHolder value : mFolders) {
if (value.displayName == null) {
continue;
}
final String valueText = value.displayName.toLowerCase();
for (final FolderInfoHolder value : mFolders) {
if (value.displayName == null) {
continue;
}
final String valueText = value.displayName.toLowerCase();
for (int k = 0; k < wordCount; k++) {
if (valueText.contains(words[k])) {
newValues.add(value);
break;
}
}
}
for (int k = 0; k < wordCount; k++) {
if (valueText.contains(words[k])) {
newValues.add(value);
break;
}
}
}
results.values = newValues;
results.count = newValues.size();
}
results.values = newValues;
results.count = newValues.size();
}
return results;
}
return results;
}
/**
* Publish the results to the user-interface.
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
protected void publishResults(CharSequence constraint, FilterResults results) {
//noinspection unchecked
mFilteredFolders = Collections.unmodifiableList((ArrayList<FolderInfoHolder>) results.values);
// Send notification that the data set changed now
notifyDataSetChanged();
}
}
/**
* Publish the results to the user-interface.
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
protected void publishResults(CharSequence constraint, FilterResults results) {
//noinspection unchecked
mFilteredFolders = Collections.unmodifiableList((ArrayList<FolderInfoHolder>) results.values);
// Send notification that the data set changed now
notifyDataSetChanged();
}
}
}
static class FolderViewHolder {

View File

@ -101,24 +101,24 @@ public class FolderListFilter<T> extends Filter {
mFolders.setNotifyOnChange(false);
try {
//noinspection unchecked
final List<T> folders = (List<T>) results.values;
mFolders.clear();
if (folders != null) {
for (T folder : folders) {
if (folder != null) {
mFolders.add(folder);
}
}
} else {
Log.w(K9.LOG_TAG, "FolderListFilter.publishResults - null search-result ");
}
//noinspection unchecked
final List<T> folders = (List<T>) results.values;
mFolders.clear();
if (folders != null) {
for (T folder : folders) {
if (folder != null) {
mFolders.add(folder);
}
}
} else {
Log.w(K9.LOG_TAG, "FolderListFilter.publishResults - null search-result ");
}
// Send notification that the data set changed now
mFolders.notifyDataSetChanged();
// Send notification that the data set changed now
mFolders.notifyDataSetChanged();
} finally {
// restore notification status
mFolders.setNotifyOnChange(true);
// restore notification status
mFolders.setNotifyOnChange(true);
}
}

View File

@ -547,10 +547,10 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
if (!ACTION_EDIT_DRAFT.equals(action)) {
String bccAddress = mAccount.getAlwaysBcc();
if ((bccAddress != null) && !("".equals(bccAddress))) {
String[] bccAddresses = bccAddress.split(",");
for (String oneBccAddress : bccAddresses) {
addAddress(mBccView, new Address(oneBccAddress, ""));
}
String[] bccAddresses = bccAddress.split(",");
for (String oneBccAddress : bccAddresses) {
addAddress(mBccView, new Address(oneBccAddress, ""));
}
}
}

View File

@ -943,13 +943,13 @@ public class MessageView extends K9Activity implements OnClickListener {
@Override
protected Dialog onCreateDialog(final int id) {
switch (id) {
case R.id.dialog_confirm_delete:
return createConfirmDeleteDialog(id);
case R.id.dialog_attachment_progress:
ProgressDialog d = new ProgressDialog(this);
d.setIndeterminate(true);
d.setTitle(R.string.dialog_attachment_progress_title);
return d;
case R.id.dialog_confirm_delete:
return createConfirmDeleteDialog(id);
case R.id.dialog_attachment_progress:
ProgressDialog d = new ProgressDialog(this);
d.setIndeterminate(true);
d.setTitle(R.string.dialog_attachment_progress_title);
return d;
}
return super.onCreateDialog(id);
}

View File

@ -853,12 +853,10 @@ public class AccountSettings extends K9PreferenceActivity {
// TODO: In the future the call above should be changed to only return remote folders.
// For now we just remove the Outbox folder if present.
Iterator<? extends Folder> iter = folders.iterator();
while (iter.hasNext())
{
Iterator <? extends Folder > iter = folders.iterator();
while (iter.hasNext()) {
Folder folder = iter.next();
if (mAccount.getOutboxFolderName().equalsIgnoreCase(folder.getName()))
{
if (mAccount.getOutboxFolderName().equalsIgnoreCase(folder.getName())) {
iter.remove();
}
}

View File

@ -3016,7 +3016,7 @@ public class MessagingController implements Runnable {
Log.i(K9.LOG_TAG, "Send count for message " + message.getUid() + " is " + count.get());
if (count.incrementAndGet() > K9.MAX_SEND_ATTEMPTS) {
Log.e(K9.LOG_TAG, "Send count for message " + message.getUid() + " can't be delivered after "+ K9.MAX_SEND_ATTEMPTS + " attempts. Giving up until the user restarts the device");
Log.e(K9.LOG_TAG, "Send count for message " + message.getUid() + " can't be delivered after " + K9.MAX_SEND_ATTEMPTS + " attempts. Giving up until the user restarts the device");
notifySendTempFailed(account, new MessagingException(message.getSubject()));
continue;
}

View File

@ -1074,8 +1074,8 @@ public class HtmlConverter {
private static String htmlifyMessageHeader() {
final String font = K9.messageViewFixedWidthFont()
? "monospace"
: "sans-serif";
? "monospace"
: "sans-serif";
return "<pre style=\"white-space: pre-wrap; word-wrap:break-word; font-family: " + font + "\">";
}

View File

@ -87,7 +87,7 @@ public class EncoderUtil {
int encodedLength = bEncodedLength(bytes);
int totalLength = prefix.length() + encodedLength
+ ENC_WORD_SUFFIX.length();
+ ENC_WORD_SUFFIX.length();
if (totalLength <= ENCODED_WORD_MAX_LENGTH) {
return prefix + org.apache.james.mime4j.codec.EncoderUtil.encodeB(bytes) + ENC_WORD_SUFFIX;
} else {
@ -111,7 +111,7 @@ public class EncoderUtil {
int encodedLength = qEncodedLength(bytes);
int totalLength = prefix.length() + encodedLength
+ ENC_WORD_SUFFIX.length();
+ ENC_WORD_SUFFIX.length();
if (totalLength <= ENCODED_WORD_MAX_LENGTH) {
return prefix + org.apache.james.mime4j.codec.EncoderUtil.encodeQ(bytes, org.apache.james.mime4j.codec.EncoderUtil.Usage.WORD_ENTITY) + ENC_WORD_SUFFIX;
} else {

View File

@ -147,8 +147,7 @@ public class MimeHeader {
}
}
public void setCharset(String charset)
{
public void setCharset(String charset) {
mCharset = charset;
}
}