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:com.example.levelup.core.app.ProgressFragment.java

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

    progressDialog.setIndeterminate(true);
    progressDialog.setCancelable(mLoaderId != LOADER_ID_NOT_SPECIFIED);
    progressDialog.setTitle(mTitle);//from  w ww  .  ja  v a2s . co  m
    progressDialog.setMessage(getText(mMessage));

    if (mLoaderId != LOADER_ID_NOT_SPECIFIED) {
        progressDialog.setOnCancelListener(new OnCancelListener() {
            @Override
            public void onCancel(DialogInterface dialog) {
                getLoaderManager().destroyLoader(mLoaderId);
            }
        });
    }

    return progressDialog;
}

From source file:at.ac.uniklu.mobile.sportal.DashboardLogoutProgressDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    ProgressDialog d = new ProgressDialog(getActivity());
    d.setIndeterminate(true);
    d.setCancelable(false);/*w  w  w .ja  v  a2  s.  c  o m*/
    d.setMessage(getString(R.string.work_logout));
    return d;
}

From source file:org.totschnig.myexpenses.dialog.ProgressDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final ProgressDialog dialog = new ProgressDialog(getActivity());
    dialog.setMessage(getString(getArguments().getInt("message")));
    dialog.setIndeterminate(true);
    dialog.setCancelable(false);//www . ja va 2  s . c  om

    // 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:ro.expectations.expenses.widget.dialog.ProgressDialogFragment.java

@NonNull
@Override//from  ww  w. j a  v  a  2 s . c  om
public Dialog onCreateDialog(Bundle savedInstanceState) {
    String message = getArguments().getString(ARG_MESSAGE, null);
    ProgressDialog progressDialog = new ProgressDialog(getActivity());
    if (message != null) {
        progressDialog.setMessage(message);
    }
    progressDialog.setIndeterminate(true);
    return progressDialog;
}

From source file:com.github.yuukis.businessmap.app.ProgressDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    boolean cancelable = getArguments().getBoolean(CANCELABLE, false);
    setCancelable(cancelable);/* w  w w. j ava  2s.  c  o  m*/

    String title = getArguments().getString(TITLE);
    String message = getArguments().getString(MESSAGE);
    ProgressDialog dialog = new ProgressDialog(getActivity());
    dialog.setTitle(title);
    dialog.setMessage(message);
    dialog.setIndeterminate(false);
    dialog.setCanceledOnTouchOutside(false);

    dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
    dialog.setMax(getArguments().getInt(MAX));

    return dialog;
}

From source file:com.synox.android.ui.dialog.IndeterminateProgressDialog.java

/**
 * {@inheritDoc}/*from w  w  w.  ja va  2s  .c  o  m*/
 */
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    /// create indeterminate progress dialog
    final ProgressDialog progressDialog = new ProgressDialog(getActivity(), R.style.ProgressDialogTheme);
    progressDialog.setIndeterminate(true);
    progressDialog.setOnShowListener(new DialogInterface.OnShowListener() {
        @Override
        public void onShow(DialogInterface dialog) {
            ProgressBar v = (ProgressBar) progressDialog.findViewById(android.R.id.progress);
            v.getIndeterminateDrawable().setColorFilter(getResources().getColor(R.color.accent),
                    android.graphics.PorterDuff.Mode.MULTIPLY);

        }
    });

    /// set message
    int messageId = getArguments().getInt(ARG_MESSAGE_ID, R.string.placeholder_sentence);
    progressDialog.setMessage(getString(messageId));

    /// set cancellation behavior
    boolean cancelable = getArguments().getBoolean(ARG_CANCELABLE, false);
    if (!cancelable) {
        progressDialog.setCancelable(false);
        // disable the back button
        OnKeyListener keyListener = new OnKeyListener() {
            @Override
            public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {

                return keyCode == KeyEvent.KEYCODE_BACK;
            }

        };
        progressDialog.setOnKeyListener(keyListener);
    }

    return progressDialog;
}

