Example usage for android.app ProgressDialog setProgressStyle

List of usage examples for android.app ProgressDialog setProgressStyle

Introduction

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

Prototype

public void setProgressStyle(int style) 

Source Link

Document

Sets the style of this ProgressDialog, either #STYLE_SPINNER or #STYLE_HORIZONTAL .

Usage

From source file:uk.org.rivernile.edinburghbustracker.android.fragments.dialogs.IndeterminateProgressDialogFragment.java

/**
 * {@inheritDoc}/*  w  w  w  . j  a  va2s.  co  m*/
 */
@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
    final ProgressDialog d = new ProgressDialog(getActivity());
    d.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    d.setCancelable(true);
    d.setMessage(getArguments().getString(ARG_MESSAGE));

    return d;
}

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);//from w  w  w .ja  va  2 s .c o m
    dialog.setCancelable(false);
    return dialog;
}

From source file:org.hedgewars.hedgeroid.ConnectingDialog.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    ProgressDialog dialog = new ProgressDialog(getActivity());
    dialog.setIndeterminate(true);/*from w  w  w  .  jav a2  s . com*/
    dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    dialog.setTitle(R.string.dialog_connecting_title);
    dialog.setMessage(getString(R.string.dialog_connecting_message));
    return dialog;
}

From source file:id.nci.stm_9.ProgressDialogFragment.java

/**
 * Creates dialog/*from w w  w.  ja  v a  2s  .  c o  m*/
 */
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Activity activity = getActivity();

    ProgressDialog dialog = new ProgressDialog(activity);
    dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    dialog.setCancelable(false);
    dialog.setCanceledOnTouchOutside(false);

    int messageId = getArguments().getInt(ARG_MESSAGE_ID);
    int style = getArguments().getInt(ARG_STYLE);

    dialog.setMessage(getString(messageId));
    dialog.setProgressStyle(style);

    // Disable the back button
    OnKeyListener keyListener = new OnKeyListener() {

        @Override
        public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {

            if (keyCode == KeyEvent.KEYCODE_BACK) {
                return true;
            }
            return false;
        }

    };
    dialog.setOnKeyListener(keyListener);

    return dialog;
}

From source file:com.commonsware.android.progdlg.SampleDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    ProgressDialog dlg = new ProgressDialog(getActivity());

    dlg.setMessage(getActivity().getString(R.string.dlg_title));
    dlg.setIndeterminate(true);/*from  ww w  .  j av  a  2s  .  com*/
    dlg.setProgressStyle(ProgressDialog.STYLE_SPINNER);

    return (dlg);
}

From source file:gov.wa.wsdot.android.wsdot.util.ProgressDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    ProgressDialog dialog = new ProgressDialog(getActivity(), getTheme());
    dialog.setMessage(getArguments().getString("message"));
    dialog.setIndeterminate(true);/*from   w  ww .  j av a2s.co  m*/
    dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    return dialog;
}

From source file:org.thialfihar.android.apg.ui.dialog.ProgressDialogFragment.java

/**
 * Creates dialog/*  w w w.j av a2 s.co m*/
 */
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final Activity activity = getActivity();

    ProgressDialog dialog = new ProgressDialog(activity);
    dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    dialog.setCancelable(false);
    dialog.setCanceledOnTouchOutside(false);

    String message = getArguments().getString(ARG_MESSAGE);
    int style = getArguments().getInt(ARG_STYLE);
    boolean cancelable = getArguments().getBoolean(ARG_CANCELABLE);

    dialog.setMessage(message);
    dialog.setProgressStyle(style);

    if (cancelable) {
        dialog.setButton(DialogInterface.BUTTON_NEGATIVE, activity.getString(R.string.progress_cancel),
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.cancel();
                    }
                });
    }

    // Disable the back button
    OnKeyListener keyListener = new OnKeyListener() {

        @Override
        public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
            if (keyCode == KeyEvent.KEYCODE_BACK) {
                return true;
            }
            return false;
        }

    };
    dialog.setOnKeyListener(keyListener);

    return dialog;
}

From source file:com.softminds.matrixcalculator.OperationFragments.AdjointFragment.java

@Override
public void onListItemClick(ListView L, View V, int position, long id) {
    ProgressDialog progressDialog = new ProgressDialog(getContext());
    progressDialog.setMessage(getString(R.string.Calculating));
    progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    progressDialog.setIndeterminate(false);
    progressDialog.setCanceledOnTouchOutside(false);
    progressDialog.show();/*from  w  w w  .ja va  2  s  .c  o  m*/
    RunToGetDeterminant(position, progressDialog);
}

From source file:tv.loilo.promise.samples.progress.SampleProgressSpinnerDialogFragment.java

@NonNull
@Override/*from  ww  w .j  a v a 2s .  c o  m*/
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final ProgressDialog progressDialog = new ProgressDialog(getContext(), getTheme());
    progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    progressDialog.setMessage("Loading...");
    progressDialog.setButton(DialogInterface.BUTTON_NEGATIVE, "Cancel", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {

        }
    });
    return progressDialog;
}

From source file:com.softminds.matrixcalculator.OperationFragments.TraceFragment.java

@Override
public void onListItemClick(ListView l, View v, int position, long id) {
    ProgressDialog progressDialog = new ProgressDialog(getContext());
    progressDialog.setMessage(getString(R.string.Calculating));
    progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    progressDialog.setIndeterminate(true);
    progressDialog.setCanceledOnTouchOutside(false);
    progressDialog.show();//ww w  . ja v a 2s  .c  om
    RunToGetTrace(position, progressDialog);
}