You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My main goal is to display an icon by running these HTML:
<i class="fas fa-check fa-lg"> from CSS library.
<img src="path_to_icon.png"> from local folder, internet, etc.
I'm currently having ideas to show icon/image through HtmlCompat.fromHtml() or what we would call it String.toSpanned().
That function is being used to translate an HTML to a Spanned text, then giving that Span to the TextView.
Showing icon/image through HTML is currently not possible.
Html.ImageGetter is an interface used to show images from HTML. We will need another resolver for that in the DataCaptureConfig, something called imageHtmlResolver. But it's only exclusive for the <img> tag.
Html.TagHandler can be null for now, no one seem to need it yet, it's an interface to process custom HTML tags.
Note:
There's a solution for displaying image with the <img> tag, that's by using the Html.ImageGetter interface.
But I can't find a solution where the <i class="fas fa-check fa-lg"> tag can use a CSS library that is provided by implementers.
Would like to know people thoughts on this feature, and am I in the right direction? or is anyone has other solution?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
My main goal is to display an icon by running these HTML:
<i class="fas fa-check fa-lg">
from CSS library.<img src="path_to_icon.png">
from local folder, internet, etc.I'm currently having ideas to show icon/image through
HtmlCompat.fromHtml()
or what we would call itString.toSpanned()
.That function is being used to translate an HTML to a Spanned text, then giving that Span to the TextView.
Showing icon/image through HTML is currently not possible.
So I'm thinking, instead of doing this:
We do this:
Html.ImageGetter
is an interface used to show images from HTML. We will need another resolver for that in theDataCaptureConfig
, something calledimageHtmlResolver
. But it's only exclusive for the<img>
tag.Html.TagHandler
can be null for now, no one seem to need it yet, it's an interface to process custom HTML tags.Note:
<img>
tag, that's by using theHtml.ImageGetter
interface.<i class="fas fa-check fa-lg">
tag can use a CSS library that is provided by implementers.Would like to know people thoughts on this feature, and am I in the right direction? or is anyone has other solution?
Beta Was this translation helpful? Give feedback.
All reactions