Merge pull request #415 from FineFindus/refactor/sharing-img

refactor(PhotoViewer): use getFileProviderUri
This commit is contained in:
LucasGGamerM 2024-05-26 11:28:00 -03:00 committed by GitHub
commit 70686bbbd0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -59,7 +59,7 @@ import org.joinmastodon.android.api.session.AccountSessionManager;
import org.joinmastodon.android.model.Attachment;
import org.joinmastodon.android.model.Status;
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.FileOutputStream;
@ -647,7 +647,7 @@ public class PhotoViewer implements ZoomPanView.Listener{
private void shareFile(@NonNull File file) {
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.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.putExtra(Intent.EXTRA_STREAM, outputUri);