The purpose of the library LBubble, is simply to show bubbles or balloons containing text.
Especially useful for chatting or messaging.
Attention: you need to load the library StringUtils, to use LBubble
LBubble
Author: Vampirbcn
Version: 2.0
LBubble
Events:
Image example:
-. Sorry for my bad English. -
Especially useful for chatting or messaging.
Attention: you need to load the library StringUtils, to use LBubble
LBubble
Author: Vampirbcn
Version: 2.0
LBubble
Events:
Click ()
-Event that runs when you click on the three dots to expand the content.
Methods:-Event that runs when you click on the three dots to expand the content.
Initialize (YourActivitymodule As Object, EventName As String)
-Initialize the object
CreateLBubble(parent As Panel, Message As String, messagetop As String, top As Int, width As Int, position As Int) As Int
-Create Label Bubble
LBubbleGradient(ColorInitial As Int, ColorEnd As Int)
-Set gradient colors of bubble background
Properties:-Initialize the object
CreateLBubble(parent As Panel, Message As String, messagetop As String, top As Int, width As Int, position As Int) As Int
-Create Label Bubble
LBubbleGradient(ColorInitial As Int, ColorEnd As Int)
-Set gradient colors of bubble background
TopTextcolor As Int
-Title text color
Textcolor As Int
-Text color
Textsize As Int
-Text size
TopTextsize As Int
-Title text size
Margin As Int
-Bubble margin with the edge of panel
LBubbleMsgContent As String [read only]
-Full text bubble containing
-Title text color
Textcolor As Int
-Text color
Textsize As Int
-Text size
TopTextsize As Int
-Title text size
Margin As Int
-Bubble margin with the edge of panel
LBubbleMsgContent As String [read only]
-Full text bubble containing
Image example:
B4X:
'
'
' -----------------------------------------------------------
' -------------- NEEDS StringUtils lib --------------------
' -----------------------------------------------------------
'
'
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
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 ScrollView1 As ScrollView
Dim bubble As LBubble
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim thetop As Int 'bubbles top
ScrollView1.Initialize(100%y-30) ' scrollview bubble container
Activity.AddView(ScrollView1,10,10,100%x-20,100%y-30) ' Add Scrollview to activity
bubble.Initialize(Me,"thebubble") ' initialize LBubble
ScrollView1.Panel.Width=ScrollView1.Width
ScrollView1.Panel.Height=ScrollView1.Height
thetop=20 'assign the top position of the first bubble
bubble.Textsize=10 ' bubble text size
bubble.TopTextsize=11 ' bubble title text size
thetop=bubble.CreatelBubble(ScrollView1.Panel,"Lorem ipsum." & CRLF & "onsectetuer adipiscing elit, sed diam nonummy nibh euismod ...." & CRLF & "Lorem ipsum." & CRLF & "Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit" & CRLF & "Lorem itsum dolor.", "01-08-2013", thetop+20, 250, 3)
thetop=bubble.CreatelBubble(ScrollView1.Panel,"Ok","Message-2", thetop+20, 350, 0)
thetop=bubble.CreatelBubble(ScrollView1.Panel,"Lorem ipsum." & CRLF & "sed diam nonummy.", "Message-3", thetop+20, 350, 1)
bubble.TopTextcolor=Colors.Red ' other bubble tittle color
bubble.Textsize=10 ' other bubble text size
bubble.TopTextsize=18 ' other bubble text size
thetop=bubble.CreatelBubble(ScrollView1.Panel,"Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy...." & CRLF & "Lorem ipsum dolor." & CRLF & "Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper..." & CRLF & "Lorem ipsum dolor." & CRLF & "Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper...." & CRLF & "Loren ipsum." & CRLF & "in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui" & CRLF & "Lorem itsum." & CRLF & "et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilis....", "02-08-2013", thetop+20, 350, 2)
If thetop>ScrollView1.Panel.Height Then ScrollView1.Panel.Height= thetop+30 ' Reallocate ScrollView1.Panel height
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub thebubble_Click ' bubble click event
Msgbox(bubble.LBubbleMsgContent,"")
End Sub
-. Sorry for my bad English. -
Attachments
Last edited: