Home | History | Annotate | Download | only in photo

Lines Matching refs:attachment

40 import com.android.mail.providers.Attachment;
147 final Attachment attachment = getCurrentAttachment();
149 if (attachment != null && mSaveItem != null && mShareItem != null) {
150 mSaveItem.setEnabled(!attachment.isDownloading()
151 && attachment.canSave() && !attachment.isSavedToExternal());
152 mShareItem.setEnabled(attachment.canShare());
153 mDownloadAgainItem.setEnabled(attachment.canSave() && attachment.isDownloading());
161 List<Attachment> attachments = getAllAttachments();
164 for (final Attachment a : attachments) {
165 // If one attachment can be saved, enable save all
175 for (final Attachment a : attachments) {
225 final Attachment attachment = getCurrentAttachment();
227 final String size = AttachmentUtils.convertToHumanReadableSize(this, attachment.size);
231 // 1. Saved, Attachment Size
233 // 3. Default, Attachment Size
234 if (attachment.isSavedToExternal()) {
236 } else if (attachment.isDownloading() &&
237 attachment.destination == AttachmentDestination.EXTERNAL) {
248 final Attachment attachment = getCurrentAttachment();
249 if (attachment.state == AttachmentState.PAUSED) {
250 mActionHandler.setAttachment(attachment);
251 mActionHandler.startDownloadingAttachment(attachment.destination);
258 updateProgressAndEmptyViews(fragment, new Attachment(cursor));
263 * state of the attachment.
267 final PhotoViewFragment fragment, final Attachment attachment) {
273 if (attachment.shouldShowProgress()) {
274 progressBar.setMax(attachment.size);
275 progressBar.setProgress(attachment.downloadedSize);
282 if (attachment.isDownloadFailed()) {
299 * Save the current attachment.
306 * Redownloads the attachment.
309 final Attachment attachment = getCurrentAttachment();
310 if (attachment != null && attachment.canSave()) {
312 // For an attachment that is downloading (or paused in the DownloadManager), we need to
314 mActionHandler.setAttachment(attachment);
316 mActionHandler.startDownloadingAttachment(attachment.destination);
321 * Saves the attachment.
322 * @param attachment the attachment to save.
324 private void saveAttachment(final Attachment attachment) {
325 if (attachment != null && attachment.canSave()) {
326 mActionHandler.setAttachment(attachment);
343 saveAttachment(new Attachment(cursor));
348 * Share the current attachment.
355 * Shares the attachment
356 * @param attachment the attachment to share
358 private void shareAttachment(final Attachment attachment) {
359 if (attachment != null) {
360 mActionHandler.setAttachment(attachment);
378 uris.add(Utils.normalizeUri(new Attachment(cursor).contentUri));
385 * Helper method to get the currently visible attachment.
387 protected Attachment getCurrentAttachment() {
394 return new Attachment(cursor);
397 private List<Attachment> getAllAttachments() {
404 List<Attachment> list = Lists.newArrayList();
406 list.add(new Attachment(cursor));