-
Notifications
You must be signed in to change notification settings - Fork 4
AutoRefresh_en
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:Logical order-》mIHeaderView.onRefreshing-》scrollTo_/smoothScrollTo_
smoothScrollTo_ will use mIHeaderView's interceptAnimateBack and animateBack