B4J Question [ABMaterial]: SetTooltip?

Mashiane

Expert
Licensed User
Longtime User
Hi there

I have noted that some components have this method in them, however its not used in the demo, perhaps could be used to set tooltips for buttons and other things. I'd like to use it.

Can someone please explain to me how it works, there is a position variable being passed to it.

B4X:
component.SetToolTip("MyToolTip",y,500)

I can identify with the other variables, the y is supposed to be the position, I'm not clear which constants should I use perhaps..

Thanks in advance for your co-operation.
 

alwaysbusy

Expert
Licensed User
Longtime User
Checked it and this has been build in the very beginning I was writing ABMaterial and does not work everywhere. Would need a complete rewrite and as touch devices do not have this, I'm not sure if I will. To much other stuff to handle now, like the ABMaterial Abstract Designer. Maybe, when things settle and I have the time I rewrite this.
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Checked it and this has been build in the very beginning I was writing ABMaterial and does not work everywhere. Would need a complete rewrite and as touch devices do not have this, I'm not sure if I will. To much other stuff to handle now, like the ABMaterial Abstract Designer. Maybe, when things settle and I have the time I rewrite this.
I hear you.
 
Upvote 0

stanmiller

Active Member
Licensed User
Longtime User
Checked it and this has been build in the very beginning I was writing ABMaterial and does not work everywhere. Would need a complete rewrite and as touch devices do not have this, I'm not sure if I will. To much other stuff to handle now, like the ABMaterial Abstract Designer. Maybe, when things settle and I have the time I rewrite this.

Do you recall where it works? Or should we disregard on all components?
 
Upvote 0

stanmiller

Active Member
Licensed User
Longtime User
Hi there

I have noted that some components have this method in them, however its not used in the demo, perhaps could be used to set tooltips for buttons and other things. I'd like to use it.

Can someone please explain to me how it works, there is a position variable being passed to it.

B4X:
component.SetToolTip("MyToolTip",y,500)

I can identify with the other variables, the y is supposed to be the position, I'm not clear which constants should I use perhaps..

Thanks in advance for your co-operation.

The tool tip feature appears to work well with the action button on the desktop but is not as mobile friendly. For example, on a mobile device you need to tap outside the button stack to dismiss. Also to show the tooltip on a mobile you would tap and hold.

1_abm_action_button_tooltip_zpsrd83ghok.jpg


The tooltip position and delay values appear in the sample code from this question about setting the background at StackOverflow.

Materialize Css Tooltip
http://stackoverflow.com/questions/33593605/materialize-css-tooltip

The position options are:

"top"
"left"
"bottom"
"right"

The delay is the timeout before the tooltip is shown and is specified in milliseconds.

Tool tip added to the ABMActionButton in the ABMaterial Demo:
B4X:
public Sub ConnectPage()
    'NEW
    ABMShared.ConnectNavigationBar(page)
 
    Dim acb1 As ABMActionButton
    acb1.Initialize(page, "acb1", "mdi-action-shop", "", "bigblue")
    acb1.MainButton.size = ABM.BUTTONSIZE_LARGE
    acb1.MainButton.SetTooltip("I'm a tool tip1", "left", 1000 )
         
    ' the sub buttons
    Dim btn1 As ABMButton
    btn1.InitializeFloating(page, "btn1", "mdi-social-share", "sub1")
    btn1.SetTooltip("I'm a tool tip4", "top", 1000 )
    acb1.AddMenuButton(btn1)

    Dim btn2 As ABMButton
    btn2.InitializeFloating(page, "btn2", "mdi-social-whatshot", "sub2")
    btn2.SetTooltip("I'm a tool tip3", "left", 1000 )
    acb1.AddMenuButton(btn2)


    Dim btn3 As ABMButton
    btn3.InitializeFloating(page, "btn3", "mdi-social-notifications", "sub3")
    btn3.SetTooltip("I'm a tool tip2", "left", 1000 )
    acb1.AddMenuButton(btn3)
 
    ' add to page
    page.AddActionButton(acb1)
 
Last edited:
Upvote 0
Top