package com.zxhy.simplefilesmanager.simplemanager

import android.content.Intent
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.zxhy.simplefilesmanager.R
import com.zxhy.simplefilesmanager.databinding.FragmentSimpleManagerBinding
import com.zxhy.simplefilesmanager.simpledup.SimpleDupActivity
import com.zxhy.simplefilesmanager.simplelist.SimpleListActivity

class SimpleManagerFragment() : Fragment() {

    private lateinit var binding: FragmentSimpleManagerBinding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
    }

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        val root = inflater.inflate(R.layout.fragment_simple_manager, container, false)
        binding = FragmentSimpleManagerBinding.bind(root)
        return root
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        binding.llDupPicture.setOnClickListener {
            startActivity(Intent(requireContext(), SimpleDupActivity::class.java))
        }
        binding.llLarge.setOnClickListener {
            startActivity(Intent(requireContext(), SimpleListActivity::class.java).apply {
                putExtra("Tittle", "LARGE FILE")
            })
        }

    }

    companion object {
        const val DEEPLINK_SIMPLE_MANAGER_URI = "https://www.zxhy.com/simplemanager/"
    }
}