BottomSheetDialoGfragment не позволяет взаимодействовать с задним экраномAndroid

Форум для тех, кто программирует под Android
Ответить
Anonymous
 BottomSheetDialoGfragment не позволяет взаимодействовать с задним экраном

Сообщение Anonymous »

Я создал генерического создателя листа Bootm. Нижний лист занимает менее половины экрана. Однако после открытия нижнего листа я не могу взаимодействовать с экраном за ним. Другая половина, где присутствует нижний лист, не позволяет мне настаивать на этой части экрана. < /P>
class GenericBottomSheet(private val bottomSheettheme : Int): BottomSheetDialogFragment() {
var customView: View? = null
lateinit var bottomSheet: View
lateinit var bottomSheetBehavior: BottomSheetBehavior

override fun getTheme(): Int = this.bottomSheettheme

override fun onCreateDialog(savedInstanceState: Bundle?): Dialog = BottomSheetDialog(requireContext(), theme)

override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_dynamic_bottom_sheet, container, false)
bottomSheet = view.findViewById(R.id.bottom_sheet)
bottomSheetBehavior = BottomSheetBehavior.from(bottomSheet)
bottomSheetBehavior.state = BottomSheetBehavior.STATE_EXPANDED
customView?.let {
val containerView = view.findViewById(R.id.dynamicContentContainer)
if (it.parent != null){
(it.parent as ViewGroup).removeView(it)
}
containerView.addView(it)
}
return view
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
}

companion object {
fun newInstance(customView: View,bottomSheettheme : Int = R.style.BottomSheetDialogTheme): GenericBottomSheet {
val fragment = GenericBottomSheet(bottomSheettheme)
fragment.customView = customView
return fragment
}
}
< /code>
} < /p>
fragment_dynamic_bottom_sheet.xml










Подробнее здесь: https://stackoverflow.com/questions/794 ... ack-screen
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Android»