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

关于loadMoreView 默认使用全局静态变量的问题 #3009

Closed
nic562 opened this issue Dec 28, 2019 · 1 comment
Closed

关于loadMoreView 默认使用全局静态变量的问题 #3009

nic562 opened this issue Dec 28, 2019 · 1 comment
Labels

Comments

@nic562
Copy link

nic562 commented Dec 28, 2019

版本: 3.0.0-beta4
问题:全局静态的 loadMoreView 包含的 loadMoreStatus, isLoadEndMoreGone 在全局中共享状态,造成不重启App的话,是无法复位状态,则RecyclerView不能触发加载更多。如果一个App中有多个不同的RecyclerView 使用BaseQuickAdapter,但所有BaseQuickAdapter 都共用这个静态 loadMoreView . 则共享使用了 loadMore 的状态了。这应该是有问题的。

  1. 为何需要这样一个静态变量?
  2. 如果这是必须的,因为 loadMoreStatus, isLoadEndMoreGone 均为 internal set 变量,那么在不自定义loadMoreView的情况下,我该如何重置其状态?

无法通过 isEnableLoadMore 重置其状态
adapter.loadMoreModule.isEnableLoadMore = true

无法通过直接该其属性
adapter.loadMoreModule!!.loadMoreView.isLoadEndMoreGone = false

有疑问的地方在 BaseLoadMoreModule 中第43行

/** 设置加载更多布局 */
var loadMoreView = LoadMoreModuleConfig.defLoadMoreView

和第22行

object LoadMoreModuleConfig {
/**
* 设置全局的LodeMoreView
*/
@JvmStatic
var defLoadMoreView: BaseLoadMoreView = SimpleLoadMoreView()
}

@limuyang2 limuyang2 added the bug label Dec 29, 2019
@limuyang2
Copy link
Collaborator

由于此bug带来的问题表示抱歉,我会尽快修复

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

No branches or pull requests

2 participants