package com.hainaos.vc.fragment.video;

import androidx.lifecycle.MutableLiveData;

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

import java.util.ArrayList;

public class VideoViewModel extends BaseViewModel<FragmentVideoBinding, FragmentEvent> {

    @Override
    public FragmentVideoBinding 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().getHomeVideoFragment(getLifecycle(), new NetInterfaceManager.onVideoPathCallback() {
            @Override
            public void setVideoList(ArrayList<LocalVideoInfo> videoList) {
                mPhotoInfosData.setValue(videoList);
            }

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