Beispiel #1
0
 private void onDownloadRemainder() {
   if (mMessage.isSet(Flag.X_DOWNLOADED_FULL)) {
     return;
   }
   mMessageView.downloadRemainderButton().setEnabled(false);
   mController.loadMessageForViewRemote(
       mAccount, mMessageReference.folderName, mMessageReference.uid, mListener);
 }
Beispiel #2
0
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View view = inflater.inflate(R.layout.message, container, false);

    mMessageView = (SingleMessageView) view.findViewById(R.id.message_view);

    // set a callback for the attachment view. With this callback the attachmentview
    // request the start of a filebrowser activity.
    mMessageView.setAttachmentCallback(
        new AttachmentFileDownloadCallback() {

          @Override
          public void showFileBrowser(final AttachmentView caller) {
            FileBrowserHelper.getInstance()
                .showFileBrowserActivity(
                    MessageViewFragment.this, null, ACTIVITY_CHOOSE_DIRECTORY, callback);
            attachmentTmpStore = caller;
          }

          FileBrowserFailOverCallback callback =
              new FileBrowserFailOverCallback() {

                @Override
                public void onPathEntered(String path) {
                  attachmentTmpStore.writeFile(new File(path));
                }

                @Override
                public void onCancel() {
                  // canceled, do nothing
                }
              };
        });

    mMessageView.initialize(this);
    mMessageView.downloadRemainderButton().setOnClickListener(this);

    mFragmentListener.messageHeaderViewAvailable(mMessageView.getMessageHeaderView());

    return view;
  }