mirror of
https://github.com/InvertGeek/MixFile.git
synced 2026-06-05 19:36:03 +08:00
优化收藏排序
This commit is contained in:
@@ -14,8 +14,8 @@ android {
|
||||
applicationId = "com.donut.mixfile"
|
||||
minSdk = 24
|
||||
targetSdk = 34
|
||||
versionCode = 40
|
||||
versionName = "1.4.9"
|
||||
versionCode = 41
|
||||
versionName = "1.4.10"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
|
||||
@@ -40,6 +40,7 @@ import com.donut.mixfile.util.file.updateMark
|
||||
import com.donut.mixfile.util.formatFileSize
|
||||
import com.donut.mixfile.util.truncate
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
@@ -125,10 +126,13 @@ val Favorites = MixNavPage(
|
||||
"最大" -> result = result.sortedByDescending { it.size }
|
||||
"最小" -> result = result.sortedBy { it.size }
|
||||
"名称" -> {
|
||||
val resultCache = result
|
||||
scope.launch(Dispatchers.IO) {
|
||||
val sorted = result.sortedBy { it.getNameNum() }
|
||||
withContext(Dispatchers.Main) {
|
||||
result = sorted
|
||||
if (resultCache == result){
|
||||
result = sorted
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user