B4A Library ClickableTextView Library

Hello,

The Library ClickableTextView simply lets you add (append) any String (Text) with any Color to your TextView and will be clickable.

The Event "_ClickableLink" will catch any Click and returns the clicked String (Text).

Functions:
B4X:
'To Add a Clickable Text to the Label
ClickableTV.AddLinkText(TextView,"TextToClickable",Color,"EventName")
'To Append a Text to a Label
ClickableTV.AppendText(TextView,"TextToAppend")
Events:
B4X:
EventName_clickablelink (Text as String)


I hope some of you might find it useful too.

A Demo Project is Included.

greeTz,
reeZZer

Credits to the Code Creator: thanksmister
 

Attachments

  • ClickableTextView.zip
    302.2 KB · Views: 628
Last edited:

metrick

Active Member
Licensed User
Longtime User
reeZZer:
Is there a way that I can modify the click able area?
I am not clicking on the text(word) is still display click event.
Great LIB, Thanks.
 

reeZZer

Member
Licensed User
Longtime User
Could you explain me exactly how that happens? Maybe a Project Demo and explaination how.

Try to set it like this:
B4X:
ClickableTV.AddLinkText(TextView,"this is a click text",Colors.Blue,"EventName")
ClickableTV.AppendText(TextView," ")
and see if this will fix the issue.

If yes i will just fix the Library.

Thanks.
 
Last edited:

metrick

Active Member
Licensed User
Longtime User
ReeZZer:
I have attached the clickabletextdemo zip file.
It seem like I can click any where on the empty space (far away from any words) of assigned Label2 and Getstring_clickablelink will always display a word close to it.
I am also loading from text file and split contents into separated words into array and add to addlinktext via for loop.
Thanks in advance
 

Attachments

  • clickabletextdemo.zip
    7.1 KB · Views: 278

anallie0

Active Member
Licensed User
Longtime User
excellent library, is it possible to have the same label 2 or more words
touch with different links ?
 

ciginfo

Well-Known Member
Licensed User
Longtime User
Library returns only a string?
I should like when I click on the clickable word (number phone for example) open the resident application phone and dial the number.
Is there possibility that an event open a resident appli?
 

Blue.Sky

Active Member
Licensed User
Longtime User
Hi
Thank you for your library.because it is very easy and simple scale to labelextra
I have a question
How do i detect long click?
I use EditText to detect string and not problem
But i need to detect selection text via user for highlight it
Is there any way?
 

Rusty

Well-Known Member
Licensed User
Longtime User
Can this library be updated to support string colors for example.
ClickableTV.AppendText(TextView,"TextToAppend", colors.blue)
Thanks
Rusty
 

DonManfred

Expert
Licensed User
Longtime User
Top