B4J Question [ABMaterial] ABMLabel content with different colors and formatting - please help!!!

Mashiane

Expert
Licensed User
Longtime User
Hi

I'm displaying text in an ABMLabel control, so far so good. Some text though is enclosed in some html color schemes.. For example

{\cf6 My name is Ano} should be My name is Ano
{\cf15\I This is another example} should be This is another example
<b>A bold example</b> should be A bold example

Can you kindly advise how can I achieve such output with ABMLabel. All this content could be in the same ABMLabel content. I have tried replacing <b></b> with {B}{/B} this has not really helped.

Can someone please advise?

Thanks a lot!

PS: The example below shows what I have maneged to do so far. Now the issue is color coding it. The bold sections should be red however to demonstrate this I have made them bold with this...

B4X:
Public Sub ItalicScripture1(tVerse As String) As String
    tVerse = tVerse.Replace("<i>","{I}")
    tVerse = tVerse.replace("</i>","{/I}")
    tVerse = tVerse.Replace("<b>","{B}")
    tVerse = tVerse.replace("</b>","{/B}")
    tVerse = tVerse.replace("<font color='gray'>","{B}")
    tVerse = tVerse.replace("<font color='red'>","{B}")
    tVerse = tVerse.replace("</font>","{/B}")
    Return tVerse
End Sub

verse.png
 
Last edited:
Top