mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
refresh cached directly at contentobserver triggering too
This commit is contained in:
@ -6,11 +6,13 @@ import android.net.Uri
|
|||||||
import android.provider.MediaStore
|
import android.provider.MediaStore
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
||||||
|
import com.simplemobiletools.commons.extensions.getParentPath
|
||||||
import com.simplemobiletools.commons.extensions.getRealPathFromURI
|
import com.simplemobiletools.commons.extensions.getRealPathFromURI
|
||||||
import com.simplemobiletools.commons.helpers.isPiePlus
|
import com.simplemobiletools.commons.helpers.isPiePlus
|
||||||
import com.simplemobiletools.gallery.pro.R
|
import com.simplemobiletools.gallery.pro.R
|
||||||
import com.simplemobiletools.gallery.pro.extensions.addPathToDB
|
import com.simplemobiletools.gallery.pro.extensions.addPathToDB
|
||||||
import com.simplemobiletools.gallery.pro.extensions.config
|
import com.simplemobiletools.gallery.pro.extensions.config
|
||||||
|
import com.simplemobiletools.gallery.pro.extensions.updateDirectoryPath
|
||||||
|
|
||||||
open class SimpleActivity : BaseSimpleActivity() {
|
open class SimpleActivity : BaseSimpleActivity() {
|
||||||
val observer = object : ContentObserver(null) {
|
val observer = object : ContentObserver(null) {
|
||||||
@ -18,6 +20,7 @@ open class SimpleActivity : BaseSimpleActivity() {
|
|||||||
super.onChange(selfChange, uri)
|
super.onChange(selfChange, uri)
|
||||||
val path = getRealPathFromURI(uri)
|
val path = getRealPathFromURI(uri)
|
||||||
if (path != null) {
|
if (path != null) {
|
||||||
|
updateDirectoryPath(path.getParentPath())
|
||||||
addPathToDB(path)
|
addPathToDB(path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user