B4A Class AKBubble - A class to create Bubbles/Tooltips

Version 1.01:

A few improvements:

1. All properties made read/write.

2. The Tether property renamed to TetherSize.

3. Two new read-only properties: Bubble and Tether. These are references to the bubble and tether objects. They can be useful if, for example, you want to delete these objects.

4. In version 1.00 the tether continued only to a vertex of the bubble's rectangle. However, since the border corners are rounded, there is a gap between the vertex and the border's arc. If the corner radius is small, this gap is almost unnoticeable, but with large radii you can see it very well. Now we have extended the tether so that it continues to the border's arc (I hope my explanation is clear :confused:).

A lot of thanks to Dave O for his feedback.


AKBubble Class

This class lets you click an object and display a bubble with a text. I have written it for an app, which shows group photographs. I wanted to be able to click on a person and have his or her name displayed.

cat.png


The zipped file contains the class source, an example and a short manualץ

I am looking forward to your feedback.
 

Attachments

  • AKBubble-1.01.zip
    439.2 KB · Views: 209
Last edited:

Dave O

Well-Known Member
Licensed User
Longtime User
Thanks for making this class available.

A few quick notes:
- I wasn't sure what tether was until I looked at the class code and saw that it's the length of the tether. Perhaps tetherLength would be more consistent with your other properties?
- It would be generally handy for most properties to be read/write. Many of them are write-only right now.
- It may be handy to be able to add a bubble for a particular view (i.e. the class would figure out the rect from that).
- It also may be handy to default the colors to something more standard (e.g. black text, gray background?) than red/yellow, so that people may not need to change these for common uses.
- You can probably remove the dependencies on the ABExtDrawing/etc. libraries by writing a few subs using JavaObject. I did the same for my DOTips class (e.g. for DrawRoundRect). People may be less likely to use your class if it depends on other third-party libraries (particularly if they're not free).

Thanks again!
 

DrAlex

Member
Licensed User
Longtime User
Hello Dave O,

Thank you very much for your feedback. I will seriously consider making the changes you've recommended.

Regarding tether: I haven't called it tetherLength because strictly speaking it is not. The length of the tether is actually tether * Sqrt(2).
 
Top