Javaのこのコードが、
public class ConcertViewModel extends ViewModel {
  private ConcertDao concertDao;
  public final Observable<PagedList<Concert>> concertList;
  public ConcertViewModel(ConcertDao concertDao) {
    this.concertDao = concertDao;
    concertList = new RxPagedListBuilder<>(
          concertDao.concertsByDate(), 50)
                  .buildObservable();
  }
}
Kotlinでこう書けるはずなのに!
class ConcertViewModel(concertDao: ConcertDao) : ViewModel() {
  val concertList: Observable<PagedList<Concert>> =
        concertDao.concertsByDate().toObservable(pageSize = 50)
}
Paging library overview | Android Developers
見つからない toObservable()。
- Added DataSourceFactory.toLiveData() as a Kotlin alternative for LivePagedListBuilder
- Added DataSourceFactory.toObservable() and toFlowable() as Kotlin alternatives for RxPagedListBuilder
どうやら -ktx のようです。
implementation "androidx.paging:paging-runtime-ktx:2.1.0"
implementation "androidx.paging:paging-rxjava2-ktx:2.1.0"

Maven Repository: androidx.paging
最近は、同じ処理でも複数の書き方があることが多くなって最初混乱したりします。
関連ワード: Android・AndroidStudio・Kotlin・おすすめ・ツール・ライブラリ・開発・livedata・mvvm・paging
 
		 
          