0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2025-01-03 06:01:03 +00:00

updated bottom sheet fragments

This commit is contained in:
X1nto 2021-10-08 19:10:24 +04:00
parent bbe993edf7
commit e7c6d2dc3d

View file

@ -1,6 +1,6 @@
package com.vanced.manager.core.ui.base package com.vanced.manager.core.ui.base
import android.app.Dialog import android.graphics.Rect
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
@ -22,13 +22,7 @@ abstract class BindingBottomSheetDialogFragment<VB : ViewBinding> : BottomSheetD
savedInstanceState: Bundle? savedInstanceState: Bundle?
): View { ): View {
_binding = binding(inflater, container, savedInstanceState) _binding = binding(inflater, container, savedInstanceState)
otherSetups() dialog?.setOnShowListener {
return binding.root
}
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val dialog = super.onCreateDialog(savedInstanceState)
dialog.setOnShowListener {
val bottomSheetDialogFragment = (it as BottomSheetDialog).findViewById<FrameLayout>(com.google.android.material.R.id.design_bottom_sheet) val bottomSheetDialogFragment = (it as BottomSheetDialog).findViewById<FrameLayout>(com.google.android.material.R.id.design_bottom_sheet)
if (bottomSheetDialogFragment != null) { if (bottomSheetDialogFragment != null) {
BottomSheetBehavior.from(bottomSheetDialogFragment).apply { BottomSheetBehavior.from(bottomSheetDialogFragment).apply {
@ -36,7 +30,8 @@ abstract class BindingBottomSheetDialogFragment<VB : ViewBinding> : BottomSheetD
} }
} }
} }
return dialog otherSetups()
return binding.root
} }
protected abstract fun binding( protected abstract fun binding(