This is a wrap for this Github project.
ChatMessageView
Author: DonManfred (wrapper)
Version: 1
ChatView
Events:
MessageBuilder
Methods:
MessageView
Fields:
Message
Methods:
ChatMessageView
Author: DonManfred (wrapper)
Version: 1
ChatView
Events:
- onSendClicked (v As View)
- ba As anywheresoftware.b4a.BA
- hideKeyboard As void
Hide software keyboard - DesignerCreateView (base As anywheresoftware.b4a.objects.PanelWrapper, lw As anywheresoftware.b4a.objects.LabelWrapper, props As anywheresoftware.b4a.objects.collections.Map) As void
- IsInitialized As boolean
- Initialize (ba As anywheresoftware.b4a.BA, EventName As java.lang.String) As void
- BringToFront As void
- SetLayout (arg0 As int, arg1 As int, arg2 As int, arg3 As int) As void
- SendToBack As void
- SetVisibleAnimated (arg0 As int, arg1 As boolean) As void
- receive (message As jp.bassaer.chatmessageview.models.Message) As void
- RemoveView As void
- Invalidate3 (arg0 As int, arg1 As int, arg2 As int, arg3 As int) As void
- Invalidate2 (arg0 As android.graphics.Rect) As void
- SetColorAnimated (arg0 As int, arg1 As int, arg2 As int) As void
- SetBackgroundImage (arg0 As android.graphics.Bitmap) As void
- Invalidate As void
- send (message As jp.bassaer.chatmessageview.models.Message) As void
- SetLayoutAnimated (arg0 As int, arg1 As int, arg2 As int, arg3 As int, arg4 As int) As void
- RequestFocus As boolean
- Left As int
- Parent As java.lang.Object [read only]
- InputText As java.lang.String
- DateSeparatorColor As int [write only]
- InputTextHint As java.lang.String [write only]
- LeftMessageTextColor As int [write only]
- Visible As boolean
- Padding As int[]
- SendButtonColor As int [write only]
- Height As int
- Width As int
- RightBubbleColor As int [write only]
- Background As android.graphics.drawable.Drawable
- UsernameTextColor As int [write only]
- Color As int [write only]
- Enabled As boolean
- SendTimeTextColor As int [write only]
- SendIcon As int [write only]
- AutoScroll As boolean [write only]
Auto Scroll when message received. - LeftBubbleColor As int [write only]
- Top As int
- RightMessageTextColor As int [write only]
- Tag As java.lang.Object
- BackgroundColor As int [write only]
MessageBuilder
Methods:
- setMessageText (messageText As java.lang.String) As de.donmanfred.MessageBuilderWrapper
- setRightMessage (isRight As boolean) As de.donmanfred.MessageBuilderWrapper
- IsInitialized As boolean
- Initialize (ba As anywheresoftware.b4a.BA, EventName As java.lang.String) As void
- setUserIcon (icon As android.graphics.Bitmap) As de.donmanfred.MessageBuilderWrapper
- setCreatedAt (calendar As java.util.Calendar) As de.donmanfred.MessageBuilderWrapper
- setDateCell (isDateCell As boolean) As de.donmanfred.MessageBuilderWrapper
- setUserName (userName As java.lang.String) As de.donmanfred.MessageBuilderWrapper
- build As jp.bassaer.chatmessageview.models.Message
MessageView
Fields:
- ba As anywheresoftware.b4a.BA
- DesignerCreateView (base As anywheresoftware.b4a.objects.PanelWrapper, lw As anywheresoftware.b4a.objects.LabelWrapper, props As anywheresoftware.b4a.objects.collections.Map) As void
- IsInitialized As boolean
- Initialize (ba As anywheresoftware.b4a.BA, EventName As java.lang.String, messages As java.util.ArrayList) As void
- BringToFront As void
- SetLayout (arg0 As int, arg1 As int, arg2 As int, arg3 As int) As void
- SendToBack As void
- init2 As void
Initialize list - SetVisibleAnimated (arg0 As int, arg1 As boolean) As void
- init (messages As anywheresoftware.b4a.objects.collections.List) As void
- RemoveView As void
- Invalidate3 (arg0 As int, arg1 As int, arg2 As int, arg3 As int) As void
- Invalidate2 (arg0 As android.graphics.Rect) As void
- SetColorAnimated (arg0 As int, arg1 As int, arg2 As int) As void
- SetBackgroundImage (arg0 As android.graphics.Bitmap) As void
- scrollToEnd As void
- Invalidate As void
- SetLayoutAnimated (arg0 As int, arg1 As int, arg2 As int, arg3 As int, arg4 As int) As void
- RequestFocus As boolean
- RightBubbleColor As int [write only]
- Left As int
- Message As jp.bassaer.chatmessageview.models.Message [write only]
- Background As android.graphics.drawable.Drawable
- UsernameTextColor As int [write only]
- Parent As java.lang.Object [read only]
- Color As int [write only]
- Enabled As boolean
- SendTimeTextColor As int [write only]
- LeftBubbleColor As int [write only]
- LeftMessageTextColor As int [write only]
- Top As int
- Visible As boolean
- RightMessageTextColor As int [write only]
- Padding As int[]
- Height As int
- Tag As java.lang.Object
- Width As int
- DateSeparatorTextColor As int [write only]
Message
Methods:
- isDateCell As boolean
- initDate As void
- isRightMessage As boolean
- IsInitialized As boolean
- Initialize (ba As anywheresoftware.b4a.BA, EventName As java.lang.String) As void
- RightMessage As boolean [write only]
- TimeText As java.lang.String
- UserName As java.lang.String
- UserIcon As android.graphics.Bitmap
- CreatedAt As java.util.Calendar
- MessageText As java.lang.String
- DateCell As boolean [write only]
- CompareCalendar As java.util.Calendar [read only]
Return Calendar to compare the day <br>
Reset hour, min, sec, milli sec.<br> - DateSeparateText As java.lang.String
B4X:
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private chat As ChatView
'Private msgview As MessageView
Private builder As MessageBuilder
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")
Dim bmp As Bitmap
bmp.Initialize(File.DirAssets,"DonManfred.png")
Dim messages As List
messages.Initialize
Dim msg As Message
builder.Initialize("")
msg = builder.setUserIcon(bmp).setMessageText("Hallo B4X-World! :-)").setRightMessage(False).setUserName("DonManfred").build
messages.Add(msg)
chat.send(msg)
Dim msg As Message
builder.Initialize("")
msg = builder.setMessageText("Hallo Manfred!").setRightMessage(True).setUserName("Someone").build
messages.Add(msg)
'msgview.init(messages)
'msgview.Message = msg
chat.send(msg)
chat.AutoScroll = True
chat.BackgroundColor = Colors.LightGray
chat.DateSeparatorColor = Colors.Blue
chat.InputTextHint = "This is the hint"
chat.BackgroundColor = Colors.DarkGray
chat.LeftBubbleColor = Colors.ARGB(255,128,64,64)
chat.RightBubbleColor = Colors.ARGB(255,64,128,128)
chat.LeftMessageTextColor = Colors.Red
chat.RightMessageTextColor = Colors.Magenta
End Sub
Attachments
Last edited: