Fix title in webview

This commit is contained in:
Jays2Kings 2023-02-12 15:43:31 -05:00
parent ff10d15f24
commit b70b76180a
2 changed files with 5 additions and 1 deletions

View file

@ -137,6 +137,11 @@ open class BaseWebViewActivity : BaseActivity<WebviewActivityBinding>() {
}
super.onProgressChanged(view, newProgress)
}
override fun onReceivedTitle(view: WebView?, title: String?) {
super.onReceivedTitle(view, title)
this@BaseWebViewActivity.title = title
}
}
val marginB = binding.webview.marginBottom
ViewCompat.setOnApplyWindowInsetsListener(binding.swipeRefresh) { v, insets ->

View file

@ -72,7 +72,6 @@ open class WebViewActivity : BaseWebViewActivity() {
override fun onPageFinished(view: WebView?, url: String?) {
super.onPageFinished(view, url)
invalidateOptionsMenu()
title = view?.title
binding.swipeRefresh.isEnabled = true
binding.swipeRefresh.isRefreshing = false
}