package com.gh.gamecenter.gamedetail.fuli.kaifu

import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import com.gh.gamecenter.common.baselist.LazyListFragment
import com.gh.gamecenter.common.baselist.ListAdapter
import com.gh.gamecenter.common.utils.viewModelProvider
import com.gh.gamecenter.feature.entity.ServerCalendarGame

/**
 * 开服订阅-开服提醒
 */
class ServersCalendarRemindListFragment : LazyListFragment<ServerCalendarGame, ServersCalendarRemindListViewModel>() {

    private var adapter: ServersCalendarRemindListAdapter? = null

    override fun provideListAdapter(): ListAdapter<*> {
        return adapter ?: ServersCalendarRemindListAdapter(
            requireContext(),
            mListViewModel
        ).apply {
            adapter = this
        }
    }

    override fun onFragmentFirstVisible() {
        super.onFragmentFirstVisible()
        mCachedView.background = ContextCompat.getDrawable(requireContext(), com.gh.gamecenter.common.R.color.ui_surface)
    }

    override fun getItemDecoration(): RecyclerView.ItemDecoration? = null

    override fun provideListViewModel(): ServersCalendarRemindListViewModel {
        return viewModelProvider()
    }
}