use of org.edx.mobile.module.storage.BulkVideosDownloadStartedEvent in project edx-app-android by edx.
the class VideoDownloadHelper method showDownloadSizeExceedDialog.
// Dialog fragment to display message to user regarding
private void showDownloadSizeExceedDialog(final ArrayList<DownloadEntry> de, final int noOfDownloads, final FragmentActivity activity, final DownloadManagerCallback callback) {
Map<String, String> dialogMap = new HashMap<String, String>();
dialogMap.put("title", activity.getString(R.string.download_exceed_title));
dialogMap.put("message_1", activity.getString(R.string.download_exceed_message));
downloadFragment = DownloadSizeExceedDialog.newInstance(dialogMap, new IDialogCallback() {
@Override
public void onPositiveClicked() {
if (!de.isEmpty()) {
startDownload(de, activity, callback);
final DownloadEntry downloadEntry = de.get(0);
analyticsRegistry.trackSubSectionBulkVideoDownload(downloadEntry.getSectionName(), downloadEntry.getChapterName(), downloadEntry.getEnrollmentId(), noOfDownloads);
EventBus.getDefault().post(new BulkVideosDownloadStartedEvent());
}
}
@Override
public void onNegativeClicked() {
// updateList();
downloadFragment.dismiss();
EventBus.getDefault().post(new BulkVideosDownloadCancelledEvent());
}
});
downloadFragment.setStyle(DialogFragment.STYLE_NO_TITLE, 0);
downloadFragment.show(activity.getSupportFragmentManager(), "dialog");
downloadFragment.setCancelable(false);
}
Aggregations