Search in sources :

Example 1 with ConfirmSoundcloudDownloadDialog

use of com.frostwire.android.gui.dialogs.ConfirmSoundcloudDownloadDialog in project frostwire by frostwire.

the class DownloadSoundcloudFromUrlTask method createConfirmListDialog.

private ConfirmSoundcloudDownloadDialog createConfirmListDialog(Context ctx, List<SoundcloudSearchResult> results) {
    String title = ctx.getString(R.string.confirm_download);
    String whatToDownload = ctx.getString((results.size() > 1) ? R.string.playlist : R.string.track);
    String totalSize = UIUtils.getBytesInHuman(getTotalSize(results));
    String text = ctx.getString(R.string.are_you_sure_you_want_to_download_the_following, whatToDownload, totalSize);
    // AbstractConfirmListDialog
    ConfirmSoundcloudDownloadDialog dlg = ConfirmSoundcloudDownloadDialog.newInstance(ctx, title, text, results);
    return dlg;
}
Also used : ConfirmSoundcloudDownloadDialog(com.frostwire.android.gui.dialogs.ConfirmSoundcloudDownloadDialog)

Example 2 with ConfirmSoundcloudDownloadDialog

use of com.frostwire.android.gui.dialogs.ConfirmSoundcloudDownloadDialog in project frostwire by frostwire.

the class DownloadSoundcloudFromUrlTask method onPostExecute.

@Override
protected void onPostExecute(Context ctx, List<SoundcloudSearchResult> results) {
    if (ctx != null && !results.isEmpty()) {
        MainActivity activity = (MainActivity) ctx;
        ConfirmSoundcloudDownloadDialog dlg = createConfirmListDialog(ctx, results);
        dlg.show(activity.getFragmentManager());
    }
}
Also used : ConfirmSoundcloudDownloadDialog(com.frostwire.android.gui.dialogs.ConfirmSoundcloudDownloadDialog) MainActivity(com.frostwire.android.gui.activities.MainActivity)

Aggregations

ConfirmSoundcloudDownloadDialog (com.frostwire.android.gui.dialogs.ConfirmSoundcloudDownloadDialog)2 MainActivity (com.frostwire.android.gui.activities.MainActivity)1