mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 08:18:00 +01:00
fix #1552, fixing a glitch related to removing multiple folders at once
This commit is contained in:
parent
e582dd6034
commit
e095ee7421
1 changed files with 38 additions and 35 deletions
|
@ -218,26 +218,20 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
selectedPaths.filter { it != FAVORITES && it != RECYCLE_BIN && (selectedPaths.size == 1 || !activity.config.isFolderProtected(it)) }.forEach {
|
|
||||||
val path = it
|
|
||||||
if (hide) {
|
if (hide) {
|
||||||
if (config.wasHideFolderTooltipShown) {
|
if (config.wasHideFolderTooltipShown) {
|
||||||
activity.handleLockedFolderOpening(path) { success ->
|
hideFolders(selectedPaths)
|
||||||
if (success) {
|
|
||||||
hideFolder(path)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
config.wasHideFolderTooltipShown = true
|
config.wasHideFolderTooltipShown = true
|
||||||
ConfirmationDialog(activity, activity.getString(R.string.hide_folder_description)) {
|
ConfirmationDialog(activity, activity.getString(R.string.hide_folder_description)) {
|
||||||
activity.handleLockedFolderOpening(path) { success ->
|
hideFolders(selectedPaths)
|
||||||
if (success) {
|
|
||||||
hideFolder(path)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
selectedPaths.filter { it != FAVORITES && it != RECYCLE_BIN && (selectedPaths.size == 1 || !activity.config.isFolderProtected(it)) }.forEach {
|
||||||
|
val path = it
|
||||||
activity.handleLockedFolderOpening(path) { success ->
|
activity.handleLockedFolderOpening(path) { success ->
|
||||||
if (success) {
|
if (success) {
|
||||||
if (path.containsNoMedia()) {
|
if (path.containsNoMedia()) {
|
||||||
|
@ -262,6 +256,15 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun hideFolders(paths: ArrayList<String>) {
|
||||||
|
for (path in paths) {
|
||||||
|
activity.handleLockedFolderOpening(path) { success ->
|
||||||
|
if (success) {
|
||||||
|
hideFolder(path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun tryEmptyRecycleBin(askConfirmation: Boolean) {
|
private fun tryEmptyRecycleBin(askConfirmation: Boolean) {
|
||||||
|
|
Loading…
Reference in a new issue