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
bd9a79ff
Commit
bd9a79ff
authored
May 17, 2022
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:底部弹窗修改
parent
5c3f35b7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
2 deletions
+74
-2
build.gradle
m-confide/build.gradle
+1
-0
ConfideHomeEventImpl.kt
m-confide/src/main/java/com/ydl/confide/home/event/ConfideHomeEventImpl.kt
+58
-2
confide_webview.xml
m-confide/src/main/res/layout/confide_webview.xml
+15
-0
No files found.
m-confide/build.gradle
View file @
bd9a79ff
...
...
@@ -75,6 +75,7 @@ dependencies {
implementation
'com.daimajia.androidanimations:library:2.3@aar'
api
'fr.tvbarthel.blurdialogfragment:lib:2.1.5'
api
"com.alibaba:arouter-api:$arouter_api"
api
'com.tencent.tbs.tbssdk:sdk:43903'
// 注意此处的依赖方式:kotlin中使用和java中使用方式有不同
kapt
"com.alibaba:arouter-compiler:$arouter_compiler"
implementation
'com.alibaba:fastjson:1.2.38'
...
...
m-confide/src/main/java/com/ydl/confide/home/event/ConfideHomeEventImpl.kt
View file @
bd9a79ff
package
com.ydl.confide.home.event
import
android.annotation.SuppressLint
import
android.app.Activity
import
android.content.Context
import
android.content.Intent
import
android.net.Uri
import
android
x.appcompat.app.AppCompatActivity
import
android
.os.Build
import
android.text.TextUtils
import
android.view.MotionEvent
import
android.view.View
import
androidx.appcompat.app.AppCompatActivity
import
com.google.android.material.bottomsheet.BottomSheetBehavior
import
com.google.android.material.bottomsheet.BottomSheetDialog
import
com.tencent.smtt.sdk.WebSettings
import
com.ydl.confide.R
import
com.ydl.confide.home.ConfideHomeActivity
import
com.ydl.confide.home.adapter.ConfideHomeAdapter
import
com.ydl.confide.home.bean.ConfideHomeAllFiltersBean
...
...
@@ -24,11 +31,15 @@ import com.ydl.media.audio.AudioPlayer
import
com.ydl.media.audio.model.Music
import
com.ydl.media.view.PlayerFloatHelper
import
com.ydl.media.view.PlayerFloatView
import
com.ydl.webview.ProgressWebView
import
com.ydl.webview.TellData
import
com.ydl.webview.WebModularServiceUtils.Companion.getWebService
import
com.ydl.ydl_router.manager.YDLRouterManager
import
com.ydl.ydl_router.manager.YDLRouterParams
import
com.ydl.ydlcommon.base.BaseActivity
import
com.ydl.ydlcommon.router.IYDLRouterConstant
import
com.ydl.ydlcommon.utils.remind.ToastHelper
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.im.api.bean.IMRequestCallback
...
...
@@ -125,8 +136,53 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
* 最佳倾诉榜单--点我倾诉
* @param linkUrl 跳转地址
*/
@SuppressLint
(
"JavascriptInterface"
,
"ClickableViewAccessibility"
)
override
fun
consultantClick
(
linkUrl
:
String
?)
{
link
(
linkUrl
)
val
bottomSheetDialog
=
mContext
?.
let
{
BottomSheetDialog
(
it
)
}
bottomSheetDialog
?.
setContentView
(
R
.
layout
.
confide_webview
)
bottomSheetDialog
?.
show
()
var
wv_content
=
bottomSheetDialog
?.
findViewById
<
ProgressWebView
>(
com
.
ydl
.
webview
.
R
.
id
.
wv_content
)
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指滚动条不占用空间,直接覆盖在网页上
var
jtoJHandle
=
getWebService
().
getJavascripHandler
(
mContext
as
Activity
,
tellData
=
TellData
())
wv_content
!!
.
addJavascriptInterface
(
jtoJHandle
,
"javascriptHandler"
)
bottomSheetDialog
?.
behavior
?.
peekHeight
=
1500
//true是跳过peekHeight,直接滑下去,false是可以滑动到顶部还可以保持peekHeight在滑下去
// bottomSheetDialog?.behavior?.skipCollapsed=true
wv_content
.
loadUrl
(
"https://m.ydl.com/jy/experts/23035?v=4.0.99&uid=9404770&ts=1652787528&toConfide=1&"
+
"platform_main_theme_light=00D4DF&platform_main_theme_bright=EAFAFC&platform_main_theme=00C9E2&isFromApp=1&"
+
"id=1927&ffrom=android_zhuzhan&barHeight=81&accessToken=87cba5b57f9bb196856ade3522805c11MjIwMw&sign="
+
"6ce496690d7d5a184935f986c3631cc2"
)
wv_content
.
setOnTouchListener
(
object
:
View
.
OnTouchListener
{
override
fun
onTouch
(
p0
:
View
?,
p1
:
MotionEvent
?):
Boolean
{
//canScrollVertically(-1)的值表示是否能向下滚动,false表示已经滚动到顶部
if
(!
wv_content
.
canScrollVertically
(-
1
))
{
wv_content
.
requestDisallowInterceptTouchEvent
(
false
);
}
else
{
wv_content
.
requestDisallowInterceptTouchEvent
(
true
);
}
return
false
;
}
})
// link(linkUrl)
}
/**
...
...
m-confide/src/main/res/layout/confide_webview.xml
0 → 100644
View file @
bd9a79ff
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<com.ydl.webview.ProgressWebView
android:id=
"@+id/wv_content"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/platform_transparent"
/>
</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