package com.xty.base.refresh

import com.scwang.smart.refresh.layout.SmartRefreshLayout

//刷新
class RefreshUtils {

    private fun setRefreshListener(view: SmartRefreshLayout) {
        //刷新
        view.setOnRefreshListener {
            view.finishRefresh(1000)


        }
        //加载更多
        view.setOnLoadMoreListener {
            view.finishLoadMore(1000)
        }
    }

    //仅用刷新
      fun setRefresh(view: SmartRefreshLayout,refresh:()->Unit) {
        //刷新
        view.setOnRefreshListener {
            view.finishRefresh(1000)
            refresh.invoke()
        }
        view.setEnableLoadMore(false)
    }

    fun setRefreshListener(){

    }
}