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

import android.os.Bundle;

import androidx.lifecycle.ViewModelProviders;

import com.phlx.anchorcollect.R;
import com.phlx.anchorcollect.data.VMFactory;
import com.phlx.anchorcollect.databinding.ActivityExchangeListBinding;
import com.phlx.anchorcollect.entity.InspectEntity;
import com.phlx.anchorcollect.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();
    }
}
