Android Question BBCodeView: Can we change the color of linked text (word)?

bsnqt

Active Member
Licensed User
Longtime User
Hi Erel (and All),

I am trying to understand more the BBCodeView sample project. My string is like this:

B4X:
    BBCodeView1.Text = _
$"Lets add a [Color=#ffff00][b][url]label:[/url][/b][/color] here and more text here..."$

But I cannot change the color of the linked text (word), it always stays blue. Is it true that we cannot change the color of linked text (with url) and by default it should be blue color? Or if I can change it, then how can I do it, any tip please.

picture.jpg


Thank you.
 

William Lancee

Well-Known Member
Licensed User
Longtime User
Addendum. After some testing I found that the auto underline stops working when using "TextEngine.TagParser.UrlColor"
In fact, the underline is still there (it can be seen in letters such as gjqp) but is the background color (or transparent).
However the color inside the tags works fine.
 
Upvote 0

bsnqt

Active Member
Licensed User
Longtime User
Addendum. After some testing I found that the auto underline stops working when using "TextEngine.TagParser.UrlColor"
In fact, the underline is still there (it can be seen in letters such as gjqp) but is the background color (or transparent).
However the color inside the tags works fine.
I have tried, and that works. But you are right the underline does not show anymore. However at least I can change the color of different url words by using tags now...
 
Upvote 0

bsnqt

Active Member
Licensed User
Longtime User
With this code:

B4X:
BBCodeView1.Text = _
$"Lets add a [Color=#ff0000][u][b][url]label:[/url][/b][/u][/color] here & _
 and more[url][b][color=#ee00ee] here[/color][/b][/url]"$

I can make it:

1629819353397.png


Actually the underline is still there but invisible. When you click and hold the word, the underline will appear on your finger tip (without taking your finger out from the screen - like long tap and hold)
 
Upvote 0

William Lancee

Well-Known Member
Licensed User
Longtime User
Until it is fixed, if you add a dummy (do nothing) [Span] line it works.

B4X:
    BBCodeView1.Text = _
$"Lets add a [Color=#ff0000][u][b][url]label:[/url][/b][/u][/color] here & _
 and more[url][b][color=#ee00ee] here[/color][/b][/url]
 [Span MinWidth=0%x] [/Span]
 "$
 
Upvote 0
Top