1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-30 21:22:26 -05:00

Rename our attachment view holder from Attachment to AttachmentViewHolder

This commit is contained in:
Jesse Vincent 2010-12-28 09:08:18 +00:00
parent 6a04afb758
commit 85a7a08e9a

View File

@ -429,7 +429,7 @@ public class MessageView extends K9Activity implements OnClickListener
{ {
for (int i = 0, count = mAttachments.getChildCount(); i < count; i++) for (int i = 0, count = mAttachments.getChildCount(); i < count; i++)
{ {
Attachment attachment = (Attachment) mAttachments.getChildAt(i).getTag(); AttachmentViewHolder attachment = (AttachmentViewHolder) mAttachments.getChildAt(i).getTag();
attachment.viewButton.setEnabled(enabled); attachment.viewButton.setEnabled(enabled);
attachment.downloadButton.setEnabled(enabled); attachment.downloadButton.setEnabled(enabled);
} }
@ -709,7 +709,7 @@ public class MessageView extends K9Activity implements OnClickListener
} }
} }
static class Attachment static class AttachmentViewHolder
{ {
public String name; public String name;
public String contentType; public String contentType;
@ -1585,7 +1585,7 @@ public class MessageView extends K9Activity implements OnClickListener
mListener); mListener);
} }
private void onDownloadAttachment(Attachment attachment) private void onDownloadAttachment(AttachmentViewHolder attachment)
{ {
if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED))
{ {
@ -1609,7 +1609,7 @@ public class MessageView extends K9Activity implements OnClickListener
} }
} }
private void onViewAttachment(Attachment attachment) private void onViewAttachment(AttachmentViewHolder attachment)
{ {
if (mMessage != null) if (mMessage != null)
{ {
@ -1685,10 +1685,10 @@ public class MessageView extends K9Activity implements OnClickListener
onPrevious(); onPrevious();
break; break;
case R.id.download: case R.id.download:
onDownloadAttachment((Attachment) view.getTag()); onDownloadAttachment((AttachmentViewHolder) view.getTag());
break; break;
case R.id.view: case R.id.view:
onViewAttachment((Attachment) view.getTag()); onViewAttachment((AttachmentViewHolder) view.getTag());
break; break;
case R.id.show_pictures: case R.id.show_pictures:
onShowPictures(); onShowPictures();
@ -1826,7 +1826,7 @@ public class MessageView extends K9Activity implements OnClickListener
} }
} }
private Bitmap getPreviewIcon(Attachment attachment) private Bitmap getPreviewIcon(AttachmentViewHolder attachment)
{ {
try try
{ {
@ -1869,7 +1869,7 @@ public class MessageView extends K9Activity implements OnClickListener
* We're guaranteed size because LocalStore.fetch puts it there. * We're guaranteed size because LocalStore.fetch puts it there.
*/ */
int size = Integer.parseInt(MimeUtility.getHeaderParameter(contentDisposition, "size")); int size = Integer.parseInt(MimeUtility.getHeaderParameter(contentDisposition, "size"));
Attachment attachment = new Attachment(); AttachmentViewHolder attachment = new AttachmentViewHolder();
attachment.size = size; attachment.size = size;
String mimeType = part.getMimeType(); String mimeType = part.getMimeType();
if (MimeUtility.DEFAULT_ATTACHMENT_MIME_TYPE.equals(mimeType)) if (MimeUtility.DEFAULT_ATTACHMENT_MIME_TYPE.equals(mimeType))
@ -2172,7 +2172,7 @@ public class MessageView extends K9Activity implements OnClickListener
mHandler.progress(false); mHandler.progress(false);
Object[] params = (Object[]) tag; Object[] params = (Object[]) tag;
boolean download = (Boolean) params[0]; boolean download = (Boolean) params[0];
Attachment attachment = (Attachment) params[1]; AttachmentViewHolder attachment = (AttachmentViewHolder) params[1];
if (download) if (download)
{ {
try try