package com.base.appzxhy.ui.guide2

import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.view.WindowManager
import androidx.activity.addCallback
import androidx.core.view.postDelayed
import com.base.appzxhy.MyApplication
import com.base.appzxhy.base.BaseActivity
import com.base.appzxhy.business.ads.AdsMgr
import com.base.appzxhy.business.pangle.PangleInit.initPangle
import com.base.appzxhy.databinding.ActivityGuideInfoBinding

/**
 *Create by SleepDog on 2025-06-26
 */
class GuideAc : BaseActivity<ActivityGuideInfoBinding>(ActivityGuideInfoBinding::inflate) {
    override fun onCreate(savedInstanceState: Bundle?) {
        window?.run {
            val layoutParams = attributes
            layoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
            layoutParams.width = WindowManager.LayoutParams.WRAP_CONTENT
            layoutParams.height = WindowManager.LayoutParams.WRAP_CONTENT
            attributes = layoutParams
        }
        super.onCreate(savedInstanceState)
        onBackPressedDispatcher.addCallback {

        }
        initPangle(MyApplication.appContext)
        Log.e("tttttttttttttttttt", "OverLayStart")
        binding.root.postDelayed(2000) {
            ComponentUtil.setComponentEnabled(
                MyApplication.appContext,
                "com.base.appzxhy.ui.splash.SplashActivity",
                false
            )
            ComponentUtil.setComponentEnabled(
                MyApplication.appContext,
                "com.base.appzxhy.ui.guide2.Guide0Activity",
                true
            )
        }
    }

    override fun onResume() {
        startService(Intent(this, NotifyService::class.java))
        super.onResume()
    }

    override fun onDestroy() {
        Log.e("tttttttttttttttttt", "OverLayDestroy")
        super.onDestroy()
    }

}