package com.base.datarecovery.activity

import android.graphics.Color
import android.os.Bundle
import androidx.activity.addCallback
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.base.datarecovery.R
import com.base.datarecovery.bean.ConstObject.SCAN_DOCUMENTS
import com.base.datarecovery.bean.ConstObject.SCAN_PHOTOS
import com.base.datarecovery.bean.ConstObject.SCAN_VIDEOS
import com.base.datarecovery.databinding.ActivityFileRecoveredBinding
import com.base.datarecovery.help.BaseActivity
import com.base.datarecovery.utils.BarUtils

class FileRecoveredActivity : BaseActivity<ActivityFileRecoveredBinding>() {

    override val binding: ActivityFileRecoveredBinding by lazy {
        ActivityFileRecoveredBinding.inflate(layoutInflater)
    }


    override fun initView() {

        BarUtils.setStatusBarLightMode(this, true)
        BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
        
        val number = intent.extras?.getInt("Number") ?: 0
        val scanType = intent.extras?.getInt("ScanType")

        binding.tvNumber.text = number.toString()
        val type = when (scanType) {
            SCAN_PHOTOS -> if (number == 1) "Photo" else "Photos"
            SCAN_VIDEOS -> if (number == 1) "Video" else "Videos"
            SCAN_DOCUMENTS -> if (number == 1) "Document" else "Documents"
            else -> ""
        }
        binding.tvType.text = type
    }

    override fun initListener() {

        binding.flFanhui.setOnClickListener {
            onBackPressedDispatcher.onBackPressed()
        }
        onBackPressedDispatcher.addCallback {
            finishToMain()
        }
        binding.tvContinue.setOnClickListener {
            finish()
        }
        binding.tvFinish.setOnClickListener {
            onBackPressedDispatcher.onBackPressed()
        }
    }

}