Skip to content

Commit

Permalink
More scroller show/hide delegate updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian William Wolter committed Aug 21, 2011
1 parent e4da0ef commit e6df874
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions lib/UIKit/TUIScrollView.m
Expand Up @@ -390,15 +390,19 @@ - (void)_updateScrollKnobsAnimated:(BOOL)animated {

// notify the delegate about changes in vertical scroll indiciator visibility
if(vWasVisible != vEffectiveVisible){
if(_scrollViewFlags.delegateScrollViewWillShowScrollIndicator){
if(vEffectiveVisible && _scrollViewFlags.delegateScrollViewWillShowScrollIndicator){
[self.delegate scrollView:self willShowScrollIndicator:TUIScrollViewIndicatorVertical];
}else if(!vEffectiveVisible && _scrollViewFlags.delegateScrollViewWillHideScrollIndicator){
[self.delegate scrollView:self willHideScrollIndicator:TUIScrollViewIndicatorVertical];
}
}

// notify the delegate about changes in horizontal scroll indiciator visibility
if(hWasVisible != hEffectiveVisible){
if(_scrollViewFlags.delegateScrollViewWillShowScrollIndicator){
if(hEffectiveVisible && _scrollViewFlags.delegateScrollViewWillShowScrollIndicator){
[self.delegate scrollView:self willShowScrollIndicator:TUIScrollViewIndicatorHorizontal];
}else if(!hEffectiveVisible && _scrollViewFlags.delegateScrollViewWillHideScrollIndicator){
[self.delegate scrollView:self willHideScrollIndicator:TUIScrollViewIndicatorHorizontal];
}
}

Expand All @@ -413,22 +417,25 @@ - (void)_updateScrollKnobsAnimated:(BOOL)animated {

// notify the delegate about changes in vertical scroll indiciator visibility
if(vWasVisible != vEffectiveVisible){
if(_scrollViewFlags.delegateScrollViewDidShowScrollIndicator){
if(vEffectiveVisible && _scrollViewFlags.delegateScrollViewDidShowScrollIndicator){
[self.delegate scrollView:self didShowScrollIndicator:TUIScrollViewIndicatorVertical];
}else if(!vEffectiveVisible && _scrollViewFlags.delegateScrollViewDidHideScrollIndicator){
[self.delegate scrollView:self didHideScrollIndicator:TUIScrollViewIndicatorVertical];
}
}

// notify the delegate about changes in horizontal scroll indiciator visibility
if(hWasVisible != hEffectiveVisible){
if(_scrollViewFlags.delegateScrollViewDidShowScrollIndicator){
if(hEffectiveVisible && _scrollViewFlags.delegateScrollViewDidShowScrollIndicator){
[self.delegate scrollView:self didShowScrollIndicator:TUIScrollViewIndicatorHorizontal];
}else if(!hEffectiveVisible && _scrollViewFlags.delegateScrollViewDidHideScrollIndicator){
[self.delegate scrollView:self didHideScrollIndicator:TUIScrollViewIndicatorHorizontal];
}
}


if(vVisible)
if(vEffectiveVisible)
[_verticalScrollKnob setNeedsLayout];
if(hVisible)
if(hEffectiveVisible)
[_horizontalScrollKnob setNeedsLayout];

}
Expand Down

0 comments on commit e6df874

Please sign in to comment.