Hi,
I saw this post and this was almost the thing I was looking for. I'm trying to reuse existing layout XML files and want to add On... handlers by using the an EventTweaks.
Is is possible to inflate an XML, add it to the view and then retrieve a widget from this view and apply tweaks to it?
I'm trying to inject the XML and write the On.click {} inline; it compiles, but doesn't work (the otherField is a existing "slot" by-the-way):
val view = l[LinearLayout](
Ui(inflater.inflate(R.layout.test_layout, null))
) <~ vertical
val button = view.find[Button](R.id.button)
button <~ On.click {
otherField <~ text("button clicked")
}
Is it possible to do something like this or is Macroid not available when you added an inflated view?
Thanks in advance!
Gr. Wouter