joomcode / BottomSheet

Bottom Sheet for iOS
https://medium.com/joomtech/bottom-sheet-shall-we-drop-the-formalities-400515255829
MIT License
309 stars 47 forks source link

Expand BottomSheet by pulling Pull Bar up #41

Open AboulEinein opened 1 month ago

AboulEinein commented 1 month ago

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

mikhailmaslo commented 1 month ago

Hi!

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

AboulEinein commented 1 month ago

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.

mikhailmaslo commented 1 month ago

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

AboulEinein commented 1 month ago

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