From 0dd5e5af8dfc479ceec44f619fed55f90c89c72e Mon Sep 17 00:00:00 2001 From: Grishka Date: Sun, 24 Apr 2022 15:41:15 +0300 Subject: [PATCH] Fix #71 --- .../joinmastodon/android/ui/photoviewer/PhotoViewer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/PhotoViewer.java b/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/PhotoViewer.java index 1326b3c1..cc4944aa 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/PhotoViewer.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/PhotoViewer.java @@ -514,7 +514,11 @@ public class PhotoViewer implements ZoomPanView.Listener{ } private void saveViaDownloadManager(Attachment att){ - DownloadManager.Request req=new DownloadManager.Request(Uri.parse(att.url)); + Uri uri=Uri.parse(att.url); + DownloadManager.Request req=new DownloadManager.Request(uri); + req.allowScanningByMediaScanner(); + req.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); + req.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, uri.getLastPathSegment()); activity.getSystemService(DownloadManager.class).enqueue(req); Toast.makeText(activity, R.string.downloading, Toast.LENGTH_SHORT).show(); }