package com.hongyegroup.cpt_rewards.ui

import android.content.Intent
import android.os.Bundle
import com.guadou.lib_baselib.base.activity.BaseVDBActivity
import com.guadou.lib_baselib.bean.DataBindingConfig
import com.guadou.lib_baselib.ext.vertical
import com.guadou.lib_baselib.utils.CommUtils
import com.hongyegroup.cpt_rewards.BR
import com.hongyegroup.cpt_rewards.R
import com.hongyegroup.cpt_rewards.databinding.ActivityRewardsListBinding
import com.hongyegroup.cpt_rewards.databinding.ActivityRewardsListBindingImpl
import com.hongyegroup.cpt_rewards.mvvm.RewardsListViewModel

class RewardsListActivity:BaseVDBActivity<RewardsListViewModel, ActivityRewardsListBinding>() {

    companion object {

        fun startInstance() {
            val context = CommUtils.getContext()
            val intent = Intent(context, RewardsListActivity::class.java)
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
            context.startActivity(intent)
        }

    }

    override fun init(savedInstanceState: Bundle?) {

        initView()

    }

    private fun initView() {

        for (index in 0..9){

            mViewModel.mRewardsListData.add("")

        }

        mBinding.recyclerViewRewardsList.vertical().adapter=mViewModel.mRewardsListAdapter
        mViewModel.mRewardsListAdapter.notifyDataSetChanged()

    }

    override fun getDataBindingConfig(): DataBindingConfig {

        return DataBindingConfig(R.layout.activity_rewards_list,BR.viewModel,mViewModel)

    }

    override fun startObserve() {

    }
}