package com.test.basd.onecleanmaster.activity

import android.content.Intent
import android.graphics.Color
import androidx.activity.OnBackPressedCallback
import androidx.core.view.updatePadding
import com.blankj.utilcode.util.BarUtils
import com.test.basd.onecleanmaster.databinding.ActivityLayoutSpeakerCleanBinding
import com.test.basd.onecleanmaster.helps.BaseActivity

class SpeakerCleanerActivity : BaseActivity<ActivityLayoutSpeakerCleanBinding>() {


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

    override fun initView() {
        BarUtils.setStatusBarLightMode(this, true)
        BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
        binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
        initListener()
    }


    override fun initListener() {
        binding.idBackSpeakCleaner.setOnClickListener {
            onBackPressedDispatcher.onBackPressed()
        }
        onBackPressedDispatcher.addCallback(object : OnBackPressedCallback(true) {
            override fun handleOnBackPressed() {
                finishToMain()
            }
        })
        binding.idCleanDust.setOnClickListener {
            startActivity(Intent(this, SpeakCleaningActivity::class.java))
        }
    }
}