B4A Library HTML TextView V1.0

With this library you can use kind of a new view. A Textview which can show a subset of the html-language

B4X:
tv1.setHtmlFromString("<b><u>Hello B4X community</u></b><br><font face='monospace' color='#0000FF' size='6'>I wish you all a nice Sunday!</font><br><br><img src='https://www.b4x.com/images/Logo_on-dark.png'/>",False)
tv2.setHtmlFromString("<b><u>I LOVE CATS</u></b><br><br><img src='http://snapshots.basic4android.de/cats_dogs.png'/>",False)


htmltextview0030.png


Know issues:
- i was not able to figure out why a fontsize dont get used.

But as i like this library i share it with you even if the fontsize can not be changed actually.

Maybe i just tried in in a wrong way. Please let me know if YOU know how this works :D
 

Attachments

  • HTMLTVEx.zip
    105.6 KB · Views: 804
  • LibHTMLTextView_v1.0.zip
    11.8 KB · Views: 719

DonManfred

Expert
Licensed User
Longtime User
Please note the last parameter. If set to true then the image src expect just a filename (NO URL) without extension.
The file (must be png) will be loaded from res/drawable
for example
If you use this
B4X:
'tv1.setHtmlFromString("<b><u>I LOVE CATS</u></b><br><br><img src='cats_dogs'/>",True)
then the file cats_dogs.png will be loaded from the folder drawable inside your res folder (or the resourcefolder you set with #AdditionalRes)
 

JohnK

Active Member
Licensed User
Longtime User
Know issues:
- i was not able to figure out why a fontsize dont get used.

But as i like this library i share it with you even if the fontsize can not be changed actually.
It may only support "old" HTML tags, so you need to get "old-school" on its ar$e. Try the following:
B4X:
    tv1.setHtmlFromString("<b><u>Hello B4X community</u></b><br><h1><font face='monospace' color='#0000FF'>I wish you all a nice Sunday!</font></h1><br><br><img src='https://www.b4x.com/images/Logo_on-dark.png'/>",False)
The old "h1" tags from yester-year appear to have some effect.
 

watesoft

Active Member
Licensed User
Longtime User
I download the latest version html-textview 2.0,who can help me to build it,for I don't have a Compile environment. thank you very much.
 

Attachments

  • html-textview-master.zip
    118.4 KB · Views: 418
Top