mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
a0860ca956
commit
e7fbe6689c
@ -59,24 +59,13 @@ class ImportBookViewModel(application: Application) : BaseViewModel(application)
|
||||
}.map { docList ->
|
||||
when (sort) {
|
||||
2 -> docList.sortedWith(
|
||||
compareBy(
|
||||
{ !it.isDir },
|
||||
{ it.date },
|
||||
{ it.name }
|
||||
)
|
||||
compareBy({ !it.isDir }, { it.date }, { it.name })
|
||||
)
|
||||
1 -> docList.sortedWith(
|
||||
compareBy(
|
||||
{ !it.isDir },
|
||||
{ it.size },
|
||||
{ it.name }
|
||||
)
|
||||
compareBy({ !it.isDir }, { it.size }, { it.name })
|
||||
)
|
||||
else -> docList.sortedWith(
|
||||
compareBy(
|
||||
{ !it.isDir },
|
||||
{ it.name }
|
||||
)
|
||||
compareBy({ !it.isDir }, { it.name })
|
||||
)
|
||||
}
|
||||
}.flowOn(IO)
|
||||
|
Loading…
Reference in New Issue
Block a user