本文整理匯總了Java中org.thoughtcrime.securesms.util.SaveAttachmentTask.Attachment類的典型用法代碼示例。如果您正苦於以下問題:Java Attachment類的具體用法?Java Attachment怎麽用?Java Attachment使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Attachment類屬於org.thoughtcrime.securesms.util.SaveAttachmentTask包,在下文中一共展示了Attachment類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: handleSaveAttachment
import org.thoughtcrime.securesms.util.SaveAttachmentTask.Attachment; //導入依賴的package包/類
private void handleSaveAttachment(final MediaMmsMessageRecord message) {
SaveAttachmentTask.showWarningDialog(getActivity(), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
for (Slide slide : message.getSlideDeck().getSlides()) {
if ((slide.hasImage() || slide.hasVideo() || slide.hasAudio()) && slide.getUri() != null) {
SaveAttachmentTask saveTask = new SaveAttachmentTask(getActivity(), masterSecret);
saveTask.execute(new Attachment(slide.getUri(), slide.getContentType(), slide.getFilename(), message.getDateReceived()));
return;
}
}
Log.w(TAG, "No slide with attachable media found, failing nicely.");
Toast.makeText(getActivity(),
getResources().getQuantityString(R.plurals.ConversationFragment_error_while_saving_attachments_to_sd_card, 1),
Toast.LENGTH_LONG).show();
}
});
}
示例2: handleSaveAttachment
import org.thoughtcrime.securesms.util.SaveAttachmentTask.Attachment; //導入依賴的package包/類
private void handleSaveAttachment(final MediaMmsMessageRecord message) {
SaveAttachmentTask.showWarningDialog(getActivity(), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
for (Slide slide : message.getSlideDeck().getSlides()) {
if ((slide.hasImage() || slide.hasVideo() || slide.hasAudio() || slide.hasDocument()) && slide.getUri() != null) {
SaveAttachmentTask saveTask = new SaveAttachmentTask(getActivity(), masterSecret, list);
saveTask.execute(new Attachment(slide.getUri(), slide.getContentType(), message.getDateReceived(), slide.getFileName().orNull()));
return;
}
}
Log.w(TAG, "No slide with attachable media found, failing nicely.");
Toast.makeText(getActivity(),
getResources().getQuantityString(R.plurals.ConversationFragment_error_while_saving_attachments_to_sd_card, 1),
Toast.LENGTH_LONG).show();
}
});
}
示例3: handleSaveAttachment
import org.thoughtcrime.securesms.util.SaveAttachmentTask.Attachment; //導入依賴的package包/類
private void handleSaveAttachment(final MediaMmsMessageRecord message) {
SaveAttachmentTask.showWarningDialog(getActivity(), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
message.fetchMediaSlide(new FutureTaskListener<Slide>() {
@Override
public void onSuccess(Slide slide) {
SaveAttachmentTask saveTask = new SaveAttachmentTask(getActivity(), masterSecret);
saveTask.execute(new Attachment(slide.getUri(), slide.getContentType(), message.getDateReceived()));
}
@Override
public void onFailure(Throwable error) {
Log.w(TAG, "No slide with attachable media found, failing nicely.");
Log.w(TAG, error);
Toast.makeText(getActivity(), R.string.ConversationFragment_error_while_saving_attachment_to_sd_card, Toast.LENGTH_LONG).show();
}
});
}
});
}
示例4: saveToDisk
import org.thoughtcrime.securesms.util.SaveAttachmentTask.Attachment; //導入依賴的package包/類
private void saveToDisk() {
SaveAttachmentTask.showWarningDialog(this, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
SaveAttachmentTask saveTask = new SaveAttachmentTask(MediaPreviewActivity.this, masterSecret);
long saveDate = (date > 0) ? date : System.currentTimeMillis();
saveTask.execute(new Attachment(mediaUri, mediaType, mediaName, saveDate));
}
});
}
示例5: saveToDisk
import org.thoughtcrime.securesms.util.SaveAttachmentTask.Attachment; //導入依賴的package包/類
private void saveToDisk() {
SaveAttachmentTask.showWarningDialog(this, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
SaveAttachmentTask saveTask = new SaveAttachmentTask(MediaPreviewActivity.this, masterSecret, image);
long saveDate = (date > 0) ? date : System.currentTimeMillis();
saveTask.execute(new Attachment(mediaUri, mediaType, saveDate, null));
}
});
}
示例6: saveToDisk
import org.thoughtcrime.securesms.util.SaveAttachmentTask.Attachment; //導入依賴的package包/類
private void saveToDisk() {
SaveAttachmentTask.showWarningDialog(this, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
SaveAttachmentTask saveTask = new SaveAttachmentTask(MediaPreviewActivity.this, masterSecret);
saveTask.execute(new Attachment(mediaUri, mediaType, date));
}
});
}