Kelin-Hong / MVVMLight

A toolkit help to build Android MVVM Application
1.85k stars 333 forks source link

ViewGroup的绑定功能刷新逻辑和一个坑 #14

Open life2015 opened 7 years ago

life2015 commented 7 years ago

可类似listview adapter加入ViewGroup的增量刷新逻辑 或者小幅度修改代码可适配ObserveableList add方法调用时候的增量刷新逻辑

因为Observable只是实现部分的功能(并没有实现removeAll)

//            viewModels.removeAll(moreBookContainer);
for (ViewModel viewModel : moreBookContainer) {
viewModels.remove(viewModel);
}

这个在ViewGroup绑定功能的介绍里面简单提及一下会很棒

life2015 commented 7 years ago

所以在调用RemoveAll() 方法并不会引起对应的刷新 之前以为是框架的问题,后来发现是ObserveableList的坑