BottomSheets

To create a BottomSheet class, you should inherit it from BottomSheetDialogFragment from the bootstrap package.

class YesNoBottomSheetFragment: BottomSheetDialogFragment()
{
    // implementation
    // access data in arguments
}

Other logic stays the same.

ViewModel

If you are using a ViewModel, you should inherit YesNoDialogFragment from BottomSheetDialogFragmentViewModel and pass the ViewModel as a parameter.

class YesNoBottomSheetFragment: BottomSheetDialogFragmentViewModel<YesNoViewModel>()
{
    // implementation
    // access viewModel
}

Full example

Last updated