mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 00:17:58 +01:00
fix #971, keep items as Favorites at move
This commit is contained in:
parent
f9000830f5
commit
bb7a911df1
3 changed files with 11 additions and 0 deletions
|
@ -527,6 +527,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
config.tempFolderPath = ""
|
config.tempFolderPath = ""
|
||||||
if (!isCopyOperation) {
|
if (!isCopyOperation) {
|
||||||
refreshViewPager()
|
refreshViewPager()
|
||||||
|
updateFavoritePaths(fileDirItems, it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -283,6 +283,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Thumbnai
|
||||||
activity.applicationContext.rescanFolderMedia(fileDirItems.first().getParentPath())
|
activity.applicationContext.rescanFolderMedia(fileDirItems.first().getParentPath())
|
||||||
if (!isCopyOperation) {
|
if (!isCopyOperation) {
|
||||||
listener?.refreshItems()
|
listener?.refreshItems()
|
||||||
|
activity.updateFavoritePaths(fileDirItems, it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -278,3 +278,12 @@ fun BaseSimpleActivity.showRecycleBinEmptyingDialog(callback: () -> Unit) {
|
||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun BaseSimpleActivity.updateFavoritePaths(fileDirItems: ArrayList<FileDirItem>, destination: String) {
|
||||||
|
Thread {
|
||||||
|
fileDirItems.forEach {
|
||||||
|
val newPath = "$destination/${it.name}"
|
||||||
|
updateDBMediaPath(it.path, newPath)
|
||||||
|
}
|
||||||
|
}.start()
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue