mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 04:57:59 +01:00
properly handle Recycle bin and Favorites at grouping direct subfolders
This commit is contained in:
parent
84b0c9c88b
commit
7ba0be43a9
1 changed files with 10 additions and 2 deletions
|
@ -938,7 +938,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
val currentPaths = LinkedHashSet<String>()
|
val currentPaths = LinkedHashSet<String>()
|
||||||
folders.forEach {
|
folders.forEach {
|
||||||
val path = it
|
val path = it
|
||||||
if (!path.equals(internalPath, true) && !path.equals(sdPath, true)) {
|
if (!path.equals(internalPath, true) && !path.equals(sdPath, true) && path != RECYCLE_BIN && path != FAVORITES) {
|
||||||
if (mCurrentPathPrefix.isNotEmpty()) {
|
if (mCurrentPathPrefix.isNotEmpty()) {
|
||||||
if (File(path).parent.equals(mCurrentPathPrefix, true) || path == mCurrentPathPrefix) {
|
if (File(path).parent.equals(mCurrentPathPrefix, true) || path == mCurrentPathPrefix) {
|
||||||
currentPaths.add(path)
|
currentPaths.add(path)
|
||||||
|
@ -956,12 +956,20 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
currentPaths.forEach {
|
currentPaths.forEach {
|
||||||
val path = it
|
val path = it
|
||||||
currentPaths.forEach {
|
currentPaths.forEach {
|
||||||
if (!it.equals(path) && File(it).parent.equals(path)) {
|
if (!it.equals(path) && File(it).parent?.equals(path) == true) {
|
||||||
areDirectSubfoldersAvailable = true
|
areDirectSubfoldersAvailable = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mCurrentPathPrefix.isEmpty() && folders.contains(RECYCLE_BIN)) {
|
||||||
|
currentPaths.add(RECYCLE_BIN)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mCurrentPathPrefix.isEmpty() && folders.contains(FAVORITES)) {
|
||||||
|
currentPaths.add(FAVORITES)
|
||||||
|
}
|
||||||
|
|
||||||
if (folders.size == currentPaths.size) {
|
if (folders.size == currentPaths.size) {
|
||||||
return currentPaths
|
return currentPaths
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue