package com.hongyegroup.cpt_rewards.ui

import android.content.Intent
import android.os.Bundle
import androidx.databinding.ViewDataBinding
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.ActivityRewardsSearchBinding
import com.hongyegroup.cpt_rewards.mvvm.RewardsSearchViewModel

class RewardsSearchActivity : BaseVDBActivity<RewardsSearchViewModel, ActivityRewardsSearchBinding>() {

    companion object {

        fun startInstance() {
            val context = CommUtils.getContext()
            val intent = Intent(context, RewardsSearchActivity::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..8){

            mViewModel.mRewardsData.add("")

        }

        mBinding.recyclerViewRewardsSearch.vertical().adapter=mViewModel.mRewardsAdapter
        mViewModel.mRewardsAdapter.notifyDataSetChanged()

    }

    override fun getDataBindingConfig(): DataBindingConfig {

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

    }

    override fun startObserve() {

    }
}