package com.xyzshell.myphoneinfo.dashboard

import android.graphics.Color
import android.os.Bundle
import android.view.View
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.xyzshell.myphoneinfo.R
import com.xyzshell.myphoneinfo.databinding.ActivityColorsBinding
import androidx.core.graphics.toColorInt

class ColorsActivity : AppCompatActivity() {
    private lateinit var binding:ActivityColorsBinding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
       binding=ActivityColorsBinding.inflate(layoutInflater)
        setContentView(binding.root)
        val colorList = listOf("#D9D9D9","#FF6262","#C3FF62","#62FFC8","#46CEFF","#9946FF","#FFE062","#FF9C46","#FF46D7","#101010")
        binding.colorPage1.continueL.setOnClickListener {
            binding.colorPage1.continueL.visibility= View.GONE
            binding.colorPage1.colorL.visibility= View.VISIBLE
        }
       val colorView=listOf(binding.colorPage1.color1,binding.colorPage1.color2,binding.colorPage1.color3,binding.colorPage1.color4,binding.colorPage1.color5,binding.colorPage1.color6,binding.colorPage1.color7,binding.colorPage1.color8,binding.colorPage1.color9)
        for (i in 0 until colorList.size-1) {
            colorView[i].setOnClickListener { v->
                binding.colorPage1.root.visibility= View.GONE
                binding.colorPage2.root.visibility= View.VISIBLE
                binding.colorPage2.view.setBackgroundColor(colorList[i].toColorInt())

            }
        }
    }
}