-
Notifications
You must be signed in to change notification settings - Fork 4
AutoRefresh_cn
Zone edited this page Jan 18, 2017
·
1 revision
ZRefreshLayout
public void autoRefresh(boolean haveAnimate) {
if (state == REST) {
//等待回调 刷新完成
state = AUTO_PULL;
log("AUTO_PULL!");
if (mPullListener != null)
mPullListener.refresh(this);
if (mIHeaderView != null) {
mIHeaderView.onRefreshing(headerView.getHeight(), true);
}
if (!haveAnimate)
mIScroll.scrollTo_(getRefreshAbleHeight(), true);
else {
mAnimateBack = AnimateBack.Auto_Refresh;
mIScroll.smoothScrollTo_(getRefreshAbleHeight());
}
}
}
Tips:逻辑顺序-》mIHeaderView.onRefreshing-》scrollTo_/smoothScrollTo_
而smoothScrollTo_会走mIHeaderView的 interceptAnimateBack 和 animateBack