hotwired / turbo-android

Android framework for making Turbo native apps
MIT License
407 stars 51 forks source link

Add Strada integration to WebBottomSheetFragment in demo #321

Closed donnfelker closed 3 months ago

donnfelker commented 3 months ago

This is being done for completeness' sake. I used the demo as a source of truth for my Strada integration, but I needed to add a button to the menu in a bottom sheet. This did not work and had me scratching my head, wondering why it was not working, yet Strada was wired up correctly. Then I realized that WebBottomSheetFragment did not extend WebFragment so all the BridgeDelegate stuff was not set up in the bottom sheet. This adds this setup to the WebBottomSheetFragment in the demo so that others do not run into this issue as I did.

Could we abstract this away so it's not duplicated? Yeah, but I'm calling YAGNI at this point as it's a demo.

jayohms commented 3 months ago

Thanks @donnfelker! This is a nice improvement for people that need this reference. Fyi, we have some work coming later this year that won't require this manual Strada setup... but until then, this is the way to do it.