Skip to content

AutoRefresh_en

Zone edited this page Jan 18, 2017 · 1 revision

see the source,Analysis of the logic

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

文档

[Home/总览概要] en/cn

[AutoRefresh]en/cn

[AnimateBack]en/cn

[GlobalConfiguration]en/cn

[IFooterView]en/cn

[IHeaderView]en/cn

[IResistance]en/cn

[Update Logs]en/cn

Clone this wiki locally