package com.example.base.widget

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.chad.library.adapter.base.loadmore.BaseLoadMoreView
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.base.R

/**
 * 加载更多view
 */

class MyLoadMoreView : BaseLoadMoreView() {

    override fun getLoadComplete(holder: BaseViewHolder): View {
        return holder.getView(R.id.tvLoadEnd)
    }

    override fun getLoadEndView(holder: BaseViewHolder): View {
        return holder.getView(R.id.tvLoadEnd)
    }

    override fun getLoadFailView(holder: BaseViewHolder): View {
        return holder.getView(R.id.tvLoadFail)
    }

    override fun getLoadingView(holder: BaseViewHolder): View {
        return holder.getView(R.id.llLoading)
    }

    override fun getRootView(parent: ViewGroup): View {
        return LayoutInflater.from(parent.context).inflate(R.layout.mvvm_list_loadmore, parent, false)
    }

}