mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-02-18 13:00:36 +01:00
SDK 30 changes
- handle SAF dialog on ViewPagerActivity before refreshing screen
This commit is contained in:
parent
4a3e502484
commit
399c8e241d
@ -1109,6 +1109,11 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||
|
||||
val fileDirItem = FileDirItem(path, path.getFilenameFromPath())
|
||||
if (config.useRecycleBin && !getCurrentMedium()!!.getIsInRecycleBin()) {
|
||||
handleSAFDialogSdk30(fileDirItem.path) {
|
||||
if (!it) {
|
||||
return@handleSAFDialogSdk30
|
||||
}
|
||||
|
||||
mIgnoredPaths.add(fileDirItem.path)
|
||||
val media = mMediaFiles.filter { !mIgnoredPaths.contains(it.path) } as ArrayList<ThumbnailItem>
|
||||
runOnUiThread {
|
||||
@ -1125,12 +1130,18 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||
toast(R.string.unknown_error_occurred)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
handleDeletion(fileDirItem)
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleDeletion(fileDirItem: FileDirItem) {
|
||||
handleSAFDialogSdk30(fileDirItem.path) {
|
||||
if (!it) {
|
||||
return@handleSAFDialogSdk30
|
||||
}
|
||||
|
||||
mIgnoredPaths.add(fileDirItem.path)
|
||||
val media = mMediaFiles.filter { !mIgnoredPaths.contains(it.path) } as ArrayList<ThumbnailItem>
|
||||
runOnUiThread {
|
||||
@ -1142,6 +1153,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||
deleteDirectoryIfEmpty()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun isDirEmpty(media: ArrayList<Medium>): Boolean {
|
||||
return if (media.isEmpty()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user