package com.phlx.anchorcollect_p.ui.labelchange.list;

import android.os.Bundle;

import androidx.lifecycle.ViewModelProviders;


import com.phlx.anchorcollect_p.R;
import com.phlx.anchorcollect_p.data.VMFactory;
import com.phlx.anchorcollect_p.databinding.ActivityExchangeListBinding;
import com.phlx.anchorcollect_p.entity.InspectEntity;
import com.phlx.anchorcollect_p.ui.base.BaseActivity;

import java.util.List;

import me.tatarka.bindingcollectionadapter2.BR;

public class ExchangeListActivity extends BaseActivity<ActivityExchangeListBinding, ExchangeListVM> {

    List<InspectEntity> inspectEntities;
    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.activity_exchange_list;
    }

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

    @Override
    public void initParam() {
        super.initParam();

        Bundle _bundle = getIntent().getExtras();
        if (_bundle != null) {
            inspectEntities = _bundle.getParcelableArrayList("inspectEntityList");
        }
    }

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

    @Override
    public void initData() {
        super.initData();

        viewModel.initToolbar(inspectEntities);
    }

    @Override
    public void initViewObservable() {
        super.initViewObservable();
    }
}
