Search in sources :

Example 91 with ProgressDialog

use of android.app.ProgressDialog in project android-bootstrap by AndroidBootstrap.

the class BootstrapAuthenticatorActivity method onCreateDialog.

@Override
protected Dialog onCreateDialog(int id) {
    final ProgressDialog dialog = new ProgressDialog(this);
    dialog.setMessage(getText(string.message_signing_in));
    dialog.setIndeterminate(true);
    dialog.setCancelable(true);
    dialog.setOnCancelListener(new DialogInterface.OnCancelListener() {

        public void onCancel(final DialogInterface dialog) {
            if (authenticationTask != null) {
                authenticationTask.cancel(true);
            }
        }
    });
    return dialog;
}
Also used : DialogInterface(android.content.DialogInterface) ProgressDialog(android.app.ProgressDialog)

Example 92 with ProgressDialog

use of android.app.ProgressDialog in project AntennaPod by AntennaPod.

the class PreferenceController method export.

private boolean export(ExportWriter exportWriter) {
    Context context = ui.getActivity();
    final ProgressDialog progressDialog = new ProgressDialog(context);
    progressDialog.setMessage(context.getString(R.string.exporting_label));
    progressDialog.setIndeterminate(true);
    progressDialog.show();
    final AlertDialog.Builder alert = new AlertDialog.Builder(context).setNeutralButton(android.R.string.ok, (dialog, which) -> dialog.dismiss());
    Observable<File> observable = new ExportWorker(exportWriter).exportObservable();
    subscription = observable.subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).subscribe(output -> {
        alert.setTitle(R.string.opml_export_success_title);
        String message = context.getString(R.string.opml_export_success_sum) + output.toString();
        alert.setMessage(message);
        alert.setPositiveButton(R.string.send_label, (dialog, which) -> {
            Uri outputUri = Uri.fromFile(output);
            Intent sendIntent = new Intent(Intent.ACTION_SEND);
            sendIntent.putExtra(Intent.EXTRA_SUBJECT, context.getResources().getText(R.string.opml_export_label));
            sendIntent.putExtra(Intent.EXTRA_STREAM, outputUri);
            sendIntent.setType("text/plain");
            context.startActivity(Intent.createChooser(sendIntent, context.getResources().getText(R.string.send_label)));
        });
        alert.create().show();
    }, error -> {
        alert.setTitle(R.string.export_error_label);
        alert.setMessage(error.getMessage());
        alert.show();
    }, () -> progressDialog.dismiss());
    return true;
}
Also used : Context(android.content.Context) AlertDialog(android.support.v7.app.AlertDialog) Arrays(java.util.Arrays) DateUtils(android.text.format.DateUtils) PackageManager(android.content.pm.PackageManager) Uri(android.net.Uri) AndroidSchedulers(rx.android.schedulers.AndroidSchedulers) FlattrUtils(de.danoeh.antennapod.core.util.flattr.FlattrUtils) PreferenceScreen(android.preference.PreferenceScreen) EditTextPreference(android.preference.EditTextPreference) UserPreferences(de.danoeh.antennapod.core.preferences.UserPreferences) Manifest(android.Manifest) ExportWorker(de.danoeh.antennapod.asynctask.ExportWorker) Schedulers(rx.schedulers.Schedulers) PreferenceManager(android.preference.PreferenceManager) GpodnetSyncService(de.danoeh.antennapod.core.service.GpodnetSyncService) Log(android.util.Log) WifiConfiguration(android.net.wifi.WifiConfiguration) GpodnetSetHostnameDialog(de.danoeh.antennapod.dialog.GpodnetSetHostnameDialog) GregorianCalendar(java.util.GregorianCalendar) ContextCompat(android.support.v4.content.ContextCompat) ActivityCompat(android.support.v4.app.ActivityCompat) DateFormat(android.text.format.DateFormat) ListPreference(android.preference.ListPreference) List(java.util.List) MainActivity(de.danoeh.antennapod.activity.MainActivity) HtmlWriter(de.danoeh.antennapod.core.export.html.HtmlWriter) ActivityNotFoundException(android.content.ActivityNotFoundException) Html(android.text.Html) AutoFlattrPreferenceDialog(de.danoeh.antennapod.dialog.AutoFlattrPreferenceDialog) ListView(android.widget.ListView) Snackbar(android.support.design.widget.Snackbar) MaterialDialog(com.afollestad.materialdialogs.MaterialDialog) Subscription(rx.Subscription) TextWatcher(android.text.TextWatcher) Converter(de.danoeh.antennapod.core.util.Converter) Context(android.content.Context) TimePickerDialog(android.app.TimePickerDialog) AboutActivity(de.danoeh.antennapod.activity.AboutActivity) AuthenticationDialog(de.danoeh.antennapod.dialog.AuthenticationDialog) ExportWriter(de.danoeh.antennapod.core.export.ExportWriter) Intent(android.content.Intent) CheckBoxPreference(android.preference.CheckBoxPreference) ArrayUtils(org.apache.commons.lang3.ArrayUtils) Editable(android.text.Editable) ArrayList(java.util.ArrayList) Observable(rx.Observable) StatisticsActivity(de.danoeh.antennapod.activity.StatisticsActivity) SuppressLint(android.annotation.SuppressLint) OpmlWriter(de.danoeh.antennapod.core.export.opml.OpmlWriter) Calendar(java.util.Calendar) PreferenceActivity(de.danoeh.antennapod.activity.PreferenceActivity) Toast(android.widget.Toast) CrashReportWriter(de.danoeh.antennapod.CrashReportWriter) StorageUtils(de.danoeh.antennapod.core.util.StorageUtils) Build(android.os.Build) ProxyDialog(de.danoeh.antennapod.dialog.ProxyDialog) R(de.danoeh.antennapod.R) PreferenceActivityGingerbread(de.danoeh.antennapod.activity.PreferenceActivityGingerbread) VariableSpeedDialog(de.danoeh.antennapod.dialog.VariableSpeedDialog) ProgressDialog(android.app.ProgressDialog) File(java.io.File) DirectoryChooserActivity(de.danoeh.antennapod.activity.DirectoryChooserActivity) TimeUnit(java.util.concurrent.TimeUnit) WifiManager(android.net.wifi.WifiManager) AlertDialog(android.support.v7.app.AlertDialog) SharedPreferences(android.content.SharedPreferences) Preference(android.preference.Preference) GpodnetPreferences(de.danoeh.antennapod.core.preferences.GpodnetPreferences) Comparator(java.util.Comparator) Activity(android.app.Activity) Collections(java.util.Collections) EditText(android.widget.EditText) Resources(android.content.res.Resources) ExportWorker(de.danoeh.antennapod.asynctask.ExportWorker) Intent(android.content.Intent) ProgressDialog(android.app.ProgressDialog) File(java.io.File) Uri(android.net.Uri)

