package com.test.basd.smartjunkcleaner.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.smartjunkcleaner.databinding.ActivityLayoutWebPrivacyBinding
import com.test.basd.smartjunkcleaner.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/smartcleanerjunkcleaner/smart-cleaner-junk-cleaner")
        binding.idBack.setOnClickListener {
            finishToMain()
        }
    }


}