We need an API to determine whether two items can swap positions, such as if they are of the same type or group.
@Calvin-LL Is it possible to add a shouldMoveState parameter and its corresponding call here?
shouldMoveState: State<suspend CoroutineScope.(from: LazyListItemInfo, to: LazyListItemInfo) -> Boolean>
it.index != draggingItem.index && shouldMoveState.value.invoke(it, draggingItem)
|
val targetItem = findTargetItem( |
|
draggingItemRect, |
|
items = state.layoutInfo.visibleItemsInfo, |
|
) { |
|
it.index != draggingItem.index |
|
} |
Originally posted by @MankinChung in #91