package com.base.filerecoveryrecyclebin.fragment

import android.animation.ValueAnimator
import android.annotation.SuppressLint
import android.content.Intent
import com.base.filerecoveryrecyclebin.activity.SettingActivity
import com.base.filerecoveryrecyclebin.activity.appprocess.AppProcessAnimationActivity
import com.base.filerecoveryrecyclebin.activity.junkclean.ScanJunkActivity
import com.base.filerecoveryrecyclebin.activity.largefile.LargeFileAnimationActivity
import com.base.filerecoveryrecyclebin.activity.repeat.RepeatAnimationActivity
import com.base.filerecoveryrecyclebin.activity.screenshot.ScreenShotAnimationActivity
import com.base.filerecoveryrecyclebin.activity.whatsapp.WhatsAppCleanerAnimationActivity
import com.base.filerecoveryrecyclebin.databinding.FragmentHome3Binding
import com.base.filerecoveryrecyclebin.help.BaseFragment

class HomeFragment : BaseFragment<FragmentHome3Binding>() {
    private val TAG = "HomeFragment"

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

    @SuppressLint("SetTextI18n")
    override fun setView() {
        binding.tvTitle.text = "Dumpster"
        binding.lottie.repeatCount = ValueAnimator.INFINITE
    }

    override fun setListener() {
        binding.flScan.setOnClickListener {
            startActivity(Intent(requireContext(), ScanJunkActivity::class.java))
//            sendNotification(requireContext(), ConstObject.ID_JUNK_CLEAN_PUSH)
//            AppLovinSdk.getInstance( requireContext() ).showMediationDebugger()
        }
        binding.cardJunkClean.setOnClickListener {
            startActivity(Intent(requireContext(), ScanJunkActivity::class.java))
        }
        binding.cardWhatsapp.setOnClickListener {
            startActivity(Intent(requireContext(), WhatsAppCleanerAnimationActivity::class.java))
        }
        binding.cardAppProcess.setOnClickListener {
            startActivity(Intent(requireContext(), AppProcessAnimationActivity::class.java))
        }
        binding.cardLargeFile.setOnClickListener {
            startActivity(Intent(requireContext(), LargeFileAnimationActivity::class.java))
        }
        binding.cardScreenshot.setOnClickListener {
            startActivity(Intent(requireContext(), ScreenShotAnimationActivity::class.java))
        }
        binding.cardDuplicate.setOnClickListener {
            startActivity(Intent(requireContext(), RepeatAnimationActivity::class.java))
        }

        binding.flSetting.setOnClickListener {
            startActivity(Intent(requireContext(), SettingActivity::class.java))
        }

        binding.ivArrowUp.setOnClickListener {
            binding.nestedScrollView.smoothScrollTo(0, 0)
        }

    }

    override fun onPause() {
        super.onPause()
        binding.lottie.pauseAnimation()

    }

    override fun onResume() {
        super.onResume()
        binding.lottie.resumeAnimation()
    }

}