mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-01-31 04:06:43 +01:00
Merge pull request #2384 from KryptKode/feat/handle-saf-on-fullscreen
Handle SAF on pager full screen - SDK 30 changes
This commit is contained in:
commit
f9ce90201b
1 changed files with 32 additions and 20 deletions
|
@ -1109,6 +1109,11 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
|
|
||||||
val fileDirItem = FileDirItem(path, path.getFilenameFromPath())
|
val fileDirItem = FileDirItem(path, path.getFilenameFromPath())
|
||||||
if (config.useRecycleBin && !getCurrentMedium()!!.getIsInRecycleBin()) {
|
if (config.useRecycleBin && !getCurrentMedium()!!.getIsInRecycleBin()) {
|
||||||
|
handleSAFDialogSdk30(fileDirItem.path) {
|
||||||
|
if (!it) {
|
||||||
|
return@handleSAFDialogSdk30
|
||||||
|
}
|
||||||
|
|
||||||
mIgnoredPaths.add(fileDirItem.path)
|
mIgnoredPaths.add(fileDirItem.path)
|
||||||
val media = mMediaFiles.filter { !mIgnoredPaths.contains(it.path) } as ArrayList<ThumbnailItem>
|
val media = mMediaFiles.filter { !mIgnoredPaths.contains(it.path) } as ArrayList<ThumbnailItem>
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
|
@ -1125,12 +1130,18 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
toast(R.string.unknown_error_occurred)
|
toast(R.string.unknown_error_occurred)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
handleDeletion(fileDirItem)
|
handleDeletion(fileDirItem)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleDeletion(fileDirItem: FileDirItem) {
|
private fun handleDeletion(fileDirItem: FileDirItem) {
|
||||||
|
handleSAFDialogSdk30(fileDirItem.path) {
|
||||||
|
if (!it) {
|
||||||
|
return@handleSAFDialogSdk30
|
||||||
|
}
|
||||||
|
|
||||||
mIgnoredPaths.add(fileDirItem.path)
|
mIgnoredPaths.add(fileDirItem.path)
|
||||||
val media = mMediaFiles.filter { !mIgnoredPaths.contains(it.path) } as ArrayList<ThumbnailItem>
|
val media = mMediaFiles.filter { !mIgnoredPaths.contains(it.path) } as ArrayList<ThumbnailItem>
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
|
@ -1142,6 +1153,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
deleteDirectoryIfEmpty()
|
deleteDirectoryIfEmpty()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun isDirEmpty(media: ArrayList<Medium>): Boolean {
|
private fun isDirEmpty(media: ArrayList<Medium>): Boolean {
|
||||||
return if (media.isEmpty()) {
|
return if (media.isEmpty()) {
|
||||||
|
|
Loading…
Reference in a new issue