refactor(PhotoViewer): use getFileProviderUri
This commit is contained in:
parent
5d3afc1b0e
commit
965f7c6d1d
|
@ -59,7 +59,7 @@ import org.joinmastodon.android.api.session.AccountSessionManager;
|
||||||
import org.joinmastodon.android.model.Attachment;
|
import org.joinmastodon.android.model.Attachment;
|
||||||
import org.joinmastodon.android.model.Status;
|
import org.joinmastodon.android.model.Status;
|
||||||
import org.joinmastodon.android.ui.M3AlertDialogBuilder;
|
import org.joinmastodon.android.ui.M3AlertDialogBuilder;
|
||||||
import org.joinmastodon.android.utils.FileProvider;
|
import org.joinmastodon.android.ui.utils.UiUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
|
@ -647,7 +647,7 @@ public class PhotoViewer implements ZoomPanView.Listener{
|
||||||
|
|
||||||
private void shareFile(@NonNull File file) {
|
private void shareFile(@NonNull File file) {
|
||||||
Intent intent = new Intent(Intent.ACTION_SEND);
|
Intent intent = new Intent(Intent.ACTION_SEND);
|
||||||
Uri outputUri = FileProvider.getUriForFile(activity, activity.getPackageName() + ".fileprovider", file);
|
Uri outputUri = UiUtils.getFileProviderUri(activity, file);
|
||||||
intent.setDataAndType(outputUri, mimeTypeForFileName(outputUri.getLastPathSegment()));
|
intent.setDataAndType(outputUri, mimeTypeForFileName(outputUri.getLastPathSegment()));
|
||||||
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
intent.putExtra(Intent.EXTRA_STREAM, outputUri);
|
intent.putExtra(Intent.EXTRA_STREAM, outputUri);
|
||||||
|
|
Loading…
Reference in New Issue