package com.test.basd.supercleanermax.activity

import android.annotation.SuppressLint
import android.graphics.Color
import android.webkit.WebView
import android.webkit.WebViewClient
import androidx.core.view.updatePadding
import com.blankj.utilcode.util.BarUtils
import com.test.basd.supercleanermax.databinding.ActivityLayoutWebPrivacyBinding
import com.test.basd.supercleanermax.helps.BaseActivity

class PrivacyWebActivity : BaseActivity<ActivityLayoutWebPrivacyBinding>() {


    override val binding: ActivityLayoutWebPrivacyBinding by lazy {
        ActivityLayoutWebPrivacyBinding.inflate(layoutInflater)
    }

    @SuppressLint("SetJavaScriptEnabled")
    override fun initView() {
        BarUtils.setStatusBarLightMode(this, true)
        BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
        binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
        binding.idWeb.settings.setJavaScriptEnabled(true)

        binding.idWeb.webViewClient = object : WebViewClient() {
            override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
                view?.loadUrl(url!!)
                return true
            }
        }
        binding.idWeb.loadUrl("https://sites.google.com/view/cleanmastermax/home")
        binding.idBack.setOnClickListener {
            finishToMain()
        }
    }


}