package com.xyzshell.myphoneinfo.dashboard

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.ActivityTestOtherBinding

class TestOtherActivity : AppCompatActivity() {
    private lateinit var binding: ActivityTestOtherBinding

    companion object {
        var TYPE_KEY = "type"
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityTestOtherBinding.inflate(layoutInflater)
        setContentView(binding.root)
        binding.back.setOnClickListener { finish() }
        when (intent.getStringExtra(TYPE_KEY)) {
            getString(R.string.flashlight) -> {
                binding.title.text = getString(R.string.flashlight)
                binding.icon.setImageResource(R.mipmap.big_icon_1)
            }

            getString(R.string.vibration) -> {
                binding.title.text = getString(R.string.vibration)
                binding.icon.setImageResource(R.mipmap.big_icon_2)
            }

            getString(R.string.buttons) -> {
                binding.title.text = getString(R.string.buttons)
                binding.icon.setImageResource(R.mipmap.big_icon_3)
                binding.button.visibility = View.VISIBLE
                binding.titleDialog.text=getString(R.string.did_you_get_feedback)
            }

            getString(R.string.backlight) -> {
                binding.title.text = getString(R.string.backlight)
                binding.icon.setImageResource(R.mipmap.big_icon_4)
                binding.backLight.visibility = View.VISIBLE
                binding.titleDialog.text=getString(R.string.did_you_get_feedback)
            }
            getString(R.string.light_sensor)->{
                binding.title.text = getString(R.string.light_sensor)
                binding.icon.visibility = View.GONE
                binding.sensor.visibility = View.VISIBLE
            }
            getString(R.string.proximity)->{
                binding.title.text = getString(R.string.proximity)
                binding.icon.visibility = View.GONE
                binding.proximity.visibility = View.VISIBLE
            }
            getString(R.string.accelerometer)->{
                binding.title.text = getString(R.string.accelerometer)
                binding.icon.visibility = View.GONE
            }
        }
    }
}