Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
84364bb0
Commit
84364bb0
authored
May 28, 2022
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:底部webview
parent
3c9e7f44
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
139 additions
and
1 deletions
+139
-1
build.gradle
m-im/build.gradle
+1
-0
ExpertConsultServiceListDialog.kt
m-im/src/main/java/com/yidianling/uikit/custom/widget/expertConsultService/view/ExpertConsultServiceListDialog.kt
+1
-1
ExpertConsultWebview.kt
m-im/src/main/java/com/yidianling/uikit/custom/widget/expertConsultService/view/ExpertConsultWebview.kt
+123
-0
im_expert_consult_webview_view.xml
m-im/src/main/res/layout/im_expert_consult_webview_view.xml
+14
-0
No files found.
m-im/build.gradle
View file @
84364bb0
...
@@ -90,6 +90,7 @@ dependencies {
...
@@ -90,6 +90,7 @@ dependencies {
implementation
'com.netease.nimlib:nrtc:9.1.1'
implementation
'com.netease.nimlib:nrtc:9.1.1'
api
rootProject
.
ext
.
dependencies
[
"ydl-user-router"
]
api
rootProject
.
ext
.
dependencies
[
"ydl-user-router"
]
implementation
rootProject
.
ext
.
dependencies
[
"BaseRecyclerViewAdapterHelper"
]
implementation
rootProject
.
ext
.
dependencies
[
"BaseRecyclerViewAdapterHelper"
]
api
'com.tencent.tbs.tbssdk:sdk:43903'
if
(
rootProject
.
ext
.
dev_mode
){
if
(
rootProject
.
ext
.
dev_mode
){
//开发时使用
//开发时使用
...
...
m-im/src/main/java/com/yidianling/uikit/custom/widget/expertConsultService/view/ExpertConsultServiceListDialog.kt
View file @
84364bb0
...
@@ -36,7 +36,7 @@ class ExpertConsultServiceListDialog(val mContext: Context, val mList: List<Serv
...
@@ -36,7 +36,7 @@ class ExpertConsultServiceListDialog(val mContext: Context, val mList: List<Serv
private
var
mConsultServiceListView
:
ExpertConsultServiceView
?
=
null
private
var
mConsultServiceListView
:
ExpertConsultServiceView
?
=
null
private
var
mConsultServiceDetailView
:
ExpertConsultServiceDetailView
?
=
null
private
var
mConsultServiceDetailView
:
ExpertConsultServiceDetailView
?
=
null
private
var
mWebviewView
:
?
=
null
private
var
mWebviewView
:
ExpertConsultWebview
?
=
null
private
var
mViewList
:
ArrayList
<
View
>
=
ArrayList
()
private
var
mViewList
:
ArrayList
<
View
>
=
ArrayList
()
private
var
mSelectType
:
String
=
"全部"
private
var
mSelectType
:
String
=
"全部"
...
...
m-im/src/main/java/com/yidianling/uikit/custom/widget/expertConsultService/view/ExpertConsultWebview.kt
0 → 100644
View file @
84364bb0
package
com.yidianling.uikit.custom.widget.expertConsultService.view
import
android.app.Activity
import
android.content.Context
import
android.net.Uri
import
android.view.View
import
android.widget.RelativeLayout
import
com.tencent.smtt.export.external.interfaces.JsResult
import
com.tencent.smtt.sdk.*
import
com.ydl.utils.WebUrlParamsUtils
import
com.ydl.webview.ProgressWebView
import
com.ydl.webview.TellData
import
com.ydl.webview.WebModularServiceUtils
import
com.yidianling.common.tools.RxDeviceTool
import
com.yidianling.im.R
import
com.yidianling.uikit.custom.widget.expertConsultService.callback.ConsultServiceViewCallback
class
ExpertConsultWebview
:
RelativeLayout
{
constructor
(
context
:
Context
)
:
super
(
context
)
{
mContext
=
context
initView
()
}
private
var
mListener
:
ConsultServiceViewCallback
?
=
null
private
var
mContext
:
Context
?
=
null
private
fun
initView
()
{
val
mWidth
:
Int
=
RxDeviceTool
.
getScreenWidth
(
mContext
)
val
mHeight
:
Int
=
LayoutParams
.
MATCH_PARENT
val
params
=
LayoutParams
(
mWidth
,
mHeight
)
params
.
height
=
mHeight
layoutParams
=
params
View
.
inflate
(
mContext
,
R
.
layout
.
im_expert_consult_webview_view
,
this
)
}
fun
webViewInit
(
wv_content
:
ProgressWebView
)
{
val
setting
:
WebSettings
=
wv_content
?.
settings
!!
//支持js
//支持js
setting
.
setJavaScriptEnabled
(
true
)
//设置字符编码
//设置字符编码
setting
.
setDefaultTextEncodingName
(
"GBK"
)
setting
.
setDomStorageEnabled
(
true
)
val
appCachePath
:
String
=
mContext
?.
getCacheDir
()
?.
getAbsolutePath
().
toString
()
setting
.
setAppCachePath
(
appCachePath
)
setting
.
setAllowFileAccessFromFileURLs
(
true
)
setting
.
setAppCacheEnabled
(
true
)
setting
.
setAllowFileAccess
(
true
)
setting
.
setBlockNetworkImage
(
false
)
wv_content
!!
.
scrollBarStyle
=
View
.
SCROLLBARS_INSIDE_OVERLAY
//滚动条风格,为0指滚动条不占用空间,直接覆盖在网页上
val
jtoJHandle
=
WebModularServiceUtils
.
getWebService
()
.
getJavascripHandler
(
mContext
as
Activity
,
tellData
=
TellData
())
wv_content
!!
.
addJavascriptInterface
(
jtoJHandle
,
"javascriptHandler"
)
var
jumpurl
=
"http://192.168.210.152/jy/listenMask?listenerId=257&isFromApp=1"
val
url
=
WebUrlParamsUtils
.
getSuffix
(
jumpurl
,
jtoJHandle
.
getUriAppendSuffix
())
wv_content
.
loadUrl
(
url
)
// wv_content.loadUrl(jumpUrl)
wv_content
.
webViewClient
=
object
:
WebViewClient
()
{
override
fun
shouldOverrideUrlLoading
(
webview
:
WebView
,
url
:
String
?):
Boolean
{
if
(
url
.
isNullOrBlank
())
return
false
return
shouldOverridePayUrl
(
webview
,
url
)
}
}
wv_content
.
webChromeClient
=
object
:
WebChromeClient
()
{
override
fun
onJsAlert
(
webView
:
WebView
,
s
:
String
,
s1
:
String
,
jsResult
:
JsResult
):
Boolean
{
return
super
.
onJsAlert
(
webView
,
s
,
s1
,
jsResult
)
}
override
fun
onProgressChanged
(
view
:
WebView
,
newProgress
:
Int
)
{
super
.
onProgressChanged
(
view
,
newProgress
)
}
override
fun
onReceivedTitle
(
view
:
WebView
,
title
:
String
)
{
super
.
onReceivedTitle
(
view
,
title
)
}
// For Android < 3.0
fun
openFileChooser
(
valueCallback
:
ValueCallback
<
Uri
?>)
{
}
// For Android >= 3.0
fun
openFileChooser
(
valueCallback
:
ValueCallback
<*>,
acceptType
:
String
?)
{
}
//For Android >= 4.1
override
fun
openFileChooser
(
valueCallback
:
ValueCallback
<
Uri
>,
acceptType
:
String
,
capture
:
String
)
{
}
// For Android >= 5.0
override
fun
onShowFileChooser
(
webView
:
WebView
,
filePathCallback
:
ValueCallback
<
Array
<
Uri
>>,
fileChooserParams
:
FileChooserParams
):
Boolean
{
return
true
}
}
}
}
\ No newline at end of file
m-im/src/main/res/layout/im_expert_consult_webview_view.xml
0 → 100644
View file @
84364bb0
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:ignore=
"MissingDefaultResource"
>
<com.ydl.webview.ProgressWebView
android:id=
"@+id/wv_content"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
</RelativeLayout>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment