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;
}
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;
}
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();
}
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;
}
}
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;
}
Aggregations