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

首次进入页面会自动加载更多? #25

Closed
evanwsu opened this issue Aug 6, 2020 · 4 comments
Closed

首次进入页面会自动加载更多? #25

evanwsu opened this issue Aug 6, 2020 · 4 comments

Comments

@evanwsu
Copy link

evanwsu commented Aug 6, 2020

首次进入页面adapter.getItemCount为0,LoadMoreAdapter会添加一个footer, 然后会加载更多,ui看起来很奇怪,因为加载更多在顶部,位置接近SwipeRefreshLayout下拉的地方。

@nukc
Copy link
Owner

nukc commented Aug 7, 2020

是会的,因为未铺满屏幕的时候会触发加载更多方法,假如在A手机加载10个铺满了屏幕还可以往下滑动,触发加载更多是在这一块的逻辑 LoadMoreAdapter.java#L277-L314#OnScrollListener ,这个是一般情况下。但是同样的数据在B手机10个未铺满屏幕,这个时候 OnScrollListener 是无法触发的,但是也是需要再触发一次加载更多以确认是否还有更多数据。这个时候就在 LoadMoreAdapter.java#L114-L125 进行了判断

@evanwsu
Copy link
Author

evanwsu commented Aug 7, 2020

首次进入会显示加载更多的footer, 没办法关掉,尝试设置loadMoreEnable为false, 会改变mShouldRemove标识,最终还是显示footer,只能修改源码了。 原因是进入页面会有一个loading dialog,这时候底部出现一个加载更多,看起来很奇怪。

@nukc
Copy link
Owner

nukc commented Aug 10, 2020

安排,但近期比较忙

@nukc
Copy link
Owner

nukc commented Aug 25, 2020

@evansherry 使用 setNotShowFooterWhenNotCoveredScreen(true)

@nukc nukc closed this as completed Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants