mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
Rename method and improve documentation
This commit is contained in:
parent
4a6c52947d
commit
4299eb9771
@ -207,7 +207,7 @@ public class MessageViewFragment extends Fragment implements OnClickListener,
|
||||
mMessageView.setAttachmentCallback(new AttachmentFileDownloadCallback() {
|
||||
|
||||
@Override
|
||||
public void showFileBrowser(final AttachmentView caller) {
|
||||
public void pickDirectoryToSaveAttachmentTo(final AttachmentView caller) {
|
||||
FileBrowserHelper.getInstance()
|
||||
.showFileBrowserActivity(MessageViewFragment.this,
|
||||
null,
|
||||
|
@ -7,8 +7,6 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
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.store.LocalStore.LocalAttachmentBodyPart;
|
||||
import com.fsck.k9.provider.AttachmentProvider;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
|
||||
public class AttachmentView extends FrameLayout implements OnClickListener, OnLongClickListener {
|
||||
@ -77,16 +76,12 @@ public class AttachmentView extends FrameLayout implements OnClickListener, OnLo
|
||||
|
||||
public interface AttachmentFileDownloadCallback {
|
||||
/**
|
||||
* this method i called by the attachmentview when
|
||||
* he wants to show a filebrowser
|
||||
* the provider should show the filebrowser activity
|
||||
* and save the reference to the attachment view for later.
|
||||
* in his onActivityResult he can get the saved reference and
|
||||
* call the saveFile method of AttachmentView
|
||||
*
|
||||
* @param view
|
||||
* This method is called to ask the user to pick a directory to save the attachment to.
|
||||
* <p/>
|
||||
* After the user has selected a directory, the implementation of this interface has to call
|
||||
* {@link #writeFile(File)} on the object supplied as argument in order for the attachment to be saved.
|
||||
*/
|
||||
public void showFileBrowser(AttachmentView caller);
|
||||
public void pickDirectoryToSaveAttachmentTo(AttachmentView caller);
|
||||
}
|
||||
|
||||
public void setButtonsEnabled(boolean enabled) {
|
||||
@ -214,7 +209,7 @@ public class AttachmentView extends FrameLayout implements OnClickListener, OnLo
|
||||
@Override
|
||||
public boolean onLongClick(View view) {
|
||||
if (view.getId() == R.id.download) {
|
||||
callback.showFileBrowser(this);
|
||||
callback.pickDirectoryToSaveAttachmentTo(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user