mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-31 15:20:09 -05:00
whitespace
This commit is contained in:
parent
f2b2fddd5a
commit
d352b8a4a5
@ -509,7 +509,6 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
{
|
||||
Toast.makeText(MessageView.this,
|
||||
R.string.status_network_error, Toast.LENGTH_LONG).show();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -522,7 +521,6 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
{
|
||||
Toast.makeText(MessageView.this,
|
||||
R.string.status_invalid_id_error, Toast.LENGTH_LONG).show();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -536,8 +534,6 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
Toast.makeText(MessageView.this, String.format(
|
||||
getString(R.string.message_view_status_attachment_saved), filename),
|
||||
Toast.LENGTH_LONG).show();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -548,11 +544,9 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
|
||||
Toast.makeText(MessageView.this,
|
||||
getString(R.string.message_view_status_attachment_not_saved),
|
||||
Toast.LENGTH_LONG).show();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -1053,22 +1047,18 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
mMessageReference = ref;
|
||||
if (K9.DEBUG)
|
||||
Log.d(K9.LOG_TAG, "MessageView displaying message " + mMessageReference);
|
||||
|
||||
mAccount = Preferences.getPreferences(this).getAccount(mMessageReference.accountUuid);
|
||||
mTopView.setVisibility(View.GONE);
|
||||
mTopView.scrollTo(0, 0);
|
||||
mMessageContentView.scrollTo(0, 0);
|
||||
|
||||
mHandler.hideHeaderContainer();
|
||||
mMessageContentView.clearView();
|
||||
setLoadPictures(false);
|
||||
mAttachments.removeAllViews();
|
||||
findSurroundingMessagesUid();
|
||||
|
||||
// start with fresh, empty PGP data
|
||||
mPgpData = null;
|
||||
initializeCrypto();
|
||||
|
||||
mTopView.setVisibility(View.VISIBLE);
|
||||
MessagingController.getInstance(getApplication()).loadMessageForView(
|
||||
mAccount,
|
||||
@ -1628,16 +1618,12 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
mDownloadRemainder.setEnabled(false);
|
||||
MessagingController.getInstance(getApplication()).loadMessageForViewRemote(
|
||||
mAccount,
|
||||
mMessageReference.folderName,
|
||||
mMessageReference.uid,
|
||||
mListener);
|
||||
|
||||
}
|
||||
|
||||
private void onDownloadAttachment(Attachment attachment)
|
||||
@ -1842,11 +1828,10 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
prepareMenuItems();
|
||||
return super.onPrepareOptionsMenu(menu);
|
||||
}
|
||||
|
||||
// TODO: when switching to API version 8, override onCreateDialog(int, Bundle)
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* The id of the dialog.
|
||||
* @param id The id of the dialog.
|
||||
* @return The dialog. If you return null, the dialog will not be created.
|
||||
* @see android.app.Activity#onCreateDialog(int)
|
||||
*/
|
||||
@ -1873,7 +1858,6 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
{
|
||||
flagItem.setTitle((mMessage.isSet(Flag.FLAGGED) ? R.string.unflag_action : R.string.flag_action));
|
||||
}
|
||||
|
||||
MenuItem additionalHeadersItem = menu.findItem(R.id.show_full_header);
|
||||
if (additionalHeadersItem != null)
|
||||
{
|
||||
@ -1908,18 +1892,14 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
String contentType = MimeUtility.unfoldAndDecode(part.getContentType());
|
||||
String contentDisposition = MimeUtility.unfoldAndDecode(part.getDisposition());
|
||||
String name = MimeUtility.getHeaderParameter(contentType, "name");
|
||||
|
||||
|
||||
// Inline parts with a content-id are almost certainly components of an HTML message
|
||||
// not attachments. Don't show attachment download buttons for them.
|
||||
|
||||
if (contentDisposition != null &&
|
||||
MimeUtility.getHeaderParameter(contentDisposition, null).matches("^(?i:inline)")
|
||||
&& part.getHeader("Content-ID") != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (name == null)
|
||||
{
|
||||
name = MimeUtility.getHeaderParameter(contentDisposition, "filename");
|
||||
@ -1940,16 +1920,13 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
attachment.contentType = mimeType;
|
||||
attachment.name = name;
|
||||
attachment.part = (LocalAttachmentBodyPart) part;
|
||||
|
||||
LayoutInflater inflater = getLayoutInflater();
|
||||
View view = inflater.inflate(R.layout.message_view_attachment, null);
|
||||
|
||||
TextView attachmentName = (TextView) view.findViewById(R.id.attachment_name);
|
||||
TextView attachmentInfo = (TextView) view.findViewById(R.id.attachment_info);
|
||||
ImageView attachmentIcon = (ImageView) view.findViewById(R.id.attachment_icon);
|
||||
Button attachmentView = (Button) view.findViewById(R.id.view);
|
||||
Button attachmentDownload = (Button) view.findViewById(R.id.download);
|
||||
|
||||
if ((!MimeUtility.mimeTypeMatches(attachment.contentType,
|
||||
K9.ACCEPTABLE_ATTACHMENT_VIEW_TYPES))
|
||||
|| (MimeUtility.mimeTypeMatches(attachment.contentType,
|
||||
@ -1964,26 +1941,21 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
{
|
||||
attachmentDownload.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (attachment.size > K9.MAX_ATTACHMENT_DOWNLOAD_SIZE)
|
||||
{
|
||||
attachmentView.setVisibility(View.GONE);
|
||||
attachmentDownload.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
attachment.viewButton = attachmentView;
|
||||
attachment.downloadButton = attachmentDownload;
|
||||
attachment.iconView = attachmentIcon;
|
||||
|
||||
view.setTag(attachment);
|
||||
attachmentView.setOnClickListener(this);
|
||||
attachmentView.setTag(attachment);
|
||||
attachmentDownload.setOnClickListener(this);
|
||||
attachmentDownload.setTag(attachment);
|
||||
|
||||
attachmentName.setText(name);
|
||||
attachmentInfo.setText(SizeFormatter.formatSize(getApplication(), size));
|
||||
|
||||
Bitmap previewIcon = getPreviewIcon(attachment);
|
||||
if (previewIcon != null)
|
||||
{
|
||||
@ -2018,7 +1990,6 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
|
||||
class Listener extends MessagingListener
|
||||
{
|
||||
|
||||
@Override
|
||||
public void loadMessageForViewHeadersAvailable(Account account, String folder, String uid,
|
||||
final Message message)
|
||||
@ -2028,10 +1999,7 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MessageView.this.mMessage = message;
|
||||
|
||||
|
||||
if (!message.isSet(Flag.X_DOWNLOADED_FULL)
|
||||
&& !message.isSet(Flag.X_DOWNLOADED_PARTIAL))
|
||||
{
|
||||
@ -2064,23 +2032,17 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (MessageView.this.mMessage != null
|
||||
&& MessageView.this.mMessage.isSet(Flag.X_DOWNLOADED_PARTIAL)
|
||||
&& message.isSet(Flag.X_DOWNLOADED_FULL))
|
||||
{
|
||||
|
||||
setHeaders(folder, uid, message);
|
||||
mHandler.showHeaderContainer();
|
||||
}
|
||||
|
||||
MessageView.this.mMessage = message;
|
||||
|
||||
|
||||
mHandler.removeAllAttachments();
|
||||
|
||||
String text;
|
||||
String type = "text/html";
|
||||
if (mPgpData.getDecryptedData() != null)
|
||||
@ -2119,7 +2081,6 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
text = MimeUtility.getTextFromPart(part);
|
||||
}
|
||||
}
|
||||
|
||||
if (text != null)
|
||||
{
|
||||
final String emailText = text;
|
||||
@ -2142,7 +2103,6 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
updateDecryptLayout();
|
||||
}
|
||||
});
|
||||
|
||||
// If the message contains external pictures and the "Show pictures"
|
||||
// button wasn't already pressed, see if the user's preferences has us
|
||||
// showing them anyway.
|
||||
@ -2171,7 +2131,6 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
renderAttachments(mMessage, 0);
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -2215,7 +2174,6 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
mHandler.post(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
@ -2248,7 +2206,6 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
mHandler.post(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
@ -2266,7 +2223,6 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
mHandler.post(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
@ -2285,7 +2241,6 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
mHandler.setAttachmentsEnabled(false);
|
||||
mHandler.progress(true);
|
||||
if (requiresDownload)
|
||||
@ -2302,14 +2257,11 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
mHandler.setAttachmentsEnabled(true);
|
||||
mHandler.progress(false);
|
||||
|
||||
Object[] params = (Object[]) tag;
|
||||
boolean download = (Boolean) params[0];
|
||||
Attachment attachment = (Attachment) params[1];
|
||||
|
||||
if (download)
|
||||
{
|
||||
try
|
||||
@ -2362,7 +2314,6 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
mHandler.setAttachmentsEnabled(true);
|
||||
mHandler.progress(false);
|
||||
mHandler.networkError();
|
||||
@ -2402,11 +2353,9 @@ public class MessageView extends K9Activity implements OnClickListener
|
||||
mConnection.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void initializeCrypto()
|
||||
{
|
||||
if (mPgpData != null)
|
||||
|
Loading…
Reference in New Issue
Block a user