BottomSheet icon indicating copy to clipboard operation
BottomSheet copied to clipboard

Expand BottomSheet by pulling Pull Bar up

Open AboulEinein opened this issue 1 year ago • 4 comments

How can expand the ButtomSheet by pulling the Pull Bar up?

AboulEinein avatar Sep 11 '24 14:09 AboulEinein

Hi!

Unfortunately, there is only two states: opened and completely closed

mikhailmaslo avatar Sep 11 '24 15:09 mikhailmaslo

I would like to have another state fullscreen, that would be activated when the user pulls the view up, similar to when the user pulls the view down to close it.

How hard is it to add this functionality? I presume this would need to be handled in BottomSheetPresentationController, if you could point me to the place where it needs to be handled and any consideration I need to account for and I can try to open a PR with the change.

AboulEinein avatar Sep 11 '24 15:09 AboulEinein

I presume it should be indeed handled inside BottomSheetPresentationController

But I wouldn't say it's an easy task. At least when I have thought of how it might be implemented, I couldn't find a good answer

I suppose you want something similar to what AppleMaps has Screenshot 2024-09-11 at 17 39 45

Probably you need to support "partially opened" state Then, when user tries to scroll up, you need to transition to "fully opened" state

You can rule the size by this property https://github.com/joomcode/BottomSheet/blob/15ab2cf96b757b72b09a6515f667685ff55924e1/Sources/BottomSheet/Core/Presentation/BottomSheetPresentationController.swift#L161 But I don't know on the spot, how to make transitions between "partially opened" to "fully opened". Especially if you want interactiveness

mikhailmaslo avatar Sep 11 '24 15:09 mikhailmaslo

The only difference between what AppleMaps and what I want to achieve is that I don't want to expand the BottomSheet when user scrolls inside it, it would fully open when you hold the pull bar and swipe up. Similar to the behavior in YouTube Chat drawer has

AboulEinein avatar Sep 11 '24 16:09 AboulEinein