1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-25 00:58:50 -05:00

ran artistic style against src/com/fsck/k9/

This commit is contained in:
Jesse Vincent 2010-01-14 01:07:28 +00:00
parent 34379dc9be
commit 64469e4b4e
11 changed files with 99 additions and 85 deletions

View File

@ -193,31 +193,31 @@ public class K9 extends Application
public static final int CONNECTIVITY_ID = -3;
public static final int[] COLOR_CHIP_RES_IDS = new int[]
{
R.drawable.appointment_indicator_leftside_1,
R.drawable.appointment_indicator_leftside_2,
R.drawable.appointment_indicator_leftside_3,
R.drawable.appointment_indicator_leftside_4,
R.drawable.appointment_indicator_leftside_5,
R.drawable.appointment_indicator_leftside_6,
R.drawable.appointment_indicator_leftside_7,
R.drawable.appointment_indicator_leftside_8,
R.drawable.appointment_indicator_leftside_9,
R.drawable.appointment_indicator_leftside_10,
R.drawable.appointment_indicator_leftside_11,
R.drawable.appointment_indicator_leftside_12,
R.drawable.appointment_indicator_leftside_13,
R.drawable.appointment_indicator_leftside_14,
R.drawable.appointment_indicator_leftside_15,
R.drawable.appointment_indicator_leftside_16,
R.drawable.appointment_indicator_leftside_17,
R.drawable.appointment_indicator_leftside_18,
R.drawable.appointment_indicator_leftside_19,
R.drawable.appointment_indicator_leftside_20,
R.drawable.appointment_indicator_leftside_21,
};
{
R.drawable.appointment_indicator_leftside_1,
R.drawable.appointment_indicator_leftside_2,
R.drawable.appointment_indicator_leftside_3,
R.drawable.appointment_indicator_leftside_4,
R.drawable.appointment_indicator_leftside_5,
R.drawable.appointment_indicator_leftside_6,
R.drawable.appointment_indicator_leftside_7,
R.drawable.appointment_indicator_leftside_8,
R.drawable.appointment_indicator_leftside_9,
R.drawable.appointment_indicator_leftside_10,
R.drawable.appointment_indicator_leftside_11,
R.drawable.appointment_indicator_leftside_12,
R.drawable.appointment_indicator_leftside_13,
R.drawable.appointment_indicator_leftside_14,
R.drawable.appointment_indicator_leftside_15,
R.drawable.appointment_indicator_leftside_16,
R.drawable.appointment_indicator_leftside_17,
R.drawable.appointment_indicator_leftside_18,
R.drawable.appointment_indicator_leftside_19,
R.drawable.appointment_indicator_leftside_20,
R.drawable.appointment_indicator_leftside_21,
};
public class Intents
{

View File

@ -1522,7 +1522,7 @@ public class MessagingController implements Runnable
l.synchronizeMailboxAddOrUpdateMessage(account, folder, localMessage);
}
}
}
progress.incrementAndGet();
for (MessagingListener l : getListeners())
@ -4034,7 +4034,7 @@ public class MessagingController implements Runnable
String ringtone = thisAccount.getRingtone();
notif.sound = TextUtils.isEmpty(ringtone) || thisAccount.isRing() == false ? null : Uri.parse(ringtone);
if (thisAccount.isVibrate())
{
notif.defaults |= Notification.DEFAULT_VIBRATE;
@ -4643,7 +4643,7 @@ public class MessagingController implements Runnable
}
}
private Map<String, List<Message>> binMessages(Message[] messages)
{
Map<String, List<Message>> bins = new HashMap<String, List<Message>>();

View File

@ -493,7 +493,8 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
AdapterContextMenuInfo menuInfo = (AdapterContextMenuInfo)item.getMenuInfo();
// submenus don't actually set the menuInfo, so the "advanced"
// submenu wouldn't work.
if (menuInfo != null) {
if (menuInfo != null)
{
mSelectedContextAccount = (Account)getListView().getItemAtPosition(menuInfo.position);
}
switch (item.getItemId())
@ -672,9 +673,9 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
holder.description = (TextView) view.findViewById(R.id.description);
holder.email = (TextView) view.findViewById(R.id.email);
holder.newMessageCount = (TextView) view.findViewById(R.id.new_message_count);
holder.chip = view.findViewById(R.id.chip);
view.setTag(holder);
}
holder.description.setText(account.getDescription());
@ -705,11 +706,11 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
{
holder.chip.getBackground().setAlpha(127);
}
else
else
{
holder.chip.getBackground().setAlpha(255);
}
return view;
}

View File

