I am planning to use xclv as a chatbox with supporting of animated gifs in it like animated smilyes ..
i have followed this tutorial that posted previously by using regex and csbuilder
the thing is cs.Image(smgif, 30dip, 30dip, True) accepts only bitmaps in the parameter can i do any workaround to add the b4xgifview
also since those smilyes are diffrent Gifs based on user text input i am not sure what should i place during creatingdesignerview in b4xgifview
[B4X] B4XGifView - Cross platform animated gif view
I was missing a cross platform, animated gif view, so created one. Usage is simple: Add with the visual designer and call SetGif to set the gif file. The B4i implementation depends on FLAnimatedImage open source project: https://github.com/Flipboard/FLAnimatedImage The FLAnimatedImage library...
www.b4x.com
i have followed this tutorial that posted previously by using regex and csbuilder
[B4X] CSBuilder marking based on regex pattern
CSBuilder is supported by B4A and B4J. There are some differences in the supported properties. A more powerful cross platform alternative: [B4X] BCTextEngine / BBCodeView - Text engine + BBCode parser + Rich Text View This sub searches for matches and uses CSBuilder to mark the matches...
www.b4x.com
B4X:
Sub ReplaceSmilies(s As String) As CSBuilder
Dim baseSmiley() As String
baseSmiley = smileysStringarray
Dim rb As RegexBuilder
rb.Initialize
For Each smiley As String In baseSmiley
If rb.Pattern <> "" Then rb.AppendOr
rb.StartNonCapture.AppendEscaped(smiley).EndNonCapture
Next
Return MarkPattern(s, rb.Pattern, 0)
End Sub
Sub MarkPattern(Input As String, Pattern As String, GroupNumber As Int) As CSBuilder
Dim cs As CSBuilder
cs.Initialize
Dim lastMatchEnd As Int = 0
Dim m As Matcher = Regex.Matcher(Pattern, Input)
Do While m.Find
Dim currentStart As Int = m.GetStart(GroupNumber)
cs.Append(Input.SubString2(lastMatchEnd, currentStart))
lastMatchEnd = m.GetEnd(GroupNumber)
'apply styling here
Log(m.Group(GroupNumber))
Dim smgif As b4xgifview
smgif.Initialize(Me,"")
smgif.DesignerCreateView(Activity,Null,Null) ' not sure in that case what i have to create as a base
smgif.SetGif(File.DirAssets, 1.gif")
cs.Image(smgif, 30dip, 30dip, True)
Loop
If lastMatchEnd < Input.Length Then cs.Append(Input.SubString(lastMatchEnd))
Return cs
End Sub
the thing is cs.Image(smgif, 30dip, 30dip, True) accepts only bitmaps in the parameter can i do any workaround to add the b4xgifview
also since those smilyes are diffrent Gifs based on user text input i am not sure what should i place during creatingdesignerview in b4xgifview
Last edited: