package com.dumpster.cleaner.ui.set

import androidx.core.graphics.Insets
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.dumpster.cleaner.base.BaseActivity
import com.dumpster.cleaner.databinding.ActivitySettingBinding

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

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

    override fun useDefaultImmersive() {
        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()
    }

    override fun handleBackCallBack() {
//        super.handleBackCallBack()
        finish()
    }
}