package com.lukouguoji.module_base.impl

import androidx.databinding.ObservableList

class ListChangedCallBackImpl(
    val callBack: (sender: ObservableList<Any>?) -> Unit
) : ObservableList.OnListChangedCallback<ObservableList<Any>>() {
    override fun onChanged(sender: ObservableList<Any>?) {
        callBack(sender)
    }

    override fun onItemRangeChanged(
        sender: ObservableList<Any>?,
        positionStart: Int,
        itemCount: Int
    ) {
        callBack(sender)
    }

    override fun onItemRangeInserted(
        sender: ObservableList<Any>?,
        positionStart: Int,
        itemCount: Int
    ) {
        callBack(sender)
    }

    override fun onItemRangeMoved(
        sender: ObservableList<Any>?,
        fromPosition: Int,
        toPosition: Int,
        itemCount: Int
    ) {
        callBack(sender)
    }

    override fun onItemRangeRemoved(
        sender: ObservableList<Any>?,
        positionStart: Int,
        itemCount: Int
    ) {
        callBack(sender)
    }
}