mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +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,47 +218,50 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hide) {
|
||||||
|
if (config.wasHideFolderTooltipShown) {
|
||||||
|
hideFolders(selectedPaths)
|
||||||
|
} else {
|
||||||
|
config.wasHideFolderTooltipShown = true
|
||||||
|
ConfirmationDialog(activity, activity.getString(R.string.hide_folder_description)) {
|
||||||
|
hideFolders(selectedPaths)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
selectedPaths.filter { it != FAVORITES && it != RECYCLE_BIN && (selectedPaths.size == 1 || !activity.config.isFolderProtected(it)) }.forEach {
|
selectedPaths.filter { it != FAVORITES && it != RECYCLE_BIN && (selectedPaths.size == 1 || !activity.config.isFolderProtected(it)) }.forEach {
|
||||||
val path = it
|
val path = it
|
||||||
if (hide) {
|
activity.handleLockedFolderOpening(path) { success ->
|
||||||
if (config.wasHideFolderTooltipShown) {
|
if (success) {
|
||||||
activity.handleLockedFolderOpening(path) { success ->
|
if (path.containsNoMedia()) {
|
||||||
if (success) {
|
activity.removeNoMedia(path) {
|
||||||
hideFolder(path)
|
if (activity.config.shouldShowHidden) {
|
||||||
}
|
updateFolderNames()
|
||||||
}
|
} else {
|
||||||
} else {
|
activity.runOnUiThread {
|
||||||
config.wasHideFolderTooltipShown = true
|
listener?.refreshItems()
|
||||||
ConfirmationDialog(activity, activity.getString(R.string.hide_folder_description)) {
|
finishActMode()
|
||||||
activity.handleLockedFolderOpening(path) { success ->
|
}
|
||||||
if (success) {
|
|
||||||
hideFolder(path)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
config.addIncludedFolder(path)
|
||||||
|
activity.runOnUiThread {
|
||||||
|
listener?.refreshItems()
|
||||||
|
finishActMode()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
activity.handleLockedFolderOpening(path) { success ->
|
}
|
||||||
if (success) {
|
}
|
||||||
if (path.containsNoMedia()) {
|
|
||||||
activity.removeNoMedia(path) {
|
private fun hideFolders(paths: ArrayList<String>) {
|
||||||
if (activity.config.shouldShowHidden) {
|
for (path in paths) {
|
||||||
updateFolderNames()
|
activity.handleLockedFolderOpening(path) { success ->
|
||||||
} else {
|
if (success) {
|
||||||
activity.runOnUiThread {
|
hideFolder(path)
|
||||||
listener?.refreshItems()
|
|
||||||
finishActMode()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
config.addIncludedFolder(path)
|
|
||||||
activity.runOnUiThread {
|
|
||||||
listener?.refreshItems()
|
|
||||||
finishActMode()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue