send a broadcast for refreshing media at file save

This commit is contained in:
tibbi 2018-01-22 23:42:52 +01:00
parent aeafddd9ed
commit 91137228d2
2 changed files with 6 additions and 1 deletions

View File

@ -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"

View File

@ -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()) {