I have a custom view with a styleable attribute defined as:
<declare-styleable name="CustomView">
<attr name="stringAttribute" format="string"/>
</declare-styleable>
I'd like to pass a string resource to this view when it is initialized, so I can grab it via obtainStyledAttributes
and apply it to the view right away.
However, since the string resource is dynamic, I can't seem to find a way to pass it to the view without using a binding adapter.
Is it possible to pass a string resource ID to a custom view, without relying on a binding adapter?
The desired solution would be something like this (where the resource ID is dynamic):
app:stringAttribute="@{context.getString(R.string.value)}"