We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is possible to I access my layout to change the text color like
if(item.price > 100) { // change my TextViewColor }
instead of use LayoutHandler with 2 differents layout:
LastAdapter(items, BR.something) .layout { item, position -> if (items[position].price > 100) { R.layout.item_red } else { R.layout.item_green } }.into(something)
The text was updated successfully, but these errors were encountered:
I just realized I can do it on Type using onCreate/onRecycle.
Type
onCreate/onRecycle
Nevermind
Sorry, something went wrong.
Hey, wait a second! :) Yes, it is possible, in a few different ways. I would recommend you this one:
<TextView ... android:textColor="@{item.price > 100 ? @color/red : @color/green}" />
so you can have only one type and only one layout. Simpler.
Hey @nitrico Thanks for the tip,
It's not so simple, price was only an example, anyway... Type works for me and I have only one type and only one layout ;)
No branches or pull requests
Is possible to I access my layout to change the text color like
instead of use LayoutHandler with 2 differents layout:
The text was updated successfully, but these errors were encountered: