optimize direct transfer UI and Android queue
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
package com.qft.optical
|
||||
|
||||
/** Move one item while preserving every other item's relative order. */
|
||||
internal fun <T> moveQueueItem(items: MutableList<T>, from: Int, to: Int): Boolean {
|
||||
if (from !in items.indices || to !in items.indices || from == to) return false
|
||||
items.add(to, items.removeAt(from))
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user