package com.zxhy.simplefilesmanager.simplegrid

import androidx.lifecycle.viewModelScope
import com.zxhy.simplefilesmanager.simpleCommon.SimpleCommonViewModel
import com.zxhy.simplefilesmanager.simpledata.JoFileJo.Companion.isImage
import com.zxhy.simplefilesmanager.simpledata.JoFileJo.Companion.isVideo
import com.zxhy.simplefilesmanager.simpledata.JoGridFileJo
import com.zxhy.simplefilesmanager.simpledata.JoGridFileJo.Companion.joGridFileJo
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import java.io.File

class SimpleGridViewModel : SimpleCommonViewModel() {


    fun loadImage(
        onDo: (list: List<JoGridFileJo>) -> Unit,
        onFinish: (list: List<JoGridFileJo>) -> Unit
    ) = loadFile(::isImage, ::joGridFileJo, onDo, onFinish)

    fun loadVideo(
        onDo: (list: List<JoGridFileJo>) -> Unit,
        onFinish: (list: List<JoGridFileJo>) -> Unit
    ) = loadFile(::isVideo, ::joGridFileJo, onDo, onFinish)
}