mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-02-23 23:37:39 +01:00
fix #971, keep items as Favorites at move
This commit is contained in:
parent
f9000830f5
commit
bb7a911df1
@ -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…
x
Reference in New Issue
Block a user