package com.zxhy.fastfilemanagerpro.kokodup

import android.content.Context
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.zxhy.fastfilemanagerpro.R
import com.zxhy.fastfilemanagerpro.databinding.ActivityKoDupFilekoBinding

class KoDupFilekoActivity : AppCompatActivity() {
    private lateinit var binding: ActivityKoDupFilekoBinding
    private val viewModel: KoDupFilekoViewModel by viewModels()
    private lateinit var context: Context
    private lateinit var adapter: KoDupFilekoAdapter
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        context = this
        binding = ActivityKoDupFilekoBinding.inflate(layoutInflater)
        setContentView(binding.root)
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
            val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
            insets
        }
    }


    fun enableDelete(enable: Boolean) {

        binding.tvDelete.isEnabled = enable

        if (enable) {
            binding.tvDelete.background =
                ContextCompat.getDrawable(context, R.drawable.bg_ffff6767_corners)
            binding.tvDelete.setTextColor(ContextCompat.getColor(context, R.color.white))
            binding.tvDelete.setOnClickListener {

            }
        } else {
            binding.tvDelete.background =
                ContextCompat.getDrawable(context, R.drawable.bg_fff4f4f4_corners)
            binding.tvDelete.setTextColor(ContextCompat.getColor(context, R.color.color_999999))
        }


    }

}