B4J Question Code to recognize Scrollbar mouse actions?

GuyBooth

Active Member
Licensed User
Longtime User
I would like to make a label visible while the user has the mouse pressed over the scrollbar in a CustomListView, and then become invisible when the user releases the mouse button.
Is there any code that will allow me to do this (using reflection, or java object on the Scrollbar for example)?
 

GuyBooth

Active Member
Licensed User
Longtime User
It will be simpler to show the label while the list is scrolled using the ScrollChanged event.
Might be easy to make visible, not so easy to finish without timers?
Another option is to add an event filter with jReflection.
I'd like to use this option. Can anyone point me to where I can figure out what object I have to set as the reflection object, and what the syntax will be for the event?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
not so easy to finish without timers?
Easy:
B4X:
Sub CLV_ScrollChanged (...)
 if lbl.Visible = False Then lbl.SetVisibleAnimated(300, True)
 ScrollChangedIndex = ScrollChangedIndex + 1 'Global Int variable
 Dim MyIndex As Int = ScrollChangedIndex
 Sleep(500)
 If MyIndex = ScrollChangedIndex Then lbl.SetVisibleAnimated(300, False)
End Sub
 
Upvote 0

GuyBooth

Active Member
Licensed User
Longtime User
Still looking for how to set up an event filter with jReflection. What would be my jReflection target to filter the Scrollbar button?
 
Upvote 0
Top