public override void Scrolled (UIScrollView scrollView)
{
if (!checkForRefresh)
return;
if (Container.reloading)
return;
var point = Container.TableView.ContentOffset;
var topView = Container.topRefreshView;
if (topView == null)
return;
if (topView.IsFlipped && point.Y > -yboundary && point.Y < 0){
topView.Flip (true);
topView.SetStatus (RefreshViewStatus.PullToReload);
} else if (!topView.IsFlipped && point.Y < -yboundary){
topView.Flip (true);
topView.SetStatus (RefreshViewStatus.ReleaseToReload);
}
var bottomView = Container.bottomRefreshView;
if (bottomView!=null && bottomView.Frame!=null && bottomView.Frame.Y!=scrollView.ContentSize.Height)
bottomView.Frame = new RectangleF(0,scrollView.ContentSize.Height, bottomView.Frame.Width, bottomView.Frame.Height);
if (bottomView == null)
return;
var bottomOffset = this.TableScrollOffset();
if (bottomView.IsFlipped && point.Y > yboundary && bottomOffset < 0 && bottomOffset >= -yboundary) {
bottomView.Flip (true);
bottomView.SetStatus (RefreshViewStatus.PullToReload);
} else if (!bottomView.IsFlipped && bottomOffset < -yboundary){
bottomView.Flip (true);
bottomView.SetStatus (RefreshViewStatus.ReleaseToReload);
}
}