Commit e5280bf1 by 万齐军

增加js方法

parent af4c062a
......@@ -52,7 +52,7 @@ class JsMethod(private val webView: WebView?) {
Loading.close()
return true
}
"open_app_eval_list"->{
"open_app_eval_list" -> {
val url = param.getAsJsonPrimitive("url").asString
val topActivity = BaseActivityMgr.INST.getTopActivity()
NewH5Activity.start(topActivity, H5Params(url, ""))
......@@ -94,7 +94,7 @@ class JsMethod(private val webView: WebView?) {
//异常退出或者账号被顶掉,重新登录并拨打
YDLavManager.instances.login(UserHelper.getUserInfo()?.uid) { isSuccess: Boolean, _ ->
if (isSuccess) {
findRouteService(IConfideService::class.java).confideDial(id, data, topActivity)
findRouteService(IConfideService::class.java).confideDial(id, data, topActivity)
} else {
ToastUtil.toastShort("请重新拨打")
}
......@@ -104,11 +104,19 @@ class JsMethod(private val webView: WebView?) {
}
return true
}
"support_check_audio_permission" -> {
"check_app_support" -> {
val callback = param.getAsJsonPrimitive("callback").asString
val type = param.getAsJsonPrimitive("type").asInt
if (callback.isNullOrBlank()) return true
webView?.post {
webView.loadUrl("javascript:$callback(1)")
when (type) {
1 -> {//检查音频权限能力
webView.loadUrl("javascript:$callback(1)")
}
else -> {
webView.loadUrl("javascript:$callback(0)")
}
}
}
return true
}
......
......@@ -69,7 +69,7 @@ class ConfidePermissionDialog : DialogFragment() {
override fun onStart() {
super.onStart()
isCancelable = false
val width = (resources.displayMetrics.widthPixels * 0.8).toInt()
val width = (resources.displayMetrics.widthPixels * 0.85).toInt()
dialog?.window?.setLayout(width, ViewGroup.LayoutParams.WRAP_CONTENT)
dialog?.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
}
......
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