I'm trying to add a fixed button at the bottom of compose bottomsheet. The button should be visible at all times in collapsed state and should stay static at the bottom as the user slides up through the sheet.
Sample behavior: https://medium.com/#KaneCheshire/sticky-ui-in-android-bottom-sheet-3d65ea1d20dc
I have tried using a subcompose layout and placed the button by subtracting button height from visible sheet height like so;
constraints.maxHeight - sheetState.offset.value - ctaPlaceable.height
but with this I cant achieve the desired transition when the sheet is sliding down from collapsed to dismissed as the button remain fixed at their position. I want the buttons to slide down when the sheet is being dismissed and remain fixed in their position when the sheet is sliding up.
Can anyone help?
Related
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 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?
My class extends from BottomSheetDialogFragment and is working fine by now. But I dont get it how to set the collapsed height (setPeekHeight on BottomSheet Behavior).
Another thing I want to know is: How to set the margin left and right only when the BottomSheet is collapsed? Like this screenshots below.
collapsed:
expanded:
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?