mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 14:37:59 +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 = ""
|
||||
if (!isCopyOperation) {
|
||||
refreshViewPager()
|
||||
updateFavoritePaths(fileDirItems, it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -283,6 +283,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Thumbnai
|
|||
activity.applicationContext.rescanFolderMedia(fileDirItems.first().getParentPath())
|
||||
if (!isCopyOperation) {
|
||||
listener?.refreshItems()
|
||||
activity.updateFavoritePaths(fileDirItems, it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -278,3 +278,12 @@ fun BaseSimpleActivity.showRecycleBinEmptyingDialog(callback: () -> Unit) {
|
|||
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