package com.easy.clean.ui.set

import androidx.core.graphics.Insets
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.easy.clean.base.BaseActivity
import com.easy.clean.databinding.ActivitySettingBinding

class SettingActivity : BaseActivity<ActivitySettingBinding>(ActivitySettingBinding::inflate) {


    var insetsCallBack: ((insets: Insets) -> Unit)? = null

    override fun useDefaultImmersive() {
        setStatusBarColor()
        ViewCompat.setOnApplyWindowInsetsListener(binding.root) { v, insets ->
            val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
            v.setPadding(systemBars.left, 0, systemBars.right, systemBars.bottom)

            insetsCallBack?.invoke(systemBars)
            insetsCallBack = null

            insets
        }
    }

    override fun initView() {
        super.initView()
    }

    override fun initListener() {
        super.initListener()
    }

}