Hello,
This class displays a small panel beside the vertical scrollbar in a scrollview. You can display what you want in its label and drag it to quickly scroll.
My first intention was to add this feature to the FastScroll class of Stevel05, but I quickly realized that I needed to modify several functions in FastScroll and InputSlider. It was faster to reinvent the wheel and it's easier to maintain.
It needs two libraries: Animation and Reflection.
Tutorials: How they do #2, How they do #3
v1.1:
Warning: the FastScroll parameter in Initialize() has been replaced by UseCache. The FastScroll feature did not work very well and I prefered to drop it.
I added a cache to speed GetTopMostView. The speed gain is huge with heavy loaded ScrollViews. Don't forget to call RefreshCache every time you modify the ScrollView content. You can set UseCache to false if your ScrollView contains less than 100 items. More info here.
I fixed the bug with containers. Now you can put your ScrollView in a TabHost.
I fixed a bug in DisplayTextLine.
I added two events (onShowHide and onTextUpdated).
I added ScrollPanelMovedByUser. It returns True when the user drags the ScrollPanel.
v1.2:
A few bugs fixed. See post #6 for details.
Function "Remove" added.
v1.3:
Two bugs fixed. See post #7 for details.
v1.4:
Removed the Parent parameter in Initialize (useless)
New function: LoadDrawable(Name As String) As Object
ReplaceBackground now accepts drawables
It waits now until the user really scrolls (solves the overscrolling issue).
Fred
This class displays a small panel beside the vertical scrollbar in a scrollview. You can display what you want in its label and drag it to quickly scroll.
My first intention was to add this feature to the FastScroll class of Stevel05, but I quickly realized that I needed to modify several functions in FastScroll and InputSlider. It was faster to reinvent the wheel and it's easier to maintain.
It needs two libraries: Animation and Reflection.
Tutorials: How they do #2, How they do #3
v1.1:
Warning: the FastScroll parameter in Initialize() has been replaced by UseCache. The FastScroll feature did not work very well and I prefered to drop it.
I added a cache to speed GetTopMostView. The speed gain is huge with heavy loaded ScrollViews. Don't forget to call RefreshCache every time you modify the ScrollView content. You can set UseCache to false if your ScrollView contains less than 100 items. More info here.
I fixed the bug with containers. Now you can put your ScrollView in a TabHost.
I fixed a bug in DisplayTextLine.
I added two events (onShowHide and onTextUpdated).
I added ScrollPanelMovedByUser. It returns True when the user drags the ScrollPanel.
v1.2:
A few bugs fixed. See post #6 for details.
Function "Remove" added.
v1.3:
Two bugs fixed. See post #7 for details.
v1.4:
Removed the Parent parameter in Initialize (useless)
New function: LoadDrawable(Name As String) As Object
ReplaceBackground now accepts drawables
It waits now until the user really scrolls (solves the overscrolling issue).
Fred
Attachments
Last edited: