package com.phlx.wool.ui.cattle.activity;

import android.os.Bundle;

import androidx.lifecycle.ViewModelProviders;

import com.phlx.wool.R;
import com.phlx.wool.data.VMFactory;
import com.phlx.wool.databinding.ActivityCattleUploadBinding;
import com.phlx.wool.ui.base.BaseActivity;
import com.phlx.wool.ui.cattle.vm.CattleUploadVM;

import me.tatarka.bindingcollectionadapter2.BR;

public class CattleUploadActivity extends BaseActivity<ActivityCattleUploadBinding, CattleUploadVM> {
    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.activity_cattle_upload;
    }

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

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

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

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

        setSupportActionBar(binding.include.toolbar);
        viewModel.initToolbar();
    }

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

    @Override
    protected void onResume() {
        super.onResume();

        viewModel.refreshUploadCount();
    }
}
