diff --git a/app/src/main/java/eu/faircode/email/AdapterAttachment.java b/app/src/main/java/eu/faircode/email/AdapterAttachment.java index c9c79ab2cd..b56aa8d491 100644 --- a/app/src/main/java/eu/faircode/email/AdapterAttachment.java +++ b/app/src/main/java/eu/faircode/email/AdapterAttachment.java @@ -29,6 +29,8 @@ import android.net.Uri; import android.os.Bundle; import android.text.TextUtils; import android.view.LayoutInflater; +import android.view.Menu; +import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.Button; @@ -41,6 +43,7 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.widget.PopupMenu; import androidx.core.app.ShareCompat; import androidx.core.content.FileProvider; import androidx.fragment.app.Fragment; @@ -221,7 +224,7 @@ public class AdapterAttachment extends RecyclerView.Adapter() { + @Override + protected Void onExecute(Context context, Bundle args) throws Throwable { + long id = args.getLong("id"); + + DB db = DB.getInstance(context); + EntityAttachment attachment = db.attachment().getAttachment(id); + if (attachment != null) + attachment.zip(context); + + return null; + } + + @Override + protected void onException(Bundle args, Throwable ex) { + Log.unexpectedError(parentFragment.getParentFragmentManager(), ex); + } + }.execute(context, owner, args, "attachment:zip"); + + return true; + } + private void onDelete(final EntityAttachment attachment) { Bundle args = new Bundle(); args.putLong("id", attachment.id); @@ -348,7 +405,7 @@ public class AdapterAttachment extends RecyclerView.AdapterCreate rule … Force light theme Share + ZIP Add to calendar Add shortcut Print