From 91137228d2407b305f5b27d1dd509682d59f38d0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 22 Jan 2018 23:42:52 +0100 Subject: [PATCH] send a broadcast for refreshing media at file save --- app/build.gradle | 2 +- .../com/simplemobiletools/camera/activities/MainActivity.kt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index b08f3ff7..958ffed4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -42,7 +42,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.8.0' + implementation 'com.simplemobiletools:commons:3.8.1' debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion" releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakCanaryVersion" diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt index f717683f..d1257cd9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/activities/MainActivity.kt @@ -24,6 +24,7 @@ import com.simplemobiletools.camera.views.FocusRectView import com.simplemobiletools.camera.views.Preview import com.simplemobiletools.camera.views.Preview.PreviewListener import com.simplemobiletools.commons.extensions.* +import com.simplemobiletools.commons.helpers.BROADCAST_REFRESH_MEDIA import com.simplemobiletools.commons.helpers.PERMISSION_CAMERA import com.simplemobiletools.commons.helpers.PERMISSION_RECORD_AUDIO import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE @@ -564,6 +565,10 @@ class MainActivity : SimpleActivity(), PreviewListener, PhotoProcessor.MediaSave override fun mediaSaved(path: String) { scanPath(path) { setupPreviewImage(mIsInPhotoMode) + Intent(BROADCAST_REFRESH_MEDIA).apply { + `package` = "com.simplemobiletools.gallery" + sendBroadcast(this) + } } if (isImageCaptureIntent()) {