Commit 6e6fe841 by 霍志良

feat:bottomSheet改为bottomSheetDialogFragment

parent d1a46f59
......@@ -38,6 +38,10 @@ class ConfideBottomSheetDialogFragment:BottomSheetDialogFragment() {
}
override fun onStart() {
super.onStart()
}
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
......@@ -65,25 +69,9 @@ class ConfideBottomSheetDialogFragment:BottomSheetDialogFragment() {
dialog?.window?.decorView?.findViewById<View>(com.google.android.material.R.id.touch_outside)
val bottomSheetView =
dialog?.window?.decorView?.findViewById<View>(com.google.android.material.R.id.design_bottom_sheet)
val itemView = LayoutInflater.from(activity).inflate(R.layout.confide_bottom_two,null,false)
val layoutCall=itemView.findViewById<View>(R.id.layoutCall)
val layoutChange=itemView.findViewById<View>(R.id.layoutChange)
val layout_change_text=itemView.findViewById<View>(R.id.layout_change_text)
val confide_progress=itemView.findViewById<View>(R.id.confide_progress)
layoutCall.setOnClickListener {
callJsFun(wv_content,"layoutCall()")
}
layoutChange.setOnClickListener {
layout_change_text.visibility=View.GONE
confide_progress.visibility=View.VISIBLE
callJsFun(wv_content,"layoutCall()")
}
val layoutParams = FrameLayout.LayoutParams(
FrameLayout.LayoutParams.WRAP_CONTENT,
FrameLayout.LayoutParams.WRAP_CONTENT
).apply { gravity= Gravity.BOTTOM or Gravity.CENTER_HORIZONTAL }
dialog?.window?.addContentView(itemView,layoutParams)
if (cancelable) {
touchOutsideView?.setOnClickListener(View.OnClickListener {
if (dialog.isShowing) {
......@@ -100,8 +88,28 @@ class ConfideBottomSheetDialogFragment:BottomSheetDialogFragment() {
}
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val dialog = super.onCreateDialog(savedInstanceState) as BottomSheetDialog
dialog.setOnShowListener {
val itemView = LayoutInflater.from(activity).inflate(R.layout.confide_bottom_two,null,false)
val layoutCall=itemView.findViewById<View>(R.id.layoutCall)
val layoutChange=itemView.findViewById<View>(R.id.layoutChange)
val layout_change_text=itemView.findViewById<View>(R.id.layout_change_text)
val confide_progress=itemView.findViewById<View>(R.id.confide_progress)
layoutCall.setOnClickListener {
callJsFun(wv_content,"layoutCall()")
}
layoutChange.setOnClickListener {
layout_change_text.visibility=View.GONE
confide_progress.visibility=View.VISIBLE
callJsFun(wv_content,"layoutCall()")
}
val layoutParams = FrameLayout.LayoutParams(
FrameLayout.LayoutParams.WRAP_CONTENT,
FrameLayout.LayoutParams.WRAP_CONTENT
).apply { gravity= Gravity.BOTTOM or Gravity.CENTER_HORIZONTAL }
dialog?.window?.addContentView(itemView,layoutParams)
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(600f)
......
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