From source file:org.alfresco.mobile.android.ui.fragments.WaitingDialogFragment.java

public Dialog onCreateDialog(final Bundle savedInstanceState) {
    if (getArguments() != null) {
        titleId = getArguments().getInt(ARGUMENT_TITLEID);
        messageId = getArguments().getInt(ARGUMENT_MESSAGEID);
        isCancelable = getArguments().getBoolean(ARGUMENT_CANCELABLE);
    }/*from  ww  w .  j  a  v a2  s .  co m*/

    final ProgressDialog dialog = new ProgressDialog(getActivity());
    dialog.setTitle(titleId);
    dialog.setMessage(getString(messageId));
    dialog.setIndeterminate(true);
    dialog.setCancelable(isCancelable);
    return dialog;
}

From source file:com.cerema.cloud2.ui.dialog.IndeterminateProgressDialog.java

/**
 * {@inheritDoc}// www .jav a2 s.  c om
 */
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    /// create indeterminate progress dialog
    final ProgressDialog progressDialog = new ProgressDialog(getActivity(), R.style.ProgressDialogTheme);
    progressDialog.setIndeterminate(true);
    progressDialog.setOnShowListener(new DialogInterface.OnShowListener() {
        @Override
        public void onShow(DialogInterface dialog) {
            ProgressBar v = (ProgressBar) progressDialog.findViewById(android.R.id.progress);
            v.getIndeterminateDrawable().setColorFilter(getResources().getColor(R.color.color_accent),
                    android.graphics.PorterDuff.Mode.MULTIPLY);

        }
    });

    /// set message
    int messageId = getArguments().getInt(ARG_MESSAGE_ID, R.string.placeholder_sentence);
    progressDialog.setMessage(getString(messageId));

    /// set cancellation behavior
    boolean cancelable = getArguments().getBoolean(ARG_CANCELABLE, false);
    if (!cancelable) {
        progressDialog.setCancelable(false);
        // 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;
            }

        };
        progressDialog.setOnKeyListener(keyListener);
    }

    return progressDialog;
}

From source file:org.cvasilak.jboss.mobile.app.fragments.dialogs.ProgressDialogFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    ProgressDialog dialog = new ProgressDialog(getActivity());
    dialog.setMessage(getActivity().getString(getArguments().getInt("message")));
    dialog.setIndeterminate(true);
    dialog.setCancelable(false);/*from   w w w . j a  v a  2 s. c o  m*/

    // Disable the back button
    DialogInterface.OnKeyListener keyListener = new DialogInterface.OnKeyListener() {
        @Override
        public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
            return (keyCode == KeyEvent.KEYCODE_BACK);
        }
    };

    dialog.setOnKeyListener(keyListener);
    return dialog;
}

From source file:org.fossasia.phimpme.share.nextcloud.IndeterminateProgressDialog.java

/**
 * {@inheritDoc}//from  www. j  a va2 s  .c  o m
 */
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    /// create indeterminate progress dialog
    final ProgressDialog progressDialog = new ProgressDialog(getActivity(), R.style.ProgressDialogTheme);
    progressDialog.setIndeterminate(true);
    progressDialog.setOnShowListener(new DialogInterface.OnShowListener() {
        @Override
        public void onShow(DialogInterface dialog) {
            ProgressBar v = (ProgressBar) progressDialog.findViewById(android.R.id.progress);
            v.getIndeterminateDrawable().setColorFilter(getResources().getColor(R.color.colorAccent),
                    android.graphics.PorterDuff.Mode.MULTIPLY);

        }
    });

    /// set message
    int messageId = getArguments().getInt(ARG_MESSAGE_ID, R.string.placeholder_sentence);
    progressDialog.setMessage(getString(messageId));

    /// set cancellation behavior
    boolean cancelable = getArguments().getBoolean(ARG_CANCELABLE, false);
    if (!cancelable) {
        progressDialog.setCancelable(false);
        // 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;
            }

        };
        progressDialog.setOnKeyListener(keyListener);
    }

    return progressDialog;
}