优化
This commit is contained in:
@@ -59,24 +59,13 @@ class ImportBookViewModel(application: Application) : BaseViewModel(application)
|
|||||||
}.map { docList ->
|
}.map { docList ->
|
||||||
when (sort) {
|
when (sort) {
|
||||||
2 -> docList.sortedWith(
|
2 -> docList.sortedWith(
|
||||||
compareBy(
|
compareBy({ !it.isDir }, { it.date }, { it.name })
|
||||||
{ !it.isDir },
|
|
||||||
{ it.date },
|
|
||||||
{ it.name }
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
1 -> docList.sortedWith(
|
1 -> docList.sortedWith(
|
||||||
compareBy(
|
compareBy({ !it.isDir }, { it.size }, { it.name })
|
||||||
{ !it.isDir },
|
|
||||||
{ it.size },
|
|
||||||
{ it.name }
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
else -> docList.sortedWith(
|
else -> docList.sortedWith(
|
||||||
compareBy(
|
compareBy({ !it.isDir }, { it.name })
|
||||||
{ !it.isDir },
|
|
||||||
{ it.name }
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}.flowOn(IO)
|
}.flowOn(IO)
|
||||||
|
|||||||
Reference in New Issue
Block a user