Show icon/image when displaying HTML #2214
FikriMilano
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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