How is it possible to create a modal BottomSheetDialog(Fragment)
which switches to fullscreen with a ToolBar as shown in the Material Design Spec?
I could add a ToolBar manually by adding a BottomSheetBehavior.BottomSheetCallback
and setting the alpha of the ToolBar depending on the slideOffset. This is a bit hacky but seems to work when moving the Bottom Sheet. However, this doesn't work when my Bottom Sheet contains an EditText
and the Keyboard is shown. I tried both Versions: BottomSheetDialogFragment
and manually adding the Behavior to a new Fragment.
- Is there an easier way to achieve this?
- Can I trigger the ToolBar when the Keyboard is shown and the Bottom Sheet uses up the whole space?
BottomSheet
foucsable. In such a way, yourEditText
won't gain focus initially ! – DurwareBottomSheetBehavior
. I hope this works together. – Teryn