August 2025
Intermediate to advanced
270 pages
6h 16m
English
Start by moving everything inside of onReceive(message: Message) to a new private function named addButton(message: Message).
| | // ... |
| | |
| | class ButtonComponent( |
| | name: String, |
| | private val bridgeDelegate: BridgeDelegate<HotwireDestination> |
| | ) : BridgeComponent<HotwireDestination>(name, bridgeDelegate) { |
| | private val fragment: HotwireFragment |
| | get() = bridgeDelegate.destination.fragment as HotwireFragment |
| | |
| | override fun onReceive(message: Message) { |
| » | addButton(message) |
| | } |
| | |
| » | private fun addButton(message: Message) { |
| | val composeView = ComposeView(fragment.requireContext()).apply { |
| | // ... |
Read now
Unlock full access