From 0c9e85caf940fda49d13f082daf87f9513cdad3d Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 17 Jul 2020 09:33:14 +0200 Subject: [PATCH] Added sharing of attachments --- .../eu/faircode/email/AdapterAttachment.java | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/AdapterAttachment.java b/app/src/main/java/eu/faircode/email/AdapterAttachment.java index aa50d2ac14..7fa10ffc1e 100644 --- a/app/src/main/java/eu/faircode/email/AdapterAttachment.java +++ b/app/src/main/java/eu/faircode/email/AdapterAttachment.java @@ -22,6 +22,7 @@ package eu.faircode.email; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; +import android.net.Uri; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; @@ -32,6 +33,7 @@ import android.widget.ProgressBar; import android.widget.TextView; import androidx.annotation.NonNull; +import androidx.core.content.FileProvider; import androidx.fragment.app.Fragment; import androidx.lifecycle.Lifecycle; import androidx.lifecycle.LifecycleObserver; @@ -43,6 +45,7 @@ import androidx.recyclerview.widget.DiffUtil; import androidx.recyclerview.widget.ListUpdateCallback; import androidx.recyclerview.widget.RecyclerView; +import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -62,7 +65,7 @@ public class AdapterAttachment extends RecyclerView.Adapter items = new ArrayList<>(); - public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { + public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener { private View view; private ImageButton ibDelete; private ImageView ivType; @@ -95,12 +98,14 @@ public class AdapterAttachment extends RecyclerView.Adapter