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.softminds.matrixcalculator.OperationFragments.ExponentFragment.java

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == 500) {
        ProgressDialog progressDialog = new ProgressDialog(getContext());
        progressDialog.setMessage(getString(R.string.Calculating));
        progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        progressDialog.setIndeterminate(false);
        progressDialog.setCanceledOnTouchOutside(false);
        progressDialog.show();//from w  w  w .  j av a2s.c  o m
        RunAndGetResult(Clicked_pos, data.getIntExtra("QWERTYUIOP", 0), progressDialog);
    }
}

From source file:com.linroid.pushapp.ui.bind.BindActivity.java

@OnClick(R.id.btn_bind)
public void onBindBtnClicked(Button btn) {
    final ProgressDialog dialog = new ProgressDialog(this, R.style.Theme_AppCompat_Light_Dialog);
    dialog.setIndeterminate(true);
    dialog.setMessage(getString(R.string.msg_dialog_bind));
    dialog.setCancelable(false);/*from   w  ww . j  av  a  2s .c o  m*/
    dialog.show();
    authApi.bindDevice(bindToken, queryAndBuildDeviceInfo(), new Callback<Account>() {
        @Override
        @DebugLog
        public void success(Account authInfo, Response response) {
            Device device = authInfo.getDevice();
            User user = authInfo.getUser();
            String token = authInfo.getToken();
            account.setDevice(device);
            account.setUser(user);
            account.setToken(token);
            account.saveToFile();

            dialog.dismiss();
            redirectToHome();
        }

        @Override
        @DebugLog
        public void failure(RetrofitError error) {
            Snackbar.make(switcher, error.getMessage(), Snackbar.LENGTH_SHORT).show();
            dialog.dismiss();
        }
    });
}

From source file:com.ntsync.android.sync.activities.VerifyPaymentProgressDialog.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    ProgressDialog dialog = new ProgressDialog(getActivity());
    dialog.setMessage(getText(R.string.shop_activity_verifyprogress));
    dialog.setIndeterminate(true);
    return dialog;
}

From source file:at.bitfire.davdroid.ui.DeleteCollectionFragment.java

@NonNull
@Override/*from w w w.  j  a  v  a2  s  .c o m*/
public Dialog onCreateDialog(Bundle savedInstanceState) {
    ProgressDialog progress = new ProgressDialog(getContext());
    progress.setTitle(R.string.delete_collection_deleting_collection);
    progress.setMessage(getString(R.string.please_wait));
    progress.setIndeterminate(true);
    progress.setCanceledOnTouchOutside(false);
    setCancelable(false);
    return progress;
}

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

private ProgressDialog showLoading() {
    ProgressDialog progressDialog = new ProgressDialog(getActivity());
    progressDialog.setIndeterminate(true);
    progressDialog.setMessage(getString(R.string.loading));
    progressDialog.show();//from   w w w.  ja va 2s  .  c om
    return progressDialog;
}

From source file:com.cuddlesoft.nori.APISettingsActivity.java

@Override
public void editService(final long rowId, final String name, final String url, final String username,
        final String passphrase) {
    // Show progress dialog during the service type detection process.
    final ProgressDialog dialog = new ProgressDialog(this);
    dialog.setIndeterminate(true);
    dialog.setCancelable(false);/* w  w w  .  j  a v  a  2 s  .  c  o m*/
    dialog.setMessage(getString(R.string.dialog_message_detectingApiType));
    dialog.show();

    // Register broadcast receiver to get results from the background service type detection service.
    registerReceiver(new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            // Get result code from received intent.
            int resultCode = intent.getIntExtra(ServiceTypeDetectionService.RESULT_CODE, -1);
            if (resultCode == ServiceTypeDetectionService.RESULT_OK) {
                // Add a new service to the database on a background thread.
                // This is so database I/O doesn't block the UI thread.
                SearchClient.Settings.APIType apiType = SearchClient.Settings.APIType.values()[intent
                        .getIntExtra(ServiceTypeDetectionService.API_TYPE, 0)];
                final SearchClient.Settings settings = new SearchClient.Settings(apiType, name, url, username,
                        passphrase);
                new Thread(new Runnable() {
                    @Override
                    public void run() {
                        APISettingsDatabase database = new APISettingsDatabase(APISettingsActivity.this);
                        if (rowId == ROW_ID_INSERT) {
                            database.insert(settings);
                        } else {
                            database.update(rowId, settings);
                        }
                        database.close();
                    }
                }).run();
            } else if (resultCode == ServiceTypeDetectionService.RESULT_FAIL_INVALID_URL) {
                Toast.makeText(APISettingsActivity.this, R.string.toast_error_serviceUriInvalid,
                        Toast.LENGTH_LONG).show();
            } else if (resultCode == ServiceTypeDetectionService.RESULT_FAIL_NETWORK) {
                Toast.makeText(APISettingsActivity.this, R.string.toast_error_noNetwork, Toast.LENGTH_LONG)
                        .show();
            } else if (resultCode == ServiceTypeDetectionService.RESULT_FAIL_NO_API) {
                Toast.makeText(APISettingsActivity.this, R.string.toast_error_noServiceAtGivenUri,
                        Toast.LENGTH_LONG).show();
            }

            // Unregister the broadcast receiver.
            unregisterReceiver(this);
            // Dismiss progress dialog.
            dialog.dismiss();
        }
    }, new IntentFilter(ServiceTypeDetectionService.ACTION_DONE));

    // Start the background service type detection service.
    Intent serviceIntent = new Intent(this, ServiceTypeDetectionService.class);
    serviceIntent.putExtra(ServiceTypeDetectionService.ENDPOINT_URL, url);
    startService(serviceIntent);
}

