package com.hainaos.vc.activity.video;

import androidx.lifecycle.MutableLiveData;

import com.hainaos.vc.base.mvvm.BaseViewModel;
import com.hainaos.vc.bean.LocalVideoInfo;
import com.hainaos.vc.databinding.ActivityVideoBinding;
import com.hainaos.vc.network.NetInterfaceManager;
import com.trello.rxlifecycle4.android.ActivityEvent;

import java.util.ArrayList;

public class VideoViewModel extends BaseViewModel<ActivityVideoBinding, ActivityEvent> {

    @Override
    public ActivityVideoBinding getVDBinding() {
        return binding;
    }

    @Override
    public void onDestroy() {

    }

    public MutableLiveData<ArrayList<LocalVideoInfo>> mPhotoInfosData = new MutableLiveData<>();

    public MutableLiveData<Boolean> mCompleteData = new MutableLiveData<>();

    public void getHomeVideo() {
        NetInterfaceManager.getInstance().getHomeVideo(true, getLifecycle(), new NetInterfaceManager.onVideoPathCallback() {
            @Override
            public void setVideoList(ArrayList<LocalVideoInfo> videoList) {
                mPhotoInfosData.setValue(videoList);
            }

            @Override
            public void onComplete() {
                mCompleteData.setValue(true);
            }
        });
    }
}
