cesardeazevedo / react-native-bottom-sheet-behavior

react-native wrapper for android BottomSheetBehavior
MIT License
1.16k stars 114 forks source link

Bottom container height without anchor point #52

Open samiede opened 5 years ago

samiede commented 5 years ago

Hey! First of all, awesome library!

I'm trying to set the hight of the expanded bottom sheet without using an anchor point but I can't seem to find any option to do that. Is it possible to get a prop that sets that?

Best wishes!

cesardeazevedo commented 5 years ago

Hi, thanks for reaching out,

You can set the height of the bottom sheet by manually setting the hight of the inner <View />, like on the SimpleView.js example https://github.com/cesardeazevedo/react-native-bottom-sheet-behavior/blob/master/example/views/SimpleView.js#L105

Let me know if you got it.

samiede commented 5 years ago

Thanks for the answer! Yes, that works! I'm aware this might be suitable for another issue, but what I'm essentially trying to do is recreating the maps example but with the BottomContentHeader when I'm in the expanded view because I need to have another navigation once I'm in expanded view to control the ScrollView inside the container. Since using ScrollView only works when either not using the anchor point or when using the MergedAppBar (at least from what I understood of the library so far), I need to implement a custom design for the MergedAppBar, which is not possible. My idea now would be to set the height of the Content to the screen height once the User scrolls higher than the expanded position. Maybe you know another way of achieving this?

Thank you very much!

cesardeazevedo commented 5 years ago

I think i am really confused now 😅, do you have a visual example on what you are trying to do?

samiede commented 5 years ago

Yes sure!

I built a navigation that controls the content of a scrollview and of the content container behind the BottomSheetBehaviour. Collapsed it looks like this: 1 I don't need scrolling behaviour when in anchor state, so at the anchor, it should look like this: 2 But in expanded state, I need the navigation, that I put in the Header to be sticking to the top of the screen with a scrollable list below: 3 I know that it is possible to achieve scrolling when using the MergedAppBarLayout, but that merges the top bar and it is not possible to customize the header the way I need it. I tried putting an absolute view on top of the scroll view, but it wouldn't display correctly within the CoordinatorLayout. Thanks for your help! :)

cesardeazevedo commented 5 years ago

I have a better understanding now, thanks for clarify, The MergedAppBarLayout is indeed very hard to customized, i think i did something similar on the past, so let me play around and i will back to you.

cesardeazevedo commented 5 years ago

Is something like this you're trying to achieve?

test

samiede commented 5 years ago

Yes, something like that, but with the user being to also scroll down in the expanded state! :) Basically, the view has a map in the content area, so the original statusbar with the "Google Maps" text in the example is not needed. The BottomSheetHeader basically serves as navigation to control what is displayed in the content of the BottomSheet behaviour, which is supposed to be accessible once the user reaches expanded state.

cesardeazevedo commented 5 years ago

Yeah indeed, i think it's a bug on the NestedScrollView that i need to investigate further, if you want to play around, i have this gist so far. https://gist.github.com/cesardeazevedo/e29b3ef261ba5053b614e52dea40f83b

samiede commented 5 years ago

I will check it out and let you know if I find something! Thanks for your help though! :)

Am 18.04.2019 um 10:04 schrieb César Augusto notifications@github.com:

Yeah indeed, i think it's a bug on the NestedScrollView that i need to investigate further, if you want to play around, i have this gist so far. https://gist.github.com/cesardeazevedo/e29b3ef261ba5053b614e52dea40f83b https://gist.github.com/cesardeazevedo/e29b3ef261ba5053b614e52dea40f83b — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cesardeazevedo/react-native-bottom-sheet-behavior/issues/52#issuecomment-484398364, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOFHOTWF3D4UPP5XT54VZTPRATRHANCNFSM4HGTLWMA.