mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 04:57:59 +01:00
remove another redundant function for getting unique directories
This commit is contained in:
parent
a0798bcd29
commit
32012061a6
1 changed files with 4 additions and 7 deletions
|
@ -962,11 +962,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getUniqueSortedDirs(dirs: ArrayList<Directory>): ArrayList<Directory> {
|
|
||||||
val distinctDirs = dirs.distinctBy { it.path.getDistinctPath() } as ArrayList<Directory>
|
|
||||||
return getSortedDirectories(distinctDirs)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun createDirectoryFromMedia(path: String, curMedia: ArrayList<Medium>, albumCovers: ArrayList<AlbumCover>, hiddenString: String,
|
private fun createDirectoryFromMedia(path: String, curMedia: ArrayList<Medium>, albumCovers: ArrayList<AlbumCover>, hiddenString: String,
|
||||||
includedFolders: MutableSet<String>, isSortingAscending: Boolean): Directory {
|
includedFolders: MutableSet<String>, isSortingAscending: Boolean): Directory {
|
||||||
var thumbnail = curMedia.firstOrNull { getDoesFilePathExist(it.path) }?.path ?: ""
|
var thumbnail = curMedia.firstOrNull { getDoesFilePathExist(it.path) }?.path ?: ""
|
||||||
|
@ -997,8 +992,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
|
|
||||||
private fun setupAdapter(dirs: ArrayList<Directory>, textToSearch: String = "") {
|
private fun setupAdapter(dirs: ArrayList<Directory>, textToSearch: String = "") {
|
||||||
val currAdapter = directories_grid.adapter
|
val currAdapter = directories_grid.adapter
|
||||||
val updatedDirs = getUniqueSortedDirs(dirs).toMutableList() as ArrayList
|
val distinctDirs = dirs.distinctBy { it.path.getDistinctPath() }.toMutableList() as ArrayList<Directory>
|
||||||
var dirsToShow = getDirsToShow(updatedDirs).clone() as ArrayList<Directory>
|
val sortedDirs = getSortedDirectories(distinctDirs)
|
||||||
|
var dirsToShow = getDirsToShow(sortedDirs).clone() as ArrayList<Directory>
|
||||||
|
|
||||||
if (currAdapter == null) {
|
if (currAdapter == null) {
|
||||||
initZoomListener()
|
initZoomListener()
|
||||||
val fastscroller = if (config.scrollHorizontally) directories_horizontal_fastscroller else directories_vertical_fastscroller
|
val fastscroller = if (config.scrollHorizontally) directories_horizontal_fastscroller else directories_vertical_fastscroller
|
||||||
|
|
Loading…
Reference in a new issue