Home | History | Annotate | Download | only in compose

Lines Matching refs:Attachment

37 import com.android.mail.providers.Attachment;
57 private final ArrayList<Attachment> mAttachments;
98 * Adds an attachment and updates the ui accordingly.
100 private void addAttachment(final Attachment attachment) {
101 mAttachments.add(attachment);
103 // If the attachment is inline do not display this attachment.
104 if (attachment.isInlineAttachment()) {
114 // If we have an attachment that should be shown in a tiled look,
116 if (AttachmentTile.isTiledAttachment(attachment)) {
118 mTileGrid.addComposeTileFromAttachment(attachment);
122 deleteAttachment(attachmentTile, attachment);
129 new AttachmentComposeView(getContext(), attachment);
134 deleteAttachment(attachmentView, attachment);
150 final Attachment attachment) {
151 mAttachments.remove(attachment);
162 public ArrayList<Attachment> getAttachments() {
196 for (Attachment attachment : mAttachments) {
197 totalSize += attachment.size;
246 * Generate an {@link Attachment} object for a given local content URI. Attempts to populate
247 * the {@link Attachment#name}, {@link Attachment#size}, and {@link Attachment#contentType}
251 * @return an Attachment object
254 public Attachment generateLocalAttachment(Uri contentUri) throws AttachmentFailureException {
256 throw new AttachmentFailureException("Failed to create local attachment");
265 final Attachment attachment = new Attachment();
266 attachment.uri = null; // URI will be assigned by the provider upon send/save
267 attachment.contentUri = contentUri;
268 attachment.thumbnailUri = contentUri;
279 attachment.virtualMimeType = mimeTypes[0];
338 throw new AttachmentFailureException("Security Exception from attachment uri", e);
348 .getExtensionFromMimeType(attachment.virtualMimeType);
356 // if the attachment is not a content:// for example, a file:// URI
360 // Save the computed values into the attachment.
361 attachment.size = size;
362 attachment.setName(name);
363 attachment.setContentType(contentType);
365 return attachment;
369 * Adds an attachment of either local or remote origin, checking to see if the attachment
372 * @param attachment the attachment to be added.
374 * @throws AttachmentFailureException if an error occurs adding the attachment.
376 public void addAttachment(Account account, Attachment attachment)
380 // The attachment size is known and it's too big.
381 if (attachment.size > maxSize) {
383 "Attachment too large to attach", R.string.too_large_to_attach_single);
384 } else if (attachment.size != -1 && (getTotalAttachmentsSize()
385 + attachment.size) > maxSize) {
387 "Attachment too large to attach", R.string.too_large_to_attach_additional);
389 addAttachment(attachment);
432 Attachment lastAttachment = mAttachments.get(mAttachments.size() - 1);
474 * Get the error string resource that corresponds to this attachment failure. Always a valid