George Mount So i refactored my app to use data binding.
Roney Thomas
3
After some time messing around i settled with android:textStyle.
So this how the code looks now.
<TextView
android:id="@+id/price"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:elegantTextHeight="false"
android:text="@{@string/price(inventory.price)}"
android:textAlignment="textEnd"
tools:text="134$"
android:textStyle="normal|bold"/>
I think it's better not to store rich text formatting in string resource and use styles instead. That way in future when you update the design, you won’t have to edit each string resource manually. Update in one place and it get’s applied everywhere.