Commit d62c6b3e authored by wanglei's avatar wanglei

...

parent 39a030db
...@@ -38,9 +38,20 @@ class WebViewFragment(val url: String) : BaseFragment<FragmentWebViewBinding>() ...@@ -38,9 +38,20 @@ class WebViewFragment(val url: String) : BaseFragment<FragmentWebViewBinding>()
override fun setListener() { override fun setListener() {
super.setListener() super.setListener()
binding.tvReload.setOnClickListener {
reloadWebView()
}
} }
fun loadWebView(loadUrl: String) { private fun reloadWebView() {
binding.llError.visibility = View.GONE
binding.webView.visibility = View.VISIBLE
binding.progressBar.visibility = View.VISIBLE
binding.progressBar.progress = 0
binding.webView.reload()
}
fun loadWebView(loadUrl: String) {
binding.webView.visibility = View.VISIBLE binding.webView.visibility = View.VISIBLE
binding.webView.loadUrl(loadUrl) binding.webView.loadUrl(loadUrl)
} }
...@@ -178,7 +189,6 @@ class WebViewFragment(val url: String) : BaseFragment<FragmentWebViewBinding>() ...@@ -178,7 +189,6 @@ class WebViewFragment(val url: String) : BaseFragment<FragmentWebViewBinding>()
} }
private fun getSslErrorString(error: Int): String { private fun getSslErrorString(error: Int): String {
return when (error) { return when (error) {
SslError.SSL_DATE_INVALID -> "Date Invalid: The certificate's date is incorrect or the certificate has expired." SslError.SSL_DATE_INVALID -> "Date Invalid: The certificate's date is incorrect or the certificate has expired."
......
...@@ -62,7 +62,21 @@ ...@@ -62,7 +62,21 @@
android:textSize="16sp" android:textSize="16sp"
tools:text="net::ERR CONNECTION TIMED OUT" /> tools:text="net::ERR CONNECTION TIMED OUT" />
<TextView
android:id="@+id/tv_reload"
android:layout_width="259dp"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="45dp"
android:background="@drawable/bg_0571ed_25"
android:gravity="center"
android:text="Reload"
android:textColor="@color/white"
android:textSize="18sp"
tools:ignore="HardcodedText" />
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
......
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