Update by payload fixed (#106)

This commit is contained in:
Arseniy Borisov 2017-11-13 12:09:58 +03:00 committed by Gavriil Sitnikov
parent 848e4ec287
commit 7bd7137b82
1 changed files with 5 additions and 0 deletions

View File

@ -104,6 +104,11 @@ public abstract class ObservableCollectionAdapter<TItem, TItemViewHolder extends
lifecycleBindable.untilDestroy(observableCollectionSubject
.switchMap(optional -> {
final ObservableCollection<TItem> collection = optional.get();
if (collection instanceof ObservableList) {
innerCollection.setDiffUtilsSource((ObservableList<TItem>) collection);
} else {
innerCollection.setDiffUtilsSource(null);
}
return collection != null ? collection.observeItems() : Observable.just(Collections.emptyList());
}), innerCollection::set);
lifecycleBindable.untilDestroy(createMoreAutoLoadingObservable());