package com.base.filerecoveryrecyclebin.fragment

import android.content.Intent
import com.base.filerecoveryrecyclebin.activity.recovery.FileScanResultActivity
import com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper
import com.base.filerecoveryrecyclebin.bean.ConstObject
import com.base.filerecoveryrecyclebin.databinding.FragmentRecoveryBinding
import com.base.filerecoveryrecyclebin.help.BaseFragment


class RecoveryFragment : BaseFragment<FragmentRecoveryBinding>() {

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


    override fun setView() {
        binding.cardRyPhotos.setOnClickListener {
            startActivity(Intent(requireContext(), FileScanResultActivity::class.java).apply {
                putExtra("ScanType", ConstObject.SCAN_PHOTOS)
            })
        }
        binding.cardRyVideos.setOnClickListener {
            startActivity(Intent(requireContext(), FileScanResultActivity::class.java).apply {
                putExtra("ScanType", ConstObject.SCAN_VIDEOS)
            })
        }
        binding.cardRyAudios.setOnClickListener {
            startActivity(Intent(requireContext(), FileScanResultActivity::class.java).apply {
                putExtra("ScanType", ConstObject.SCAN_AUDIOS)
            })
        }
        binding.cardRyDocuments.setOnClickListener {
            startActivity(Intent(requireContext(), FileScanResultActivity::class.java).apply {
                putExtra("ScanType", ConstObject.SCAN_DOCUMENTS)
            })
        }
    }


    override fun onResume() {
        super.onResume()
        AdmobMaxHelper.admobMaxShowNativeAd(requireActivity(), binding.flAd, 1)
    }
}