Example usage for android.app ProgressDialog setIndeterminate

List of usage examples for android.app ProgressDialog setIndeterminate

Introduction

In this page you can find the example usage for android.app ProgressDialog setIndeterminate.

Prototype

public void setIndeterminate(boolean indeterminate) 

Source Link

Document

Change the indeterminate mode for this ProgressDialog.

Usage

From source file:net.zionsoft.obadiah.ui.fragments.ProgressDialogFragment.java

@Override
@NonNull//from   w  w  w . jav  a 2  s .c o  m
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final ProgressDialog dialog = new ProgressDialog(getActivity());

    final Bundle args = getArguments();
    if (args.containsKey(KEY_MAX_PROGRESS)) {
        dialog.setIndeterminate(false);
        dialog.setMax(args.getInt(KEY_MAX_PROGRESS));
        dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    }
    dialog.setMessage(getString(args.getInt(KEY_MESSAGE)));

    dialog.show();
    return dialog;
}

From source file:cz.tomas.StockAnalyze.fragments.ProgressDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    if (getArguments() == null) {
        throw new RuntimeException("use newInstance(...) static method to initialize this dialog");
    }//from   ww  w .j ava2  s .  co m
    int title = getArguments().getInt("title");
    int messageId = getArguments().getInt("message");

    ProgressDialog dlg = new ProgressDialog(getActivity());
    dlg.setTitle(title);
    dlg.setMessage(getText(messageId));
    dlg.setCancelable(true);
    dlg.setIndeterminate(true);
    return dlg;
}

From source file:org.pixmob.freemobile.netstat.ui.ExportDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final ProgressDialog dialog = new ProgressDialog(getActivity());
    dialog.setMessage(getString(R.string.exporting_data));
    dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    dialog.setIndeterminate(true);
    dialog.setCancelable(false);//from  w  ww  .  ja  v a  2s  .  c o  m
    return dialog;
}

From source file:siarhei.luskanau.gps.tracker.free.ui.dialog.CheckServerDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    ServerEntity serverEntity = AppConstants.GSON.fromJson(getArguments().getString(SERVER_ENTITY_ARG),
            ServerEntity.class);
    Log.e(TAG, AppConstants.GSON.toJson(serverEntity));
    ProgressDialog progressDialog = new ProgressDialog(getActivity());
    progressDialog.setMessage("connecting...");
    progressDialog.setIndeterminate(true);
    new CheckAsyncTask(serverEntity).execute();
    return progressDialog;
}

From source file:com.amalgam.app.SupportProgressDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Bundle args = getArguments();//from   w  ww .  j ava2 s .co  m
    String title = args.getString(ARGS_TITLE);
    String message = args.getString(ARGS_MESSAGE);
    boolean indeterminate = args.getBoolean(ARGS_INDETERMINATE);
    ProgressDialog dialog = new ProgressDialog(getActivity());
    if (title != null) {
        dialog.setTitle(title);
    }
    dialog.setMessage(message);
    dialog.setIndeterminate(indeterminate);
    return dialog;
}

From source file:de.uni.stuttgart.informatik.ToureNPlaner.UI.Dialogs.MyProgressDialog.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final android.app.ProgressDialog dialog = new android.app.ProgressDialog(getActivity());
    dialog.setTitle(getArguments().getString("title"));
    dialog.setMessage(getArguments().getString("message"));
    dialog.setIndeterminate(true);
    dialog.setCancelable(true);//from   w w  w .  jav  a  2s .co  m
    return dialog;
}

From source file:org.dash.wallet.integration.uphold.ui.UpholdAccountActivity.java

private void loadUserBalance() {
    final ProgressDialog loadingDialog = new ProgressDialog(this);
    loadingDialog.setIndeterminate(true);
    loadingDialog.setCancelable(false);/*from  w w w.java2  s  . co m*/
    loadingDialog.setMessage(getString(R.string.loading));
    loadingDialog.show();

    UpholdClient.getInstance().getDashBalance(new UpholdClient.Callback<BigDecimal>() {
        @Override
        public void onSuccess(BigDecimal data) {
            balance = data;
            balanceView.setAmount(Coin.parseCoin(balance.toString()));
            loadingDialog.cancel();
        }

        @Override
        public void onError(Exception e, boolean otpRequired) {
            loadingDialog.cancel();
            showErrorAlert();
        }
    });
}

From source file:ca.rmen.android.scrumchatter.dialog.ProgressDialogFragment.java

/**
 * @return an indeterminate, non-cancelable, ProgressDialog with a message.
 *///from   ww w.  j  a  v a2 s .com
@Override
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Log.v(TAG, "onCreateDialog: savedInstanceState = " + savedInstanceState);
    ProgressDialog dialog = new ProgressDialog(getActivity());
    Bundle arguments = getArguments();
    dialog.setMessage(arguments.getString(DialogFragmentFactory.EXTRA_MESSAGE));
    dialog.setIndeterminate(true);
    dialog.setOnShowListener(shownDialog -> {
        ProgressBar progressBar = (ProgressBar) ((ProgressDialog) shownDialog)
                .findViewById(android.R.id.progress);
        if (progressBar != null) {
            Drawable drawable = progressBar.getIndeterminateDrawable();
            if (drawable != null) {
                drawable.setColorFilter(
                        ContextCompat.getColor(getActivity(), R.color.scrum_chatter_accent_color),
                        android.graphics.PorterDuff.Mode.SRC_IN);
            }
        }
    });
    dialog.setCancelable(false);
    return dialog;
}

From source file:com.esri.arcgisruntime.sample.generateofflinemapwithlocalbasemap.ProgressDialogFragment.java

@NonNull
@Override/*from   w ww.  ja v  a  2 s.  co m*/
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
    super.onCreateDialog(savedInstanceState);
    // create a dialog to show progress
    final ProgressDialog progressDialog = new ProgressDialog(getActivity());
    progressDialog.setTitle(mTitle);
    progressDialog.setMessage(mMessage);
    progressDialog.setIndeterminate(false);
    progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    progressDialog.setMax(100);
    progressDialog.setButton(DialogInterface.BUTTON_NEGATIVE, mCancel, (dialog, which) -> onDismiss(dialog));
    return progressDialog;
}

From source file:org.mobisocial.corral.BackgroundableDownloadDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    ProgressDialog d = new ProgressDialog(getActivity());
    d.setTitle("Fetching file");
    d.setMessage("Preparing to download...");
    d.setIndeterminate(true);
    d.setCancelable(true);/*from   w w  w . ja va 2s. co m*/
    d.setButton(DialogInterface.BUTTON_POSITIVE, "Background", mBackgroundListener);
    d.setButton(DialogInterface.BUTTON_NEGATIVE, "Cancel", mCancelListener);
    return d;
}