4
怎么使用ViewModel 和 RecyclerView
source link: https://jiajunhuang.com/articles/2021_01_03-recycler_list_view_model.md.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
怎么使用ViewModel 和 RecyclerView
ansible 简明教程
怎么使用ViewModel 和 RecyclerView
当他们分开使用的时候,很简单,但是怎么把ViewModel和RecyclerView结合在一起呢?
代码如下:
model.assetItemList.observe(this, {
binding.nothingHint.nothingHint.isVisible = it.isEmpty()
val adapter = AssetDebtItemAdapter(it, currency)
binding.recyclerView.adapter = adapter
adapter.notifyDataSetChanged()
})
关注公众号,获得及时更新
ansible 简明教程
Golang的short variable declaration
一起来做贼:Goroutine原理和Work stealing
@jiajunhuang 2015-2020, All Rights Reserved。本站禁止转载,引用请注明作者与原链。
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK