mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 04:57:59 +01:00
refresh cached directly at contentobserver triggering too
This commit is contained in:
parent
1445434930
commit
f20ef872ca
1 changed files with 3 additions and 0 deletions
|
@ -6,11 +6,13 @@ import android.net.Uri
|
|||
import android.provider.MediaStore
|
||||
import android.view.WindowManager
|
||||
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
||||
import com.simplemobiletools.commons.extensions.getParentPath
|
||||
import com.simplemobiletools.commons.extensions.getRealPathFromURI
|
||||
import com.simplemobiletools.commons.helpers.isPiePlus
|
||||
import com.simplemobiletools.gallery.pro.R
|
||||
import com.simplemobiletools.gallery.pro.extensions.addPathToDB
|
||||
import com.simplemobiletools.gallery.pro.extensions.config
|
||||
import com.simplemobiletools.gallery.pro.extensions.updateDirectoryPath
|
||||
|
||||
open class SimpleActivity : BaseSimpleActivity() {
|
||||
val observer = object : ContentObserver(null) {
|
||||
|
@ -18,6 +20,7 @@ open class SimpleActivity : BaseSimpleActivity() {
|
|||
super.onChange(selfChange, uri)
|
||||
val path = getRealPathFromURI(uri)
|
||||
if (path != null) {
|
||||
updateDirectoryPath(path.getParentPath())
|
||||
addPathToDB(path)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue