package com.zxhy.simplefilesmanager.simpledata

import android.content.Context
import android.text.format.Formatter
import android.widget.ImageView
import java.io.File
import java.text.SimpleDateFormat
import java.util.Locale

class JoListFileJo(
    var timeE: String = "",
    val sss: Int = 0,
) : JoFileJo() {

    companion object {

        fun JoListFileJo.isImage(): Boolean {
            return JoFileJo.isImage(toFile())
        }

        fun JoListFileJo.isVideo(): Boolean {
            return JoFileJo.isVideo(toFile())
        }

        fun joListFileJo(file: File): JoListFileJo {

            return JoListFileJo().apply {
                fName = file.name
                timeE = file.timeE()
                path = file.absolutePath
            }
        }

        fun File.sizeF(context: Context): String {
            return Formatter.formatFileSize(context, length())
        }

        fun File.timeE(): String {
            return SimpleDateFormat("MMM dd, yyyy", Locale.ENGLISH).format(lastModified())
        }

    }


}

