Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

ItemListEditor

SeungHyun edited this page Jun 20, 2020 · 4 revisions

ItemListEditor allows us to modify the item list of recycler view.

Definition

interface ItemListEditor<ITEM> {
    fun addItem(item: ITEM)
    fun addItem(position: Int, item: ITEM)
    fun addItems(items: List<ITEM>)
    fun addItems(startPosition: Int, items: List<ITEM>)

    fun removeItem(item: ITEM): Int
    fun removeItem(position: Int)
    fun removeItems(startPosition: Int, itemCount: Int)

    fun changeItem(position: Int, item: ITEM)
    fun changeItems(startPosition: Int, items: List<ITEM>)
    fun changeAll(items: List<ITEM>)

    fun moveItem(fromPosition: Int, toPosition: Int)
}
Clone this wiki locally