Open darkcgd opened 7 years ago
加载完成状态用户见不到的,数据填充完以后footerview直接就不在屏幕上了。
嗯,但是 松开加载更多 这个状态还是要监听的
我需要在这几个状态下加入一下动画的变化等等
看了很多其他库,都是不尽完美,但其他很多刷新库都有这些状态的回调,如果XRefreshView也有那就很完美了
这个我考虑加下,这周完成吧。
好的,谢谢哈
我在你原有基础上加了,貌似可以
private void updateFooterHeight(int deltaY) { if (mEnablePullLoad) { if (needAddFooterView()) { if (isEmptyViewShowing()) { if (mFooterCallBack.isShowing()) { mFooterCallBack.show(false); } } else { if (mState != XRefreshViewState.STATE_LOADING) { mFooterCallBack.onStateRefreshing(); mState = XRefreshViewState.STATE_LOADING; } } } else if (canReleaseToLoadMore()) { releaseToLoadMore(mHolder.mOffsetY != 0); } } if (needAddFooterView() || enableRecyclerViewPullUp) { if (mEnablePullUpWhenLoadCompleted || !mContentView.hasLoadCompleted()) { if (mContentView.hasLoadCompleted() && needAddFooterView() && mFooterCallBack != null && mFooterCallBack.isShowing()) { mFooterCallBack.show(false); } / if (!needAddFooterView() && mContentView.getState() != XRefreshViewState.STATE_COMPLETE && autoLoadMore) { //当时是recyclerview,自动加载更多,并且没有加载完全的时候,不让Recyclerview上拉 } else / if (mEnablePullLoad || mCanMoveFooterWhenDisablePullLoadMore) { moveView(deltaY); }
if (mEnablePullLoad && !mPullLoading) {
Log.i("============",mHolder.mOffsetY+"::"+mFootHeight+"::"+(mHolder.mOffsetY > mFootHeight));
if (-mHolder.mOffsetY < mFootHeight) {
if (mState != XRefreshViewState.STATE_READY) {
mFooterCallBack.onStateReady();
mState = XRefreshViewState.STATE_READY;
}
} else {
if (mState != XRefreshViewState.STATE_RELEASE_TO_LOADMORE) {
mFooterCallBack.onReleaseToLoadMore();
mState = XRefreshViewState.STATE_RELEASE_TO_LOADMORE;
}
}
}
}
}
}
添加了 if (mEnablePullLoad && !mPullLoading) { Log.i("============",mHolder.mOffsetY+"::"+mFootHeight+"::"+(mHolder.mOffsetY > mFootHeight)); if (-mHolder.mOffsetY < mFootHeight) { if (mState != XRefreshViewState.STATE_READY) { mFooterCallBack.onStateReady(); mState = XRefreshViewState.STATE_READY; } } else { if (mState != XRefreshViewState.STATE_RELEASE_TO_LOADMORE) { mFooterCallBack.onReleaseToLoadMore(); mState = XRefreshViewState.STATE_RELEASE_TO_LOADMORE; } } }
你可以看看
Recyclerview的footerview只有这两个状态?那“松开载入更多”---》“正在载入更多”---》“加载完成” 怎么监听呢?