package com.base.easyfilemanager.fragment

import android.content.Intent
import com.base.easyfilemanager.activity.AppManagerActivity
import com.base.easyfilemanager.activity.BatteryInfoActivity
import com.base.easyfilemanager.activity.DeviceScanInfoActivity
import com.base.easyfilemanager.activity.LargeFileCleanActivity
import com.base.easyfilemanager.activity.NetWorkActivity
import com.base.easyfilemanager.activity.RecentAppActivity
import com.base.easyfilemanager.activity.RepeatPhotoActivity
import com.base.easyfilemanager.activity.ScanJunkActivity
import com.base.easyfilemanager.activity.ScreenShotActivity
import com.base.easyfilemanager.activity.photocompress.photo.StartCompressionPhotoActivity
import com.base.easyfilemanager.adapter.ToolsAdapter
import com.base.easyfilemanager.databinding.FragmentLayoutTools1Binding
import com.base.easyfilemanager.helps.BaseFragment
import com.base.easyfilemanager.notificationclean.NotificationGuestActivity
import com.base.easyfilemanager.view.AFunOb
import com.base.easyfilemanager.view.AFunOb.APP_MANAGER
import com.base.easyfilemanager.view.AFunOb.BATTERY_INFO
import com.base.easyfilemanager.view.AFunOb.DEVICE_SCAN
import com.base.easyfilemanager.view.AFunOb.LARGE_FILE_CLEANER
import com.base.easyfilemanager.view.AFunOb.NETWORK_TRAFFIC
import com.base.easyfilemanager.view.AFunOb.NOTIFICATION_CLEANER
import com.base.easyfilemanager.view.AFunOb.PHOTO_COMPRESS
import com.base.easyfilemanager.view.AFunOb.RECENT_APP_USAGE
import com.base.easyfilemanager.view.AFunOb.SCREENSHOT_CLEANER
import com.base.easyfilemanager.view.AFunOb.SIMILAR_PHOTOS

class ToolsFragment : BaseFragment<FragmentLayoutTools1Binding>() {
    private lateinit var adapter: ToolsAdapter

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

    override fun setView() {
        adapter = ToolsAdapter(requireActivity()) { kName ->
            when (kName) {
                AFunOb.JUNK_CLEANER -> {
                    startActivity(Intent(requireContext(), ScanJunkActivity::class.java))
                }

                RECENT_APP_USAGE -> {
                    startActivity(Intent(requireActivity(), RecentAppActivity::class.java))
                }

                LARGE_FILE_CLEANER -> {
                    startActivity(Intent(requireContext(), LargeFileCleanActivity::class.java))
                }

                NOTIFICATION_CLEANER -> {
                    startActivity(Intent(requireActivity(), NotificationGuestActivity::class.java))
                }

                NETWORK_TRAFFIC -> {
                    startActivity(Intent(requireContext(), NetWorkActivity::class.java))
                }

                APP_MANAGER -> {
                    startActivity(Intent(requireContext(), AppManagerActivity::class.java))
                }

                SIMILAR_PHOTOS -> {
                    startActivity(Intent(requireContext(), RepeatPhotoActivity::class.java))
                }

                PHOTO_COMPRESS -> {
                    startActivity(Intent(requireActivity(), StartCompressionPhotoActivity::class.java))
                }

                BATTERY_INFO -> {
                    startActivity(Intent(requireActivity(), BatteryInfoActivity::class.java))
                }

                DEVICE_SCAN -> {
                    startActivity(Intent(requireActivity(), DeviceScanInfoActivity::class.java))
                }

                SCREENSHOT_CLEANER -> {
                    startActivity(Intent(requireActivity(), ScreenShotActivity::class.java))
                }

            }
        }
        binding.rvTools.adapter = adapter

    }

    override fun onResume() {
        super.onResume()
    }
}