B4A Class AKBubble - A class to create Bubbles/Tooltips

Discussion in 'Additional libraries, classes and official updates' started by DrAlex, Jul 3, 2016.

  1. DrAlex

    DrAlex Member Licensed User

    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.
     

    Attached Files:

    Last edited: Jul 6, 2016
    asales, DroidLyon, Myr0n and 9 others like this.
  2. Dave O

    Dave O Active Member Licensed 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 likes this.
  3. DrAlex

    DrAlex Member Licensed 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).
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice