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

下拉刷新下调用的 adapter.clear() 会使 布局文件中的empty显示出来,这个该怎么处理?会影响用户体验 #279

Open
maoai-xianyu opened this issue Nov 2, 2018 · 3 comments

Comments

@maoai-xianyu
Copy link

image
RefreshAndMoreActivity activity_loadmore.xml 中添加了 view_empty.xml . 因为在实际应用中我们是需要请求网络的,那么请求网络会需要一定的时间,源码中,下拉刷新中 adapter.clear(); 会导致布局文件中的view_empty.xml显示,如图
image
所以这个该怎么处理,这个会影响用户的体验

@maoai-xianyu
Copy link
Author

大佬,我等待着你的回复

@maoai-xianyu
Copy link
Author

在数据请求回来,做adpater.clear();会好一点的,有木有优化的方案。 模拟网路后,当page++的时候做下面的操作

image

@ciscolxh
Copy link

我看的你的代码是刷新时候不管什么首先先把数据clear了。这个就是错误的。并且没有网络不应该是showError之类的一个view吗,为啥没有网络的时候执行加载更多。正正的刷新数据应该执行在addAll之前

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