B4A Library [Class] Baloon labels

Seeing the way SMS are displayed in my device, I thought we should have baloons also.
Here is my way of doing it.
There are two labels in the baloon, each can be styled like a label.
The height of the labels is automatically calculated per the text allocated to it.
The baloon can be rotated to have the tip in each of the four corners.
There are two types of baloons - "SAY" and "THINK" - see example and photo.
If the background is not black - there is a method to adapt the background to the required color.
 

Attachments

  • baloons.png
    baloons.png
    27.1 KB · Views: 1,831
  • baloons.zip
    10.8 KB · Views: 905
Last edited:

kostefar

Active Member
Licensed User
Longtime User
1. The class adjusts the baloon's height to the text height, the width is not adjusted, you can play with the width definition in the class or add adjustment to width measurements,using
Canvas. MeasureStringWidth (Text As String, Typeface As android.graphics.Typeface, TextSize As Float) As Float or other methods which give it.
2. My example does not have a scroll view so I don't know your reference. With a scrollview you can set it to scroll to the bottom in one command.

Edit: I have tried it myself but failed...:(

Thanks for trying derez! I´ll experiment more with this at some point!
 

panagiotisden2

Active Member
Licensed User
Longtime User
Is there a way to make the baloons like the Facebook messenger baloons?
So they get smaller to the left or to the right if the messages displayed is smaller than lets say 10 characters
 
Top