package com.zxhyis.toolss.ui.page.webview
import android.graphics.Color
import android.text.SpannableString
import android.text.Spanned
import android.text.style.UnderlineSpan
import android.webkit.WebView
import android.webkit.WebViewClient
import androidx.core.view.updatePadding
import com.blankj.utilcode.util.BarUtils
import com.zxhyis.toolss.base.TopActivity
import com.zxhyis.toolss.databinding.ActivityLayoutWebPrivacyBinding
import com.zxhyis.toolss.logic.setOnClick

class PrivacyWebActivity : TopActivity<ActivityLayoutWebPrivacyBinding>() {
    override fun getViewBinding1(): ActivityLayoutWebPrivacyBinding {
        return ActivityLayoutWebPrivacyBinding.inflate(layoutInflater)
    }

    override fun init() {
        BarUtils.setStatusBarLightMode(this, true)
        BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
        vb.root.updatePadding(top = BarUtils.getStatusBarHeight())
        vb.idWeb.settings.setJavaScriptEnabled(true)

        vb.idWeb.webViewClient = object : WebViewClient() {
            override fun shouldOverrideUrlLoading(view: WebView?, url: String?): Boolean {
                view?.loadUrl(url!!)
                return true
            }
        }
        vb.idWeb.loadUrl("https://sites.google.com/view/clean-mas/home")
        vb.idBack.setOnClick(javaClass.simpleName) {
            finish()
        }
    }
}