use of org.edx.mobile.view.adapters.DownloadEntryAdapter in project edx-app-android by edx.
the class DownloadListActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_downloads_list);
super.setToolbarAsActionBar();
environment.getAnalyticsRegistry().trackScreenView(Analytics.Screens.DOWNLOADS);
adapter = new DownloadEntryAdapter(this, environment) {
@Override
public void onItemClicked(DownloadEntryAdapter.Item model) {
// nothing to do here
}
@Override
public void onDeleteClicked(DownloadEntryAdapter.Item item) {
assert adapter != null;
final VideoModel videoModel = ((DownloadItem) item).model;
if (environment.getStorage().removeDownload(videoModel) >= 1) {
adapter.remove(item);
}
}
};
loadingIndicator = findViewById(R.id.loading_indicator);
downloadListView = (ListView) findViewById(R.id.my_downloads_list);
downloadListView.setAdapter(adapter);
loadingIndicator.setVisibility(View.VISIBLE);
downloadListView.setVisibility(View.GONE);
}
Aggregations