package com.ritoq.quickphone.business.pangle

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.ritoq.quickphone.R
import com.ritoq.quickphone.business.ads.AdsMgr
import com.ritoq.quickphone.business.ads.AdsShowCallBack
import com.ritoq.quickphone.databinding.ActivityPangleBinding
import com.ritoq.quickphone.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)
        }
    }


}