libgdx/libgdx — pull request #1626 by Senth (2014-04-03 12:40:28+00:00)
Title: ScrollPane edge listener

### Problem
In my game I wanted to update a list dynamically if the user scrolled down to the bottom of the ScrollPane (as content is loaded from the web). At the same time have the content be fully refreshed if the user scrolls to the top. I tried to implement this behavior through a listener but the internal ScrollPane listeners hijacked the events which made it impossible unless I extended the ScrollPane and change the act() method.

### Suggested solution
For this I created a new ScrollPaneEdgeListener (not sure about naming). ScrollPane now allows these to be added via addScrollPaneEdgeListener(listener). The ScrollPaneEdgeListener has a single method hitEdge(ScrollPane,Edges) where Edges is an enum in ScrollPaneEdgeListener.

### Behavior
Events are not spammed
**Pan:** event fires when the edge is hit, if overextending it will fire again once it has gone back to the edge and extend beyond the edge again. E.g. overextended -> release -> pan and overextend again -> event fired
**Flick:** Works as pan.
**Scroll (mouse):** Every scroll that will move to or beyond the edge, i.e. the user will be able to spam here.
**Scrollbar:** Once the scrollbar hits the edge the event is fired, the user has to move back the scrollbar and to the edge again for the event to be fired.

### Testing
I have tested and this seems to work. I've tested scrolling using mouse, during pan, flick, and manually moving scroll bars and events are fired accordingly. But I've probably missed some combinations.