pixplicity / htmlcompat Goto Github PK
View Code? Open in Web Editor NEWCompatibility library for Android's Html class. [DEPRECATED]
License: Apache License 2.0
Compatibility library for Android's Html class. [DEPRECATED]
License: Apache License 2.0
A project Im working on now, we recieve html that has tags with a class attribute. Something like this:
Now we are going to use a <span class="span_class">span tag and apply a class to it</span>
We cant handle this with TagHandler
.
Html
and HtmlCompact
have basic support for span styles, which means any unsupported tags will get swallowed.
How about about another callback that will let us explicitly handle spans ourselves.
reference #16
It would be nice to get the changes included in 7fb63a2
Do you have plans on making a new release?
Can you add support for the above in future release?
Thanks.
I'm using this library in my project but i've seen <strike>
and <del>
tags are not working.
String priceString="<del>123</del>";//model.getPriceHtml();
Log.e("Price",priceString);
holder.price.setText(HtmlCompat.fromHtml(mContext,priceString,HtmlCompat.FROM_HTML_MODE_LEGACY));
I am pass this String as Html text to HtmlCompat class
red yellow
but here the first parent span tag "red" is getting red color applied but the child span .i.e. "yellow" is also getting red color applied. But instead it should get yellow color to the text since I am adding style with color yellow.
Can you guys help me or am I doing something wrong.
Below this the code that i am doing:
textView.setText(
HtmlCompat.fromHtml("red yellow",HtmlCompat.FROM_HTML_MODE_LEGACY));
here i am creating instance of TextView and adding that view programmatically
Hello, I am happy to find this project and it works very well. But I found a problem:
When I calls:
HtmlCompat.fromHtml(this, "<strike> str ike </strike>", 0)
The textView
shows:
str ike
This is not what I expected. Can I keep all spaces of the source and apply the strike
style to them?
Thanks!
As the repo says:
Nougat introduced vast improvements to the Html class for converting HTML to spannables.
Is there a list of them on Google's docs websites?
I know for sure that some of the items on the list you've written already existed before.
Hi Pixplicity, I am using your library to display the text that contains image,text , background of text but the problem is my image is not showing the text colour when I'm using HtmlCompat, any help would be appreciable, thanks.
Is there a reason there is allowBackaup attribute on the manifest?
Normally that shouldn't be included
https://github.com/Pixplicity/HtmlCompat/blob/master/library/src/main/AndroidManifest.xml#L5
Hi, do you have any plans to support for <ol>
tag ?
groups in table tag like <table> <tr> <td>
I want to show such HTML string:
<p><span style="color: rgb(230, 0, 0);">should be text color red</span></p><p><br></p><p><br></p><p><span style="background-color: rgb(230, 0, 0);">should be text color red background</span></p>
However it is not formatted and lack of colors. I have just only replace this HTML string in the sample app of this project(replaced the R.raw.example string inside).
How can I load images from <img>
using Picasso?
I can get image url
from source
attribute and create Drawable instance, but I can't return for method getDrawable
from the docs/method name it is not really clear that you have to return the span also if you did not modify/replace it. Normally the name Callback suggests that it is just a notification while this function actually alters the bahavior. Maybe something like SpanHandler would be clearer.
Hello, Can you support the attribute of size of font tag?
Hi,
I was looking through my app APK and noticed a strange 30K sample.png
and realized it comes from your library. Is there a reason for it being there and not in the sample
project? We have an Instant App which has APKs limited to 4MB so every KB counts.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.