I know that it is possible to reference resources in layout by their resource id:
android:text=\"@{@string/resourceName}\"
However, I would
I ended up creating my own method:
public class BindingUtils {
public static String string(int resourceId) {
return MyApplication
.getApplication()
.getResources()
.getString(resourceId);
}
}
Declaring an import for it:
...
And just calling it during binding:
android:text="@{@string/myFormatString(BindingUtils.string(myPojo.resourceId))}"
Would be nice to have out-of-the-box method for that. DataBinding is sitll in Beta - so maybe it will come in future.