@ -77,7 +77,7 @@ public class MessageList
private static final int WIDGET_FLAG = 2;
private static final int WIDGET_MULTISELECT = 3;
private ListView mListView;
private boolean mTouchView = true;
@ -308,7 +308,7 @@ public class MessageList
mController.loadMoreMessages(mAccount, mFolderName, mAdapter.mListener);
return;
}
else if ( mSelectedWidget == WIDGET_MULTISELECT || (mTouchView != false && mSelectedCount > 0) )
else if (mSelectedWidget == WIDGET_MULTISELECT || (mTouchView != false && mSelectedCount > 0))
{
// In multiselect mode make sure that clicking on the item results in
// toggling the 'selected' checkbox
@ -695,7 +695,10 @@ public class MessageList
public void cycleVisibleWidgets(boolean ascending)
{
if (mTouchView == true ) { return;}
if (mTouchView == true)
{
return;
}
if (ascending)
{
@ -1939,25 +1942,26 @@ public class MessageList
{
if (mTouchView)
{
view = mInflater.inflate(R.layout.message_list_item_touchable, parent, false);
view.setId(R.layout.message_list_item);
view = mInflater.inflate(R.layout.message_list_item_touchable, parent, false);
view.setId(R.layout.message_list_item);
}
else {
view = mInflater.inflate(R.layout.message_list_item, parent, false);
view.setId(R.layout.message_list_item);
View widgetParent;
if (mLeftHanded == false)
{
widgetParent = view.findViewById(R.id.widgets_right);
}
else
{
widgetParent = view.findViewById(R.id.widgets_left);
}
View widgets = mInflater.inflate(R.layout.message_list_widgets,parent,false);
widgets.setId(R.id.widgets);
((LinearLayout) widgetParent).addView(widgets);
view = mInflater.inflate(R.layout.message_list_item, parent, false);
view.setId(R.layout.message_list_item);
View widgetParent;
if (mLeftHanded == false)
{
widgetParent = view.findViewById(R.id.widgets_right);
}
else
{
widgetParent = view.findViewById(R.id.widgets_left);
}
View widgets = mInflater.inflate(R.layout.message_list_widgets,parent,false);
widgets.setId(R.id.widgets);
((LinearLayout) widgetParent).addView(widgets);
}
}
@ -2024,7 +2028,8 @@ public class MessageList
holder.subject.setText(message.subject);
if (holder.preview != null) {
if (holder.preview != null)
{
// in the touchable UI, we have previews
// otherwise, we have just a "from" line
// because text views can't wrap around each other(?)
@ -2033,13 +2038,15 @@ public class MessageList
holder.preview.setText(message.sender+ " " + message.preview, TextView.BufferType.SPANNABLE);
Spannable str = (Spannable)holder.preview.getText();
Spannable str = (Spannable)holder.preview.getText();
// Create our span sections, and assign a format to each.
str.setSpan(new TextAppearanceSpan(null ,Typeface.BOLD ,-1, holder.subject.getTextColors(), holder.subject.getLinkTextColors()), 0, message.sender.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
str.setSpan(new TextAppearanceSpan(null ,Typeface.BOLD ,-1, holder.subject.getTextColors(), holder.subject.getLinkTextColors()), 0, message.sender.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
} else {
}
else
{
holder.from.setText(message.sender);
holder.from.setTypeface(null, message.read ? Typeface.NORMAL : Typeface.BOLD);
@ -2058,14 +2065,17 @@ str.setSpan(new TextAppearanceSpan(null ,Typeface.BOLD ,-1, holder.subject.getTe
holder.chip.getBackground().setAlpha(0);
holder.subject.setText("No subject");
holder.subject.setTypeface(null, Typeface.NORMAL);
if (holder.preview != null) {
holder.preview.setText("No sender");
holder.preview.setTypeface(null, Typeface.NORMAL);
holder.preview.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
} else {
holder.from.setText("No sender");
holder.from.setTypeface(null, Typeface.NORMAL);
holder.from.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
if (holder.preview != null)
{
holder.preview.setText("No sender");
holder.preview.setTypeface(null, Typeface.NORMAL);
holder.preview.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
}
else
{
holder.from.setText("No sender");
holder.from.setTypeface(null, Typeface.NORMAL);
holder.from.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
}
@ -2416,7 +2426,7 @@ str.setSpan(new TextAppearanceSpan(null ,Typeface.BOLD ,-1, holder.subject.getTe
else
{
boolean newReadState = computeBatchDirection(false);
if (newReadState)
if (newReadState)
{
readButtonStringId = R.string.message_list_mark_read_action;
}

View File

@ -296,7 +296,7 @@ public class AccountSettings extends K9PreferenceActivity
mAccountVibrate = (CheckBoxPreference) findPreference(PREFERENCE_VIBRATE);
mAccountVibrate.setChecked(mAccount.isVibrate());
mAccountRing = (CheckBoxPreference) findPreference(PREFERENCE_RING);
mAccountRing.setChecked(mAccount.isRing());

View File

@ -126,7 +126,7 @@ public class Prefs extends K9PreferenceActivity
mLefthandedWidgets = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGELIST_LEFTHANDED_WIDGETS);
mLefthandedWidgets.setChecked(K9.messageListLefthandedWidgets());
mTouchable = (CheckBoxPreference)findPreference(PREFERENCE_MESSAGELIST_TOUCHABLE);
mTouchable.setChecked(K9.messageListTouchable());
}

View File

@ -20,7 +20,7 @@ import java.util.regex.Pattern;
public class MimeUtility
{
public static final String DEFAULT_ATTACHMENT_MIME_TYPE = "application/octet-stream";
/*
* http://www.w3schools.com/media/media_mimeref.asp
* + png
@ -557,10 +557,10 @@ public class MimeUtility
}
}
public static String getMimeTypeByExtension(String filename)
public static String getMimeTypeByExtension(String filename)
{
if (filename!=null
&& filename.lastIndexOf('.')!=-1)
&& filename.lastIndexOf('.')!=-1)
{
String extension = filename.substring(filename.lastIndexOf('.')+1).toLowerCase();
for (String[] contentTypeMapEntry : MIME_TYPE_BY_EXTENSION_MAP)

View File

@ -1369,11 +1369,11 @@ public class LocalStore extends Store implements Serializable
}
String oldUID = message.getUid();
if (K9.DEBUG)
Log.d(K9.LOG_TAG, "Updating folder_id to " + lDestFolder.getId() + " for message with UID "
+ message.getUid() + ", id " + lMessage.getId() + " currently in folder " + getName());
+ message.getUid() + ", id " + lMessage.getId() + " currently in folder " + getName());
message.setUid(K9.LOCAL_UID_PREFIX + UUID.randomUUID().toString());
mDb.execSQL("UPDATE messages " + "SET folder_id = ?, uid = ? " + "WHERE id = ?", new Object[]
@ -1942,7 +1942,8 @@ public class LocalStore extends Store implements Serializable
*/
public String calculateContentPreview(String text)
{
if (text == null) {
if (text == null)
{
return null;
}
@ -1951,7 +1952,8 @@ public class LocalStore extends Store implements Serializable
text = text.replaceAll("^On .*wrote.?$","");
text = text.replaceAll("(\\r|\\n)+"," ");
text = text.replaceAll("\\s+"," ");
if (text.length() <= 160) {
if (text.length() <= 160)
{
return text;
}
else
@ -2169,8 +2171,9 @@ public class LocalStore extends Store implements Serializable
return;
}
public String getPreview() {
return mPreview;
public String getPreview()
{
return mPreview;
}
@Override

View File

@ -90,8 +90,8 @@ public class BootReceiver extends CoreReceiver
AlarmManager alarmMgr = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
alarmMgr.cancel(pi);
}
return tmpWakeLockId;
}
@ -131,5 +131,5 @@ public class BootReceiver extends CoreReceiver
i.putExtra(ALARMED_INTENT, alarmedIntent);
context.sendBroadcast(i);
}
}

View File

@ -17,9 +17,9 @@ public class CoreReceiver extends BroadcastReceiver
{
public static String WAKE_LOCK_RELEASE = "com.fsck.k9.service.CoreReceiver.wakeLockRelease";
public static String WAKE_LOCK_ID = "com.fsck.k9.service.CoreReceiver.wakeLockId";
private static ConcurrentHashMap<Integer, WakeLock> wakeLocks = new ConcurrentHashMap<Integer, WakeLock>();
private static AtomicInteger wakeLockSeq = new AtomicInteger(0);
@ -58,9 +58,9 @@ public class CoreReceiver extends BroadcastReceiver
{
Integer tmpWakeLockId = CoreReceiver.getWakeLock(context);
try
{
{
if (K9.DEBUG)
Log.i(K9.LOG_TAG, "CoreReceiver.onReceive" + intent);
Log.i(K9.LOG_TAG, "CoreReceiver.onReceive" + intent);
if (CoreReceiver.WAKE_LOCK_RELEASE.equals(intent.getAction()))
{
Integer wakeLockId = intent.getIntExtra(WAKE_LOCK_ID, -1);
@ -81,7 +81,7 @@ public class CoreReceiver extends BroadcastReceiver
CoreReceiver.releaseWakeLock(tmpWakeLockId);
}
}
public Integer receive(Context context, Intent intent, Integer wakeLockId)
{
return wakeLockId;

View File

@ -37,7 +37,7 @@ public class MailService extends CoreService
private static final String HAS_CONNECTIVITY = "com.fsck.k9.intent.action.MAIL_SERVICE_HAS_CONNECTIVITY";
public static void actionReschedule(Context context, Integer wakeLockId)
{
@ -426,7 +426,7 @@ public class MailService extends CoreService
, K9.MAIL_SERVICE_WAKE_LOCK_TIMEOUT, startId);
}
public IBinder onBind(Intent intent)
{
return null;