Commit d1a46f59 by 霍志良

feat:bottomSheet改为bottomSheetDialogFragment

parent acdb275d
......@@ -23,9 +23,11 @@ class ConfideBottomSheetDialogFragment:BottomSheetDialogFragment() {
lateinit var text_title:View;
lateinit var line:View;
lateinit var rl_title:View;
lateinit var close_webview_Icon:View;
fun showBottomSheetDialog(activity: BaseActivity) {
lateinit var close_webview_Icon:View
lateinit var jumpUrl:String
fun showBottomSheetDialog(activity: BaseActivity,jumpUrl:String) {
this.activity=activity
this.jumpUrl=jumpUrl
show(activity.supportFragmentManager, "confide_bottom_showdialog")
}
......@@ -102,27 +104,27 @@ class ConfideBottomSheetDialogFragment:BottomSheetDialogFragment() {
dialog.setOnShowListener {
val bottomSheet = (it as BottomSheetDialog).findViewById<View>(com.google.android.material.R.id.design_bottom_sheet) as FrameLayout?
val behavior = BottomSheetBehavior.from(bottomSheet!!)
behavior.peekHeight=RxImageTool.dp2px(800f)
behavior.peekHeight=RxImageTool.dp2px(600f)
//true是跳过peekHeight,直接滑下去,false是可以滑动到顶部还可以保持peekHeight在滑下去
// behavior?.skipCollapsed=true
behavior.addBottomSheetCallback(object : BottomSheetBehavior.BottomSheetCallback() {
override fun onStateChanged(bottomSheet: View, newState: Int) {
when (newState) {
3 -> {
rl_title?.visibility=View.VISIBLE
close_webview_Icon?.visibility=View.VISIBLE
text_title?.visibility=View.VISIBLE
line?.visibility=View.GONE
rl_title.visibility=View.VISIBLE
close_webview_Icon.visibility=View.VISIBLE
text_title.visibility=View.VISIBLE
line.visibility=View.GONE
}
1 -> {
rl_title?.visibility=View.VISIBLE
close_webview_Icon?.visibility=View.GONE
text_title?.visibility=View.GONE
line?.visibility=View.VISIBLE
rl_title.visibility=View.VISIBLE
close_webview_Icon.visibility=View.GONE
text_title.visibility=View.GONE
line.visibility=View.VISIBLE
}
4 -> {
rl_title?.visibility=View.VISIBLE
line?.visibility=View.VISIBLE
rl_title.visibility=View.VISIBLE
line.visibility=View.VISIBLE
}
}
}
......@@ -171,7 +173,7 @@ class ConfideBottomSheetDialogFragment:BottomSheetDialogFragment() {
"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.loadUrl(jumpUrl)
wv_content.setOnTouchListener { p0, p1 -> //canScrollVertically(-1)的值表示是否能向下滚动,false表示已经滚动到顶部
if (!wv_content.canScrollVertically(-1)) {
wv_content.requestDisallowInterceptTouchEvent(false);
......
......@@ -146,7 +146,7 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
@SuppressLint("JavascriptInterface", "ClickableViewAccessibility")
override fun consultantClick(linkUrl: String?) {
ConfideBottomSheetDialogFragment()
.showBottomSheetDialog(mContext as BaseActivity)
.showBottomSheetDialog(mContext as BaseActivity,linkUrl!!)
// link(linkUrl)
}
......
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