mirror of
https://github.com/gkd-kit/gkd.git
synced 2024-11-16 11:42:22 +08:00
perf: longPressDraggableHandle
This commit is contained in:
parent
5e58901aa6
commit
2eb76cd1cd
|
@ -293,7 +293,7 @@ fun useSubsManagePage(): ScaffoldExt {
|
||||||
)
|
)
|
||||||
Card(
|
Card(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.draggableHandle(onDragStopped = {
|
.longPressDraggableHandle(onDragStopped = {
|
||||||
val changeItems = mutableListOf<SubsItem>()
|
val changeItems = mutableListOf<SubsItem>()
|
||||||
orderSubItems.forEachIndexed { i, subsItem ->
|
orderSubItems.forEachIndexed { i, subsItem ->
|
||||||
if (subItems[i] != subsItem) {
|
if (subItems[i] != subsItem) {
|
||||||
|
@ -305,8 +305,10 @@ fun useSubsManagePage(): ScaffoldExt {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (orderSubItems.isNotEmpty()) {
|
if (orderSubItems.isNotEmpty()) {
|
||||||
|
vm.viewModelScope.launchTry {
|
||||||
DbSet.subsItemDao.update(*changeItems.toTypedArray())
|
DbSet.subsItemDao.update(*changeItems.toTypedArray())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.shadow(elevation)
|
.shadow(elevation)
|
||||||
.animateItemPlacement()
|
.animateItemPlacement()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user