I need one separate boolean variable within my item layout, which is intended to use as a row of recyclerView
, to toggle the state of some views inside it.
I know, I have got an option to include that boolean into my model class and use that. I am just curious whether it is possible to use primitive types inside layout with the help of data binding library.
Apparently, it's possible and easy.
<data>
<variable
name="someBoolean"
type="boolean" />
<variable
name="someInt"
type="int" />
<variable
name="someWrapperBoolean"
type="java.lang.Boolean" />
<variable
name="someWrapperInt"
type="java.lang.Integer" />
</data>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With