Example usage for android.app DialogFragment setCancelable

List of usage examples for android.app DialogFragment setCancelable

Introduction

In this page you can find the example usage for android.app DialogFragment setCancelable.

Prototype

public void setCancelable(boolean cancelable) 

Source Link

Document

Control whether the shown Dialog is cancelable.

Usage

From source file:org.mariotaku.twidere.util.SaveFileTask.java

@Override
protected void onPreExecute() {
    final DialogFragment fragment = new ProgressDialogFragment();
    fragment.setCancelable(false);
    fragment.show(activity.getFragmentManager(), PROGRESS_FRAGMENT_TAG);
    super.onPreExecute();
}

From source file:com.bonsai.btcreceive.MainActivity.java

private void showStateProgressDialog(String details) {
    DialogFragment df = new StateProgressDialogFragment();
    Bundle args = new Bundle();
    args.putString("details", details);
    df.setArguments(args);//ww w  . j a v  a 2 s.  co  m
    df.setCancelable(false);
    df.show(getFragmentManager(), "state_progress_dialog");
    mStateProgressDialog = df;
}

From source file:com.bonsai.btcreceive.MainActivity.java

private void showSyncProgressDialog() {
    String details;/*from   w  w  w  .j a v  a  2s .  co  m*/

    switch (mWalletService.getSyncState()) {
    case CREATED:
        details = mRes.getString(R.string.sync_details_created);
        break;
    case RESTORE:
        details = mRes.getString(R.string.sync_details_restore);
        break;
    case STARTUP:
        details = mRes.getString(R.string.sync_details_startup);
        break;
    case RESCAN:
        details = mRes.getString(R.string.sync_details_rescan);
        break;
    case RERESCAN:
        details = mRes.getString(R.string.sync_details_rerescan);
        break;
    default:
        details = "???"; // Shouldn't happen
        break;
    }

    DialogFragment df = new SyncProgressDialogFragment();
    Bundle args = new Bundle();
    args.putString("details", details);
    df.setArguments(args);
    df.setCancelable(false);
    df.show(getFragmentManager(), "sync_progress_dialog");
    mSyncProgressDialog = df;
}

From source file:no.hiof.anl.laundrybooking.MainActivity.java

@Override
protected void onResume() {
    super.onResume();
    boolean isFirstTimeOpenApp = settings.getBoolean("isFirstTimeOpenApp", true);

    if (isFirstTimeOpenApp) {
        messages = new ArrayList<>();
        updateMessages();//  w w w.  ja  v a 2 s .c  o  m
        DialogFragment loginDialog = new LoginDialog();
        loginDialog.show(getFragmentManager(), "Fisrt Time Using");
        loginDialog.setCancelable(false);
    } else {
        int user_pin = settings.getInt("userPin", 0);
        //String json = settings.getString("userInfo", null);
        //
        current_user = Database.getUserByPin(user_pin);
        setDrawerUserInfo();
        displayUserInfo();

        String json = settings.getString("messages", null);
        //Log.i("Messages", json);
        Gson gson = new Gson();
        Type collectionType = new TypeToken<ArrayList<Info>>() {
        }.getType();
        messages = gson.fromJson(json, collectionType);
        updateMessages();
        displayUserInfo();
    }

}

From source file:com.mediatek.galleryfeature.stereo.fancycolor.FancyColorActivity.java

private void showLoadingProgress() {
    MtkLog.d(TAG, "<showLoadingProgress>");
    DialogFragment fragment;/* w ww  .  ja  v a 2 s.  c  om*/
    if (mLoadingProgressDialog != null) {
        fragment = mLoadingProgressDialog.get();
        if (fragment != null) {
            if (!fragment.isAdded()) {
                fragment.show(getFragmentManager(), null);
            }
            return;
        }
    }

    final DialogFragment genProgressDialog = new ProgressFragment(" ");
    genProgressDialog.setCancelable(false);
    genProgressDialog.show(getFragmentManager(), null);
    genProgressDialog.setStyle(R.style.RefocusDialog, genProgressDialog.getTheme());
    mLoadingProgressDialog = new WeakReference<DialogFragment>(genProgressDialog);
}

From source file:com.mediatek.galleryfeature.stereo.fancycolor.FancyColorActivity.java

private void showSavingProgress(String albumName) {
    DialogFragment fragment;//www. j a  v a  2 s. co  m

    if (mSavingProgressDialog != null) {
        fragment = mSavingProgressDialog.get();
        if (fragment != null) {
            if (!fragment.isAdded()) {
                fragment.show(getFragmentManager(), null);
            }
            return;
        }
    }
    String progressText;
    if (albumName == null) {
        progressText = getString(R.string.saving_image);
    } else {
        progressText = getString(R.string.m_refocus_saving_image, albumName);
    }
    final DialogFragment genProgressDialog = new ProgressFragment(progressText);
    genProgressDialog.setCancelable(false);
    genProgressDialog.show(getFragmentManager(), null);
    genProgressDialog.setStyle(R.style.RefocusDialog, genProgressDialog.getTheme());
    mSavingProgressDialog = new WeakReference<DialogFragment>(genProgressDialog);
}