Project: titanium
Issue TIMOB-23406: iOS/Android: Add 'scrolling' event to ListView to track scroll direction (up or down)
At the moment is not possible to determine the scroll direction of a ListView natively and as the view is scrolling. Very common effects such as the hiding of the navigation bar when scrolling (like on the Facebook app) become impossible to achieve without cumbersome workarounds. I will send a PR with a modification to the SDK core. Probably some modifications like coding style and naming will be necessary (By no means I am an Objective C dev). Most of the code I took straight from Stackoverflow [link Stackoverflow|http://stackoverflow.com/a/21263997/436785] {code:java} - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { if (!decelerate) { if ([self isLazyLoadingEnabled]) { [[ImageLoader sharedLoader] resume]; } [self fireScrollEnd:(UITableView *)scrollView]; } if ([self.proxy _hasListeners:@"dragend"]) { [self.proxy fireEvent:@"dragend" withObject:nil withSource:self.proxy propagate:NO reportSuccess:NO errorCode:0 message:nil]; } if ([self.proxy _hasListeners:@"pullend"]) { if ( (_pullViewProxy != nil) && (pullActive == YES) ) { pullActive = NO; [self.proxy fireEvent:@"pullend" withObject:nil withSource:self.proxy propagate:NO reportSuccess:NO errorCode:0 message:nil]; } } } {code}
Story points: 3