Reputation: 35
I have a fragment with ViewModel and a string resource like this
<string name="money_format">Money: %1$d</string>
In ViewModel I have MutableLivaData money
. How I can set in fragment's XMLfile a text property to money_format
with parameter Money
from viewModel
Upvotes: 2
Views: 58
Reputation: 9852
It'll look like this
android:text="@{@string/money_format(viewModel.money)}"
Upvotes: 2