package com.base.appzxhy.business.pangle

import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.base.appzxhy.GlobalConfig
import com.base.appzxhy.R
import com.base.appzxhy.business.ads.AdsMgr
import com.base.appzxhy.business.ads.AdsShowCallBack
import com.base.appzxhy.databinding.ActivityPangleBinding
import com.base.appzxhy.ui.main.MainActivity


class PangleActivity : AppCompatActivity() {
    private lateinit var binding: ActivityPangleBinding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        binding = ActivityPangleBinding.inflate(layoutInflater)
        setContentView(binding.root)
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
            val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
            insets
        }

        binding.initSdk.setOnClickListener {
            AdsMgr.initPangle(this)
        }

        binding.showOpen.setOnClickListener {
            AdsMgr.showOpen(this, showCallBack = object : AdsShowCallBack() {
                override fun next() {
                    this@PangleActivity.startActivity(Intent(this@PangleActivity, MainActivity::class.java))
                }

            })
        }

        binding.showInter.setOnClickListener {
            AdsMgr.showInsert(this, showCallBack = object : AdsShowCallBack() {
                override fun next() {

                }

            })
        }
        binding.showReward.setOnClickListener {
            AdsMgr.showReward(this, showCallBack = object : AdsShowCallBack() {
                override fun next() {

                }

            })
        }

        binding.showBanner.setOnClickListener {
            AdsMgr.showBanner(binding.flBanner)
        }
    }


}