Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4299eb97 authored by cketti's avatar cketti
Browse files

Rename method and improve documentation

parent 4a6c5294
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -207,7 +207,7 @@ public class MessageViewFragment extends Fragment implements OnClickListener,
        mMessageView.setAttachmentCallback(new AttachmentFileDownloadCallback() {
        mMessageView.setAttachmentCallback(new AttachmentFileDownloadCallback() {


            @Override
            @Override
            public void showFileBrowser(final AttachmentView caller) {
            public void pickDirectoryToSaveAttachmentTo(final AttachmentView caller) {
                FileBrowserHelper.getInstance()
                FileBrowserHelper.getInstance()
                .showFileBrowserActivity(MessageViewFragment.this,
                .showFileBrowserActivity(MessageViewFragment.this,
                                         null,
                                         null,
+7 −12
Original line number Original line Diff line number Diff line
@@ -7,8 +7,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStream;


import org.apache.commons.io.IOUtils;

import android.content.Context;
import android.content.Context;
import android.content.Intent;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Bitmap;
@@ -42,6 +40,7 @@ import com.fsck.k9.mail.internet.MimeHeader;
import com.fsck.k9.mail.internet.MimeUtility;
import com.fsck.k9.mail.internet.MimeUtility;
import com.fsck.k9.mail.store.LocalStore.LocalAttachmentBodyPart;
import com.fsck.k9.mail.store.LocalStore.LocalAttachmentBodyPart;
import com.fsck.k9.provider.AttachmentProvider;
import com.fsck.k9.provider.AttachmentProvider;
import org.apache.commons.io.IOUtils;




public class AttachmentView extends FrameLayout implements OnClickListener, OnLongClickListener {
public class AttachmentView extends FrameLayout implements OnClickListener, OnLongClickListener {
@@ -77,16 +76,12 @@ public class AttachmentView extends FrameLayout implements OnClickListener, OnLo


    public interface AttachmentFileDownloadCallback {
    public interface AttachmentFileDownloadCallback {
        /**
        /**
         * this method i called by the attachmentview when
         * This method is called to ask the user to pick a directory to save the attachment to.
         * he wants to show a filebrowser
         * <p/>
         * the provider should show the filebrowser activity
         * After the user has selected a directory, the implementation of this interface has to call
         * and save the reference to the attachment view for later.
         * {@link #writeFile(File)} on the object supplied as argument in order for the attachment to be saved.
         * in his onActivityResult he can get the saved reference and
         * call the saveFile method of AttachmentView
         *
         * @param view
         */
         */
        public void showFileBrowser(AttachmentView caller);
        public void pickDirectoryToSaveAttachmentTo(AttachmentView caller);
    }
    }


    public void setButtonsEnabled(boolean enabled) {
    public void setButtonsEnabled(boolean enabled) {
@@ -214,7 +209,7 @@ public class AttachmentView extends FrameLayout implements OnClickListener, OnLo
    @Override
    @Override
    public boolean onLongClick(View view) {
    public boolean onLongClick(View view) {
        if (view.getId() == R.id.download) {
        if (view.getId() == R.id.download) {
            callback.showFileBrowser(this);
            callback.pickDirectoryToSaveAttachmentTo(this);
            return true;
            return true;
        }
        }