package com.gh.common.util

import android.content.Context
import com.zhihu.matisse.MimeType
import com.zhihu.matisse.filter.Filter
import com.zhihu.matisse.internal.entity.IncapableCause
import com.zhihu.matisse.internal.entity.Item

class GhMatisseFilter : Filter() {

    override fun constraintTypes(): MutableSet<MimeType> {
        return MimeType.ofVideo()
    }

    override fun filter(context: Context?, item: Item?): IncapableCause? {
        if (!needFiltering(context, item)) return null
        return IncapableCause(IncapableCause.TOAST, "暂不支持视频")
    }

}