package com.phlx.anchorcollect.ui.info;

import android.os.Bundle;

import androidx.lifecycle.ViewModelProviders;

import com.phlx.anchorcollect.BR;
import com.phlx.anchorcollect.R;
import com.phlx.anchorcollect.data.VMFactory;
import com.phlx.anchorcollect.databinding.AvtivityCattleBinding;
import com.phlx.anchorcollect.ui.base.BaseActivity;


public class CattleActivity extends BaseActivity<AvtivityCattleBinding,CattleVM> {


    private String tag;


    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.avtivity_cattle;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    public void initParam() {
        super.initParam();
        Bundle mBundle = getIntent().getExtras();
        if (mBundle != null) {
            tag = mBundle.getString("Tag");
        }
    }

    @Override
    public CattleVM initViewModel() {
        VMFactory factory = VMFactory.getInstance(getApplication());
        return ViewModelProviders.of(this, factory).get(CattleVM.class);
    }

    @Override
    public void initData() {
        super.initData();
        //初始化标题
        viewModel.initToolbar();
        viewModel.setTag(tag);
    }
}
