Loading src/com/fsck/k9/fragment/MessageViewFragment.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -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, Loading src/com/fsck/k9/view/AttachmentView.java +7 −12 Original line number Original line Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 { Loading Loading @@ -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) { Loading Loading @@ -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; } } Loading Loading
src/com/fsck/k9/fragment/MessageViewFragment.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -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, Loading
src/com/fsck/k9/view/AttachmentView.java +7 −12 Original line number Original line Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 { Loading Loading @@ -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) { Loading Loading @@ -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; } } Loading