|
@@ -12,9 +12,9 @@ import android.webkit.WebViewClient
|
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
|
import androidx.databinding.DataBindingUtil
|
|
|
import com.alibaba.android.arouter.facade.annotation.Route
|
|
|
-import com.github.lzyzsd.jsbridge.BridgeHandler
|
|
|
-import com.github.lzyzsd.jsbridge.CallBackFunction
|
|
|
import com.yingyangfly.baselib.router.RouterUrlCommon
|
|
|
+import com.yingyangfly.baselib.utils.LiveEventBusUtil
|
|
|
+import com.yingyangfly.baselib.utils.RxBusCodes
|
|
|
import com.yingyangfly.baselib.utils.ViewTool
|
|
|
import com.yingyangfly.webview.databinding.ActivityBridgeWebBinding
|
|
|
|
|
@@ -34,6 +34,7 @@ class BridgeWebActivity : AppCompatActivity() {
|
|
|
binding = DataBindingUtil.setContentView(this, R.layout.activity_bridge_web)
|
|
|
ViewTool.inflateLayoutPixels(this, binding.root, 1194, 834)
|
|
|
initWebView()
|
|
|
+ initView()
|
|
|
}
|
|
|
|
|
|
@SuppressLint("JavascriptInterface", "SetJavaScriptEnabled")
|
|
@@ -80,6 +81,12 @@ class BridgeWebActivity : AppCompatActivity() {
|
|
|
binding.webView.loadUrl(url)
|
|
|
}
|
|
|
|
|
|
+ private fun initView() {
|
|
|
+ LiveEventBusUtil.observer<String>(this, RxBusCodes.FINISHWEBVIEW) {
|
|
|
+ finish()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
override fun onDestroy() {
|
|
|
destoryWebView()
|
|
|
super.onDestroy()
|