This bottom sheet is normal as others but it has the button at the very bottom which does not move on swiping down until the top content disappearing.
I have created a custom progress bar and I have added it to the window decorview's root view. However, when a bottom sheet is visible, this progress bar is drawn behind the bottom sheet rather than drawing on top of it. Shouldn't it be drawn on top of the bottom sheet?
val loader = FullScreenLoader(
requireContext(),
containerView = requireActivity().window.decorView.rootView as ViewGroup
)
loader.show()
Shouldn't it be drawn on top of the bottom sheet?
It behaves as expected as the progress bar is attached to the activity's window, not to the bottom sheet window.
Bottom sheets behave like dialogs (actually there are versions of them that extend Dialogs like BottomSheetDialog & BottomSheetDialogFragment. Like dialogs, if we tap outside the Bottom Sheet, it is dismissed just. there are also slide up and slide down to activate and deactivate the Bottom Sheet respectively.
If you want that progress bar overlay on top of the BottomSheet, you need to attach it to the BottomSheet dialog window instead of the activity's window.
I have a fragment, within that fragment I want to display a standard bottom sheet. When the sheet is expanded Id like to display a toolbar at the top of the sheet, with close/collapse button, something like presented on https://material.io/components/sheets-bottom#behavior under Behaviour -> Visibility -> FullScreen
To my surprise Im struggling to achieve similar effect - tried applying different scroll flags (app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed") however Im getting opposite results - toolbar is visible when sheet is half extended and disappars when I scroll the sheet to the top.
I would like to achieve Bottom Sheet dialog behavior like in Google Maps transport route itinerary: if you click on expandable item the top of the sheet is not moving but the sheet grows below the screen bottom bounds. The text on top of the sheet is fixed but the dialog itself increases in height.
How to achieve this behavior with BottomSheetDialogFragment?
I need to implement this UI.
This is layout with a closed Bottom Sheet.
This is layout with an open Bottom Sheet.
I implemented Bottom Sheet as in the design, but my problem is that the Bottom Sheet climbs over the Recycler View. I want to implement this like in design - when I open the Bottom Sheet, my Recycler View will decreased dynamically in size. Please tell me how to set this behavior for Bottom Sheet. How can I get distance between Toolbar and top part of Bottom Sheet and how I can reduce Recycler View size with animation when Bottom Sheet was opened?