package com.sixin.module_p.ui.enter.home

import android.widget.LinearLayout
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import com.lukouguoji.module_base.base.BaseBindingFragment
import com.lukouguoji.module_base.base.CommonAdapter
import com.sixin.module_p.R
import com.sixin.module_p.databinding.FragmentPdaHomeBinding

class HomeFragment : BaseBindingFragment<FragmentPdaHomeBinding, HomeViewModel>() {
    override fun layoutId(): Int {
        return R.layout.fragment_pda_home
    }

    override fun viewModelClass(): Class<HomeViewModel> {
        return HomeViewModel::class.java
    }

    override fun initOnViewCreated() {
        viewModel.onInit()
        binding.viewModel = viewModel

        binding.rv.adapter =
            CommonAdapter(requireContext(), R.layout.item_pda_home, HomeViewHolder::class.java)
        viewModel.pageModel.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, this)

        viewModel.refresh()
    }

    companion object {
        fun newInstance(): Fragment {
            return HomeFragment()
        }
    }

}