当前位置: 首页>>代码示例>>Java>>正文


Java SaveAttachmentTask类代码示例

本文整理汇总了Java中org.thoughtcrime.securesms.util.SaveAttachmentTask的典型用法代码示例。如果您正苦于以下问题:Java SaveAttachmentTask类的具体用法?Java SaveAttachmentTask怎么用?Java SaveAttachmentTask使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SaveAttachmentTask类属于org.thoughtcrime.securesms.util包,在下文中一共展示了SaveAttachmentTask类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleSaveAttachment

import org.thoughtcrime.securesms.util.SaveAttachmentTask; //导入依赖的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();
    }
  });
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:19,代码来源:ConversationFragment.java

示例2: handleSaveAttachment

import org.thoughtcrime.securesms.util.SaveAttachmentTask; //导入依赖的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();
    }
  });
}
 
开发者ID:CableIM,项目名称:Cable-Android,代码行数:19,代码来源:ConversationFragment.java

示例3: handleSaveAttachment

import org.thoughtcrime.securesms.util.SaveAttachmentTask; //导入依赖的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();
        }
      });
    }
  });
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:22,代码来源:ConversationFragment.java

示例4: saveToDisk

import org.thoughtcrime.securesms.util.SaveAttachmentTask; //导入依赖的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));
    }
  });
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:11,代码来源:MediaPreviewActivity.java

示例5: saveToDisk

import org.thoughtcrime.securesms.util.SaveAttachmentTask; //导入依赖的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));
    }
  });
}
 
开发者ID:CableIM,项目名称:Cable-Android,代码行数:11,代码来源:MediaPreviewActivity.java

示例6: saveToDisk

import org.thoughtcrime.securesms.util.SaveAttachmentTask; //导入依赖的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));
    }
  });
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:10,代码来源:MediaPreviewActivity.java


注:本文中的org.thoughtcrime.securesms.util.SaveAttachmentTask类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。