mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 14:37:59 +01:00
fix Directory and media sorting
This commit is contained in:
parent
fa4cadebb4
commit
e5f9ea9627
4 changed files with 4 additions and 4 deletions
|
@ -385,7 +385,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
|
||||
scanFiles(invalidFiles) {}
|
||||
Medium.sorting = mConfig.sorting
|
||||
Collections.sort(media)
|
||||
media.sort()
|
||||
var j = 0
|
||||
for (medium in media) {
|
||||
if (medium.path == mPath) {
|
||||
|
|
|
@ -76,7 +76,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va
|
|||
val dirs = ArrayList(directories.values)
|
||||
filterDirectories(dirs)
|
||||
Directory.sorting = mConfig.directorySorting
|
||||
Collections.sort<Directory>(dirs)
|
||||
dirs.sort()
|
||||
|
||||
context.scanFiles(invalidFiles) {}
|
||||
return dirs
|
||||
|
|
|
@ -12,7 +12,7 @@ class Directory(val path: String, val thumbnail: String, val name: String, var m
|
|||
override fun compareTo(other: Directory): Int {
|
||||
var res: Int
|
||||
if (sorting and SORT_BY_NAME != 0) {
|
||||
res = path.compareTo(other.path)
|
||||
res = name.toLowerCase().compareTo(other.name.toLowerCase())
|
||||
} else if (sorting and SORT_BY_DATE != 0) {
|
||||
res = if (timestamp > other.timestamp) 1 else -1
|
||||
} else {
|
||||
|
|
|
@ -17,7 +17,7 @@ class Medium(val name: String, var path: String, val isVideo: Boolean, val times
|
|||
override fun compareTo(other: Medium): Int {
|
||||
var res: Int
|
||||
if (sorting and SORT_BY_NAME != 0) {
|
||||
res = path.compareTo(other.path)
|
||||
res = name.toLowerCase().compareTo(other.name.toLowerCase())
|
||||
} else if (sorting and SORT_BY_DATE != 0) {
|
||||
res = if (timestamp > other.timestamp) 1 else -1
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue