Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

刷新显示的状态下,手动向上滑动,如果再次下滑能否还是保持前面的刷新状态。 #77

Open
NiceNicks opened this issue Apr 7, 2018 · 2 comments

Comments

@NiceNicks
Copy link

下拉刷新后,正在进行阻塞网络请求,如果网络状况差,一直在等待。此时手动向上滑,隐藏head后,再次下拉会重新再走一次刷新流程,相当于又进行一次网络请求。请问能否保持上一次刷新的状态。再次下拉时,headView的状态不会重置。

@NiceNicks
Copy link
Author

我尝试改了下,在OnTouchEvent()里面,加上刷新的判断。刷新完成后再将hasRefresh置为false..这样可以保存上次的刷新状态。再次下拉后不会重新开始刷新了

1:
//回调onDropAnim接口
if (!hasRefresh) {
Log.d("tanjunwen", "onTouchEvent: 2");
callOnDropAnim();
//回调callOnPreDrag接口
callOnPreDrag();
//回调onLimitDes接口
callOnLimitDes();
isFirst = false;
}
2:
case MotionEvent.ACTION_UP:
if (!hasRefresh) {
restSmartPosition();
isFirst = true;
_firstDrag = true;
dsY = 0;
dy = 0;
}
needResetAnim = true;

@liaoinstan
Copy link
Owner

SpringView并不会考虑业务逻辑,你的状态保存的逻辑可以放在Header中,你可以自定义你的Header,或者重写已有的Header,如果是用户手动关闭的话在onFinishAnim()中不重置header即可

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants