PullToRefreshBase.java 文件源码

java
阅读 41 收藏 0 点赞 0 评论 0

项目:letv 作者:
private final void smoothScrollTo(int newScrollValue, long duration, long delayMillis, OnSmoothScrollFinishedListener listener) {
    int oldScrollValue;
    if (this.mCurrentSmoothScrollRunnable != null) {
        this.mCurrentSmoothScrollRunnable.stop();
    }
    switch (getPullToRefreshScrollDirection()) {
        case HORIZONTAL:
            oldScrollValue = getScrollX();
            break;
        default:
            oldScrollValue = getScrollY();
            break;
    }
    if (oldScrollValue != newScrollValue) {
        if (this.mScrollAnimationInterpolator == null) {
            this.mScrollAnimationInterpolator = new DecelerateInterpolator();
        }
        this.mCurrentSmoothScrollRunnable = new SmoothScrollRunnable(oldScrollValue, newScrollValue, duration, listener);
        if (delayMillis > 0) {
            postDelayed(this.mCurrentSmoothScrollRunnable, delayMillis);
        } else {
            post(this.mCurrentSmoothScrollRunnable);
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号