package com.cheng.bole.ui.fragment.guide

import android.os.Bundle
import com.cheng.bole.R
import com.cheng.bole.databinding.FragmentGuideItemBinding
import com.example.base.ui.BaseFragment

class GuideItemFragment : BaseFragment<FragmentGuideItemBinding, GuideViewModel>() {
    private val curPos by lazy { arguments?.getInt("curPos") ?: 0 }

    companion object {
        fun newInstance(pos: Int): GuideItemFragment {
            val bundle = Bundle()
            bundle.putInt("curPos", pos)
            val f = GuideItemFragment()
            f.arguments = bundle
            return f
        }

    }

    override fun initView() {
        super.initView()
        when (curPos) {
            0 -> binding.ivGuide.setBackgroundResource(R.mipmap.ic_guide_1)
            1 -> binding.ivGuide.setBackgroundResource(R.mipmap.ic_guide_2)
            2 -> binding.ivGuide.setBackgroundResource(R.mipmap.ic_guide_3)
            3 -> binding.ivGuide.setBackgroundResource(R.mipmap.ic_guide_4)
        }
    }

    override fun initListener() {
        super.initListener()
    }

}