From source file:io.github.tjg1.nori.APISettingsActivity.java

@Override
public void editService(final long rowId, final String name, final String url, final String username,
        final String passphrase) {
    // Show progress dialog during the service type detection process.
    final ProgressDialog dialog = new ProgressDialog(this);
    dialog.setIndeterminate(true);
    dialog.setCancelable(false);/* w  ww  .j  a  va  2s.  c om*/
    dialog.setMessage(getString(R.string.dialog_message_detectingApiType));
    dialog.show();

    // Register broadcast receiver to get results from the background service type detection service.
    registerReceiver(new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            // Get result code from received intent.
            int resultCode = intent.getIntExtra(ServiceTypeDetectionService.RESULT_CODE, -1);
            if (resultCode == ServiceTypeDetectionService.RESULT_OK) {
                // Add a new service to the database on a background thread.
                // This is so database I/O doesn't block the UI thread.
                SearchClient.Settings.APIType apiType = SearchClient.Settings.APIType.values()[intent
                        .getIntExtra(ServiceTypeDetectionService.API_TYPE, 0)];
                final SearchClient.Settings settings = new SearchClient.Settings(apiType, name, url, username,
                        passphrase);
                new Thread(new Runnable() {
                    @Override
                    public void run() {
                        APISettingsDatabase database = new APISettingsDatabase(APISettingsActivity.this);
                        if (rowId == ROW_ID_INSERT) {
                            database.insert(settings);
                        } else {
                            database.update(rowId, settings);
                        }
                        database.close();
                    }
                }).start();
            } else if (resultCode == ServiceTypeDetectionService.RESULT_FAIL_INVALID_URL) {
                Toast.makeText(APISettingsActivity.this, R.string.toast_error_serviceUriInvalid,
                        Toast.LENGTH_LONG).show();
            } else if (resultCode == ServiceTypeDetectionService.RESULT_FAIL_NETWORK) {
                Toast.makeText(APISettingsActivity.this, R.string.toast_error_noNetwork, Toast.LENGTH_LONG)
                        .show();
            } else if (resultCode == ServiceTypeDetectionService.RESULT_FAIL_NO_API) {
                Toast.makeText(APISettingsActivity.this, R.string.toast_error_noServiceAtGivenUri,
                        Toast.LENGTH_LONG).show();
            }

            // Unregister the broadcast receiver.
            unregisterReceiver(this);
            // Dismiss progress dialog.
            dialog.dismiss();
        }
    }, new IntentFilter(ServiceTypeDetectionService.ACTION_DONE));

    // Start the background service type detection service.
    Intent serviceIntent = new Intent(this, ServiceTypeDetectionService.class);
    serviceIntent.putExtra(ServiceTypeDetectionService.ENDPOINT_URL, url);
    startService(serviceIntent);
}

From source file:com.ntsync.android.sync.activities.RegistrateProgressDialog.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    ProgressDialog dialog = new ProgressDialog(getActivity());
    dialog.setMessage(getText(R.string.register_activity_progress));
    dialog.setIndeterminate(true);
    return dialog;
}

From source file:com.ntsync.android.sync.activities.LoginProgressDialog.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    ProgressDialog dialog = new ProgressDialog(getActivity());
    dialog.setMessage(getText(R.string.ui_activity_authenticating));
    dialog.setIndeterminate(true);
    return dialog;
}

From source file:com.pansapiens.occyd.NewPost.java

@Override
protected Dialog onCreateDialog(int id) {
    switch (id) {
    case DIALOG_POSTING: {
        ProgressDialog dialog = new ProgressDialog(this);
        dialog.setTitle("Posting ...");
        dialog.setMessage("Posting ...");
        dialog.setIndeterminate(true);
        dialog.setCancelable(false);/*from  www. j  a  v a  2 s  .  c  o m*/
        return dialog;
    }
    }
    return null;
}