How to delete/remove PagedListAdapter item

前端 未结 4 951
终归单人心
终归单人心 2021-02-12 18:15

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 19:00

    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)
            }
    

提交回复
热议问题