Can you use a BindingAdapter on a ViewStub?
问题 I want to create an "inflateWhen" BindingAdapter and attach it to a viewstub to have it inflate when a boolean value is true. However, the BindingAdapter keeps trying to operate on the root view of the viewstub, causing it to fail to compile. Is there any way to do this as a bindingadapter rather than having to do it programmatically in the activity? Here's what I have so far: @BindingAdapter("inflateWhen") fun inflateWhen(viewstub: ViewStub, inflate: Boolean) { if (inflate) { viewstub