From e7c6d2dc3d974d05839f58c7e3edeeea861f2aac Mon Sep 17 00:00:00 2001 From: X1nto Date: Fri, 8 Oct 2021 19:10:24 +0400 Subject: [PATCH] updated bottom sheet fragments --- .../ui/base/BindingBottomSheetDialogFragment.kt | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/core-ui/src/main/java/com/vanced/manager/core/ui/base/BindingBottomSheetDialogFragment.kt b/core-ui/src/main/java/com/vanced/manager/core/ui/base/BindingBottomSheetDialogFragment.kt index b3ea8d51..6453a8cf 100644 --- a/core-ui/src/main/java/com/vanced/manager/core/ui/base/BindingBottomSheetDialogFragment.kt +++ b/core-ui/src/main/java/com/vanced/manager/core/ui/base/BindingBottomSheetDialogFragment.kt @@ -1,6 +1,6 @@ package com.vanced.manager.core.ui.base -import android.app.Dialog +import android.graphics.Rect import android.os.Bundle import android.view.LayoutInflater import android.view.View @@ -22,13 +22,7 @@ abstract class BindingBottomSheetDialogFragment : BottomSheetD savedInstanceState: Bundle? ): View { _binding = binding(inflater, container, savedInstanceState) - otherSetups() - return binding.root - } - - override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { - val dialog = super.onCreateDialog(savedInstanceState) - dialog.setOnShowListener { + dialog?.setOnShowListener { val bottomSheetDialogFragment = (it as BottomSheetDialog).findViewById(com.google.android.material.R.id.design_bottom_sheet) if (bottomSheetDialogFragment != null) { BottomSheetBehavior.from(bottomSheetDialogFragment).apply { @@ -36,7 +30,8 @@ abstract class BindingBottomSheetDialogFragment : BottomSheetD } } } - return dialog + otherSetups() + return binding.root } protected abstract fun binding(