Example 93 with ProgressDialog

use of android.app.ProgressDialog in project AntennaPod by AntennaPod.

the class FlattrTokenFetcher method onPreExecute.

@Override
protected void onPreExecute() {
    super.onPreExecute();
    dialog = new ProgressDialog(context);
    dialog.setMessage(context.getString(R.string.processing_label));
    dialog.setIndeterminate(true);
    dialog.setCancelable(false);
    dialog.show();
}
Also used : ProgressDialog(android.app.ProgressDialog)

Example 94 with ProgressDialog

use of android.app.ProgressDialog in project AntennaPod by AntennaPod.

the class MainActivity method onEventMainThread.

public void onEventMainThread(ProgressEvent event) {
    Log.d(TAG, "onEvent(" + event + ")");
    switch(event.action) {
        case START:
            pd = new ProgressDialog(this);
            pd.setMessage(event.message);
            pd.setIndeterminate(true);
            pd.setCancelable(false);
            pd.show();
            break;
        case END:
            if (pd != null) {
                pd.dismiss();
            }
            break;
    }
}
Also used : ProgressDialog(android.app.ProgressDialog)

Example 95 with ProgressDialog

use of android.app.ProgressDialog in project hubroid by EddieRingle.

the class GitHubAuthenticatorActivity method onCreateDialog.

@Override
protected Dialog onCreateDialog(int id) {
    final ProgressDialog dialog = new ProgressDialog(this);
    dialog.setMessage(getText(R.string.auth_message_signing_in));
    dialog.setIndeterminate(true);
    dialog.setCancelable(true);
    dialog.setOnCancelListener(new DialogInterface.OnCancelListener() {

        public void onCancel(DialogInterface dialog) {
            if (mAuthenticationTask != null) {
                mAuthenticationTask.cancel(true);
            }
        }
    });
    return dialog;
}
Also used : DialogInterface(android.content.DialogInterface) ProgressDialog(android.app.ProgressDialog)

Aggregations

ProgressDialog (android.app.ProgressDialog)266 DialogInterface (android.content.DialogInterface)47 Intent (android.content.Intent)23 View (android.view.View)21 File (java.io.File)19 TextView (android.widget.TextView)13 SuppressLint (android.annotation.SuppressLint)12 Handler (android.os.Handler)12 FrameLayout (android.widget.FrameLayout)12 ArrayList (java.util.ArrayList)12 IOException (java.io.IOException)11 JSONObject (org.json.JSONObject)10 Uri (android.net.Uri)9 LinearLayout (android.widget.LinearLayout)9 OnCancelListener (android.content.DialogInterface.OnCancelListener)8 Display (android.view.Display)8 Activity (android.app.Activity)7 Dialog (android.app.Dialog)7 ImageView (android.widget.ImageView)7 List (java.util.List)7