Commit a8a491eb authored by wanglei's avatar wanglei

...

parent 494d2053
......@@ -65,6 +65,7 @@ class WebViewFragment : BaseFragment<FragmentWebViewBinding>() {
override fun setView() {
initWebSettings()
bookmarkBean.url = url
loadWebView(url)
}
......@@ -162,7 +163,7 @@ class WebViewFragment : BaseFragment<FragmentWebViewBinding>() {
override fun onProgressChanged(view: WebView, newProgress: Int) {
LogEx.logDebug(TAG, "onProgressChanged newProgress=$newProgress")
binding.progressBar.progress = newProgress + 15
binding.progressBar.progress = newProgress
if (binding.progressBar.progress >= 100) {
binding.progressBar.visibility = View.GONE
}
......@@ -191,7 +192,7 @@ class WebViewFragment : BaseFragment<FragmentWebViewBinding>() {
): Boolean = true
}
binding.webView.webViewClient = object : WebViewClient() {
// override fun shouldOverrideUrlLoading(view: WebView?, request: WebResourceRequest?): Boolean {
// override fun shouldOverrideUrlLoading(view: WebView?, request: WebResourceRequest?): Boolean {
// LogEx.logDebug(TAG, "shouldOverrideUrlLoading")
// val url = request?.url.toString()
// binding.llError.visibility = View.GONE
......@@ -208,7 +209,7 @@ class WebViewFragment : BaseFragment<FragmentWebViewBinding>() {
super.onPageFinished(view, url)
val tittle = view?.title.toString()
bookmarkBean.name = tittle
bookmarkBean.url = url?:""
bookmarkBean.url = url ?: ""
onPageFinished?.invoke(url)
//添加历史记录
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment