Skip to content

东哥,添加头部,通过setDifferModels来增加数据,最后一个元素有bug。  #463

Open

Description

@530l

描述

addType<PcStreamDevInfoEntityHead>(R.layout.pc_stream_dev_info_adapter_head_item)
  addType<PcStreamDevInfoEntityFoot>(R.layout.pc_stream_dev_info_adapter_foot_item)
  addType<PcStreamDevInfoEntity>(R.layout.pc_stream_dev_info_adapter_item)
  onBind {
  when (itemViewType) {
  xxxxxxxxxxxxxx
  }
.models = source
mDataBind.recyclerView.bindingAdapter.run {
  addHeader(PcStreamDevInfoEntityHead())
  addFooter(PcStreamDevInfoEntityFoot())
}

//刷新
val newList: MutableList<PcStreamDevInfoEntity> = mutableListOf()
newList.addAll(source)
newList.add(
    PcStreamDevInfoEntity(
        id, "$id",
        coverUrl = "https://img2.huashi6.com/images/resource/2020/07/12/h82924904p0.jpg"
    )
)
mDataBind.recyclerView.setDifferModels(newModels = newList)
source.clear()
source.addAll(newList)

理由

参考实现

是否可以参与实现

由于本项目参与者的技术及精力有限无法满足大部分开发者的需求, 欢迎开发者参与贡献

Activity

  1. 530l commented on Nov 1, 2024

    @530l
    Author
  2. liangjingkanji commented on Nov 23, 2024

    @liangjingkanji
    Owner

    能bug录屏吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions