Is it possible to pass custom arguments to onClick method using the Data Binding Library? I have my layout xml file where I need to use the onClickListener:
onClick
You can use a lambda expressions and pass the view in as a parameter.
android:onClick="@{() -> callback.onCategoryClick(viewModel)}"
If you need the view, you can pass that as well with:
android:onClick="@{(view) -> callback.onCategoryClick(view, viewModel)}"