Hello, trying to use Accompanist Horizontal Pager ...
# compose
n
Hello, trying to use Accompanist Horizontal Pager with Bottom Sheet but the tab part of the screen is not dimming as I use bottom sheet inside pages. I don’t want to use the BottomSheet in holder Compose view because it’d be too much hassle for handling click events, passing correct list of items etc. How do I dim the rest of the screen properly or what would be the more efficient way to integrate BottomSheet while using Pager if each tab required bottom sheet?
f
You'd add a scrim yourself that you add a z index of 2 and make sure your bottom sheet has a z index of 3 that'll be bigger than the scrim, when/if user taps the scrim then you dismiss the bottom sheet Or even better, if you're using navigation component just make that bottom sheet a destination, it'll handle everything for you
n
Unfortunately, we are not using navigation yet. Could you be so kind if you give me a code example of what you are trying to say bc I couldn’t image. Thank you 🙂
o
We had a similar issue with a BottomBar, so we have implemented it by adding the bottom sheet to the separate window, such as
Popup
is doing under the hood. You may want to check this lib: https://github.com/oleksandrbalan/modalsheet It is not fully complete, but you can take an idea as an inspiration 😉
n
Awesome, thanks you Oleksandr! This should definitely help me I hope 😊