use of zlc.season.rxdownloadproject.model.DownloadItem in project RxDownload by ssseasonnn.
the class DownloadManagerActivity method loadData.
private void loadData() {
RxDownload.getInstance(this).getTotalDownloadRecords().map(new Function<List<DownloadRecord>, List<DownloadItem>>() {
@Override
public List<DownloadItem> apply(List<DownloadRecord> downloadRecords) throws Exception {
List<DownloadItem> result = new ArrayList<>();
for (DownloadRecord each : downloadRecords) {
DownloadItem bean = new DownloadItem();
bean.record = each;
result.add(bean);
}
return result;
}
}).subscribe(new Consumer<List<DownloadItem>>() {
@Override
public void accept(List<DownloadItem> downloadBeen) throws Exception {
mAdapter.addAll(downloadBeen);
}
});
}
use of zlc.season.rxdownloadproject.model.DownloadItem in project RxDownload by ssseasonnn.
the class DownloadManagerActivity method onDestroy.
@Override
protected void onDestroy() {
super.onDestroy();
List<DownloadItem> list = mAdapter.getData();
for (DownloadItem each : list) {
Utils.dispose(each.disposable);
}
}
Aggregations