1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-25 09:08:49 -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,29 +193,29 @@ 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

@ -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())

View File

@ -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);
}

View File

@ -560,7 +560,7 @@ public class MimeUtility
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

@ -1372,7 +1372,7 @@ public class LocalStore extends Store implements Serializable
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());
@ -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

@ -60,7 +60,7 @@ public class CoreReceiver extends BroadcastReceiver
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);