How to delete/remove PagedListAdapter item

前端 未结 4 711
既然无缘
既然无缘 2021-02-12 18:09

Currently I am using Android Architecture Components for App development everything is working along with paging library Now I want to remove recyclerview Item

4条回答
  •  北海茫月
    2021-02-12 18:58

    Temporary hide item in list by call notifyItemUpdated() base on flags set in Pojo object

    if(data?.hasVisible == false) {
                itemBinding.root.visibility = View.GONE
                itemBinding.root.layoutParams = RecyclerView.LayoutParams(0, 0)
            }else{
                itemBinding.root.visibility = View.VISIBLE
                itemBinding.root.layoutParams = RecyclerView.LayoutParams(RecyclerView.LayoutParams.MATCH_PARENT,
                    RecyclerView.LayoutParams.WRAP_CONTENT)
            }
    

提交回复
热议问题