Skip to content
New issue

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

How can I use Databinding for bootstrapText? #203

Open
ashi-psn opened this issue Jul 15, 2017 · 1 comment
Open

How can I use Databinding for bootstrapText? #203

ashi-psn opened this issue Jul 15, 2017 · 1 comment

Comments

@ashi-psn
Copy link

I want to put the FontAweSome icon on the left and want to display the text obtained from the model to the right.
I thought that the part of Databinding had to be escaped, and wrote the code as
app:bootstrapText="{fa_tag} "@{xxx.xxx}"".
However, an exception Caused by: java.lang.IllegalArgumentException: Could not find FontIcon value for 'xxx.xxx', please ensure that it is mapped to a valid font occurred.
I tried it elsewhere, but eventually I did not solve it.
How do I use Databinding for bootstrapText?

@jamie-beardedhen
Copy link
Contributor

FontIcons can be escaped through XML in the following way:

app:bootstrapText="Escaped \{fa_facebook\} icon (gravity=start)"

I'm assuming you're talking about the Android Databinding library. If that's the case, then the two aren't currently compatible. It should be possible to update the code which parses BootstrapText to ignore databinding syntax, although I'm not too familiar with databinding - is @{var} the only syntax used or are there others?

Relevant code: https://github.com/Bearded-Hen/Android-Bootstrap/blob/master/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/IconResolver.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants