package com.gh.gamecenter.feedback.view.qa

import android.os.Bundle
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import com.gh.gamecenter.common.baselist.ListFragment
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.common.utils.viewModelProvider
import com.gh.gamecenter.feedback.entity.HelpEntity

class HelpQaDefaultFragment : ListFragment<HelpEntity, HelpQaDefaultViewModel>() {
    private lateinit var mViewModel: HelpQaDefaultViewModel
    private var mAdapter: HelpQaDefaultAdapter? = null

    override fun provideListAdapter(): HelpQaDefaultAdapter {
        if (mAdapter == null) {
            mAdapter = HelpQaDefaultAdapter(requireContext(), true)
        }
        return mAdapter as HelpQaDefaultAdapter
    }

    override fun provideListViewModel(): HelpQaDefaultViewModel {
        mViewModel = viewModelProvider()
        return mViewModel
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        mCachedView?.setBackgroundColor(com.gh.gamecenter.common.R.color.ui_surface.toColor(requireContext()))
    }

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