Android Tutorial [B4X] Cross platform chat layout example

Status
Not open for further replies.

Example of implementing a chat layout.
It is based on xCustomListView. The text is created with a hidden BBCodeView (BCTextEngine) and the bubble is drawn with BitmapCreator.
Extracting the image from BBCodeView is not trivial. See the code.

The code is implemented in the Chat class which is shared between the three projects.

BCTextEngine: https://www.b4x.com/android/forum/threads/106207/#content
 

Attachments

  • Chat.zip
    259.1 KB · Views: 2,158

Mike1970

Well-Known Member
Licensed User
Longtime User
Great Job.
A small question: i tried to change the properties of the TextField in the designer, but then when the code runs, it reset to a white rectangle. How can i change the design?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
i tried to change the properties of the TextField in the designer
What have you changed? There is no TextField in this example. It is a B4XFloatTextField.

but then when the code runs, it reset to a white rectangle
I don't understand what you mean. Better to post a screenshot.

How can i change the design?
I don't see how we can answer this question.

For further discussion please start a new thread in the questions forum and make sure to include all relevant information.
 

LucaMs

Expert
Licensed User
Longtime User
Great Job.
A small question: i tried to change the properties of the TextField in the designer, but then when the code runs, it reset to a white rectangle. How can i change the design?
For the moment you can change it in the Initialize routine of the Chat class - added one last line:
B4X:
Public Sub Initialize (Parent As B4XView)
    Parent.LoadLayout("1")
    Engine.Initialize(Parent)
    bc.Initialize(300, 300)
    TextField.NextField = TextField
   
    TextField.mBase.Color = xui.Color_LightGray ' <--------
End Sub

Then you will get a better answer ;)


P.S. Erel replied simultaneously
 
Status
Not open for further replies.
Top