A wrap for this https://github.com/Gaineyj0349/Linker ( not fully tested)
Linker
Author: SMM
Version: 0.01
Sample
Linker
Author: SMM
Version: 0.01
- Linker
Events:- _onlinkclick (charSequenceClicked as String As )
- update As void
- IsInitialized As boolean
- Initialize (ba As anywheresoftware.b4a.BA, EventName As java.lang.String, tv As android.widget.TextView) As void
- clearLinksList As void
- addStrings (list As anywheresoftware.b4a.objects.collections.List) As void
- addProfiles (plist As anywheresoftware.b4a.objects.collections.List) As void
- setLinkColorForCharSequence (charSequenceIn As java.lang.String, color As int) As void
- setUnderlineModeForCharSequence (charSequenceIn As java.lang.String, whether As boolean) As void
- AllLinkUnderline As boolean [write only]
- Profiles As anywheresoftware.b4a.objects.collections.List [read only]
- AllLinkColors As int [write only]
- LinkProfile
Methods:- isUnderlineMode As boolean
- IsInitialized As boolean
- Initialize (ba As anywheresoftware.b4a.BA, charSequence As java.lang.String, linkColor As int, underlineMode As boolean) As void
- UnderlineMode As boolean [write only]
- LinkColor As int
- SpanLocation
Methods:- IsInitialized As boolean
- Initialize (ba As anywheresoftware.b4a.BA, startIndex As int, endIndex As int) As void
- startIndex As int
- EndIndex As int
Sample
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim linker As Linker
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim tv As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
tv.Initialize("tv")
Activity.AddView(tv,0,0,100%x,100%y)
tv.Text= "This is a text for test purpose only , you can't use it in commercial projects without permission"
linker.Initialize("linker",tv)
linker.addStrings(Array As String("only","permission"))
Dim prof As LinkProfile
prof.Initialize("purpose",Colors.Red,False)
linker.addProfiles(Array As LinkProfile(prof))
linker.update
End Sub
Sub linker_onlinkclick(clicked As String)
Log(clicked&" was clicked")
End Sub